1pub mod storage_control {
18 use crate::Result;
19
20 #[derive(Clone, Debug)]
22 pub(crate) struct RequestBuilder<R: std::default::Default> {
23 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
24 request: R,
25 options: crate::RequestOptions,
26 }
27
28 impl<R> RequestBuilder<R>
29 where
30 R: std::default::Default,
31 {
32 pub(crate) fn new(
33 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
34 ) -> Self {
35 Self {
36 stub,
37 request: R::default(),
38 options: crate::RequestOptions::default(),
39 }
40 }
41 }
42
43 #[derive(Clone, Debug)]
60 pub struct CreateFolder(RequestBuilder<crate::model::CreateFolderRequest>);
61
62 impl CreateFolder {
63 pub(crate) fn new(
64 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
65 ) -> Self {
66 Self(RequestBuilder::new(stub))
67 }
68
69 pub fn with_request<V: Into<crate::model::CreateFolderRequest>>(mut self, v: V) -> Self {
71 self.0.request = v.into();
72 self
73 }
74
75 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
77 self.0.options = v.into();
78 self
79 }
80
81 pub async fn send(self) -> Result<crate::model::Folder> {
83 let req = Self::auto_populate(self.0.request, false);
84 (*self.0.stub)
85 .create_folder(req, self.0.options)
86 .await
87 .map(crate::Response::into_body)
88 }
89
90 fn auto_populate(
91 mut req: crate::model::CreateFolderRequest,
92 force: bool,
93 ) -> crate::model::CreateFolderRequest {
94 if force || req.request_id.is_empty() {
95 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
96 }
97 req
98 }
99
100 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
104 self.0.request.parent = v.into();
105 self
106 }
107
108 pub fn set_folder<T>(mut self, v: T) -> Self
112 where
113 T: std::convert::Into<crate::model::Folder>,
114 {
115 self.0.request.folder = std::option::Option::Some(v.into());
116 self
117 }
118
119 pub fn set_or_clear_folder<T>(mut self, v: std::option::Option<T>) -> Self
123 where
124 T: std::convert::Into<crate::model::Folder>,
125 {
126 self.0.request.folder = v.map(|x| x.into());
127 self
128 }
129
130 pub fn set_folder_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
134 self.0.request.folder_id = v.into();
135 self
136 }
137
138 pub fn set_recursive<T: Into<bool>>(mut self, v: T) -> Self {
140 self.0.request.recursive = v.into();
141 self
142 }
143
144 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
146 self.0.request.request_id = v.into();
147 self
148 }
149 }
150
151 #[doc(hidden)]
152 impl crate::RequestBuilder for CreateFolder {
153 fn request_options(&mut self) -> &mut crate::RequestOptions {
154 &mut self.0.options
155 }
156 }
157
158 #[derive(Clone, Debug)]
175 pub struct DeleteFolder(RequestBuilder<crate::model::DeleteFolderRequest>);
176
177 impl DeleteFolder {
178 pub(crate) fn new(
179 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
180 ) -> Self {
181 Self(RequestBuilder::new(stub))
182 }
183
184 pub fn with_request<V: Into<crate::model::DeleteFolderRequest>>(mut self, v: V) -> Self {
186 self.0.request = v.into();
187 self
188 }
189
190 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
192 self.0.options = v.into();
193 self
194 }
195
196 pub async fn send(self) -> Result<()> {
198 let req = Self::auto_populate(self.0.request, false);
199 (*self.0.stub)
200 .delete_folder(req, self.0.options)
201 .await
202 .map(crate::Response::into_body)
203 }
204
205 fn auto_populate(
206 mut req: crate::model::DeleteFolderRequest,
207 force: bool,
208 ) -> crate::model::DeleteFolderRequest {
209 if force || req.request_id.is_empty() {
210 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
211 }
212 req
213 }
214
215 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
219 self.0.request.name = v.into();
220 self
221 }
222
223 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
225 where
226 T: std::convert::Into<i64>,
227 {
228 self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
229 self
230 }
231
232 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
234 where
235 T: std::convert::Into<i64>,
236 {
237 self.0.request.if_metageneration_match = v.map(|x| x.into());
238 self
239 }
240
241 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
243 where
244 T: std::convert::Into<i64>,
245 {
246 self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
247 self
248 }
249
250 pub fn set_or_clear_if_metageneration_not_match<T>(
252 mut self,
253 v: std::option::Option<T>,
254 ) -> Self
255 where
256 T: std::convert::Into<i64>,
257 {
258 self.0.request.if_metageneration_not_match = v.map(|x| x.into());
259 self
260 }
261
262 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
264 self.0.request.request_id = v.into();
265 self
266 }
267 }
268
269 #[doc(hidden)]
270 impl crate::RequestBuilder for DeleteFolder {
271 fn request_options(&mut self) -> &mut crate::RequestOptions {
272 &mut self.0.options
273 }
274 }
275
276 #[derive(Clone, Debug)]
293 pub struct GetFolder(RequestBuilder<crate::model::GetFolderRequest>);
294
295 impl GetFolder {
296 pub(crate) fn new(
297 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
298 ) -> Self {
299 Self(RequestBuilder::new(stub))
300 }
301
302 pub fn with_request<V: Into<crate::model::GetFolderRequest>>(mut self, v: V) -> Self {
304 self.0.request = v.into();
305 self
306 }
307
308 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
310 self.0.options = v.into();
311 self
312 }
313
314 pub async fn send(self) -> Result<crate::model::Folder> {
316 let req = Self::auto_populate(self.0.request, false);
317 (*self.0.stub)
318 .get_folder(req, self.0.options)
319 .await
320 .map(crate::Response::into_body)
321 }
322
323 fn auto_populate(
324 mut req: crate::model::GetFolderRequest,
325 force: bool,
326 ) -> crate::model::GetFolderRequest {
327 if force || req.request_id.is_empty() {
328 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
329 }
330 req
331 }
332
333 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
337 self.0.request.name = v.into();
338 self
339 }
340
341 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
343 where
344 T: std::convert::Into<i64>,
345 {
346 self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
347 self
348 }
349
350 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
352 where
353 T: std::convert::Into<i64>,
354 {
355 self.0.request.if_metageneration_match = v.map(|x| x.into());
356 self
357 }
358
359 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
361 where
362 T: std::convert::Into<i64>,
363 {
364 self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
365 self
366 }
367
368 pub fn set_or_clear_if_metageneration_not_match<T>(
370 mut self,
371 v: std::option::Option<T>,
372 ) -> Self
373 where
374 T: std::convert::Into<i64>,
375 {
376 self.0.request.if_metageneration_not_match = v.map(|x| x.into());
377 self
378 }
379
380 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
382 self.0.request.request_id = v.into();
383 self
384 }
385 }
386
387 #[doc(hidden)]
388 impl crate::RequestBuilder for GetFolder {
389 fn request_options(&mut self) -> &mut crate::RequestOptions {
390 &mut self.0.options
391 }
392 }
393
394 #[derive(Clone, Debug)]
415 pub struct ListFolders(RequestBuilder<crate::model::ListFoldersRequest>);
416
417 impl ListFolders {
418 pub(crate) fn new(
419 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
420 ) -> Self {
421 Self(RequestBuilder::new(stub))
422 }
423
424 pub fn with_request<V: Into<crate::model::ListFoldersRequest>>(mut self, v: V) -> Self {
426 self.0.request = v.into();
427 self
428 }
429
430 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
432 self.0.options = v.into();
433 self
434 }
435
436 pub async fn send(self) -> Result<crate::model::ListFoldersResponse> {
438 (*self.0.stub)
439 .list_folders(self.0.request, self.0.options)
440 .await
441 .map(crate::Response::into_body)
442 }
443
444 pub fn by_page(
446 self,
447 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListFoldersResponse, crate::Error>
448 {
449 use std::clone::Clone;
450 let token = self.0.request.page_token.clone();
451 let execute = move |token: String| {
452 let mut builder = self.clone();
453 builder.0.request = builder.0.request.set_page_token(token);
454 builder.send()
455 };
456 google_cloud_gax::paginator::internal::new_paginator(token, execute)
457 }
458
459 pub fn by_item(
461 self,
462 ) -> impl google_cloud_gax::paginator::ItemPaginator<
463 crate::model::ListFoldersResponse,
464 crate::Error,
465 > {
466 use google_cloud_gax::paginator::Paginator;
467 self.by_page().items()
468 }
469
470 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
474 self.0.request.parent = v.into();
475 self
476 }
477
478 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
480 self.0.request.page_size = v.into();
481 self
482 }
483
484 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
486 self.0.request.page_token = v.into();
487 self
488 }
489
490 pub fn set_prefix<T: Into<std::string::String>>(mut self, v: T) -> Self {
492 self.0.request.prefix = v.into();
493 self
494 }
495
496 pub fn set_delimiter<T: Into<std::string::String>>(mut self, v: T) -> Self {
498 self.0.request.delimiter = v.into();
499 self
500 }
501
502 pub fn set_lexicographic_start<T: Into<std::string::String>>(mut self, v: T) -> Self {
504 self.0.request.lexicographic_start = v.into();
505 self
506 }
507
508 pub fn set_lexicographic_end<T: Into<std::string::String>>(mut self, v: T) -> Self {
510 self.0.request.lexicographic_end = v.into();
511 self
512 }
513
514 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
516 self.0.request.request_id = v.into();
517 self
518 }
519 }
520
521 #[doc(hidden)]
522 impl crate::RequestBuilder for ListFolders {
523 fn request_options(&mut self) -> &mut crate::RequestOptions {
524 &mut self.0.options
525 }
526 }
527
528 #[derive(Clone, Debug)]
546 pub struct RenameFolder(RequestBuilder<crate::model::RenameFolderRequest>);
547
548 impl RenameFolder {
549 pub(crate) fn new(
550 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
551 ) -> Self {
552 Self(RequestBuilder::new(stub))
553 }
554
555 pub fn with_request<V: Into<crate::model::RenameFolderRequest>>(mut self, v: V) -> Self {
557 self.0.request = v.into();
558 self
559 }
560
561 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
563 self.0.options = v.into();
564 self
565 }
566
567 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
574 let req = Self::auto_populate(self.0.request, false);
575 (*self.0.stub)
576 .rename_folder(req, self.0.options)
577 .await
578 .map(crate::Response::into_body)
579 }
580
581 pub fn poller(
583 self,
584 ) -> impl google_cloud_lro::Poller<crate::model::Folder, crate::model::RenameFolderMetadata>
585 {
586 type Operation = google_cloud_lro::internal::Operation<
587 crate::model::Folder,
588 crate::model::RenameFolderMetadata,
589 >;
590 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
591 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
592
593 let stub = self.0.stub.clone();
594 let mut options = self.0.options.clone();
595 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
596 let query = move |name| {
597 let stub = stub.clone();
598 let options = options.clone();
599 async {
600 let op = GetOperation::new(stub)
601 .set_name(name)
602 .with_options(options)
603 .send()
604 .await?;
605 Ok(Operation::new(op))
606 }
607 };
608
609 let start = move || async {
610 let op = self.send().await?;
611 Ok(Operation::new(op))
612 };
613
614 google_cloud_lro::internal::new_poller(
615 polling_error_policy,
616 polling_backoff_policy,
617 start,
618 query,
619 )
620 }
621
622 fn auto_populate(
623 mut req: crate::model::RenameFolderRequest,
624 force: bool,
625 ) -> crate::model::RenameFolderRequest {
626 if force || req.request_id.is_empty() {
627 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
628 }
629 req
630 }
631
632 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
636 self.0.request.name = v.into();
637 self
638 }
639
640 pub fn set_destination_folder_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
644 self.0.request.destination_folder_id = v.into();
645 self
646 }
647
648 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
650 where
651 T: std::convert::Into<i64>,
652 {
653 self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
654 self
655 }
656
657 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
659 where
660 T: std::convert::Into<i64>,
661 {
662 self.0.request.if_metageneration_match = v.map(|x| x.into());
663 self
664 }
665
666 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
668 where
669 T: std::convert::Into<i64>,
670 {
671 self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
672 self
673 }
674
675 pub fn set_or_clear_if_metageneration_not_match<T>(
677 mut self,
678 v: std::option::Option<T>,
679 ) -> Self
680 where
681 T: std::convert::Into<i64>,
682 {
683 self.0.request.if_metageneration_not_match = v.map(|x| x.into());
684 self
685 }
686
687 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
689 self.0.request.request_id = v.into();
690 self
691 }
692 }
693
694 #[doc(hidden)]
695 impl crate::RequestBuilder for RenameFolder {
696 fn request_options(&mut self) -> &mut crate::RequestOptions {
697 &mut self.0.options
698 }
699 }
700
701 #[derive(Clone, Debug)]
719 pub struct DeleteFolderRecursive(RequestBuilder<crate::model::DeleteFolderRecursiveRequest>);
720
721 impl DeleteFolderRecursive {
722 pub(crate) fn new(
723 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
724 ) -> Self {
725 Self(RequestBuilder::new(stub))
726 }
727
728 pub fn with_request<V: Into<crate::model::DeleteFolderRecursiveRequest>>(
730 mut self,
731 v: V,
732 ) -> Self {
733 self.0.request = v.into();
734 self
735 }
736
737 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
739 self.0.options = v.into();
740 self
741 }
742
743 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
750 let req = Self::auto_populate(self.0.request, false);
751 (*self.0.stub)
752 .delete_folder_recursive(req, self.0.options)
753 .await
754 .map(crate::Response::into_body)
755 }
756
757 pub fn poller(
759 self,
760 ) -> impl google_cloud_lro::Poller<(), crate::model::DeleteFolderRecursiveMetadata>
761 {
762 type Operation = google_cloud_lro::internal::Operation<
763 wkt::Empty,
764 crate::model::DeleteFolderRecursiveMetadata,
765 >;
766 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
767 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
768
769 let stub = self.0.stub.clone();
770 let mut options = self.0.options.clone();
771 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
772 let query = move |name| {
773 let stub = stub.clone();
774 let options = options.clone();
775 async {
776 let op = GetOperation::new(stub)
777 .set_name(name)
778 .with_options(options)
779 .send()
780 .await?;
781 Ok(Operation::new(op))
782 }
783 };
784
785 let start = move || async {
786 let op = self.send().await?;
787 Ok(Operation::new(op))
788 };
789
790 google_cloud_lro::internal::new_unit_response_poller(
791 polling_error_policy,
792 polling_backoff_policy,
793 start,
794 query,
795 )
796 }
797
798 fn auto_populate(
799 mut req: crate::model::DeleteFolderRecursiveRequest,
800 force: bool,
801 ) -> crate::model::DeleteFolderRecursiveRequest {
802 if force || req.request_id.is_empty() {
803 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
804 }
805 req
806 }
807
808 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
812 self.0.request.name = v.into();
813 self
814 }
815
816 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
818 where
819 T: std::convert::Into<i64>,
820 {
821 self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
822 self
823 }
824
825 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
827 where
828 T: std::convert::Into<i64>,
829 {
830 self.0.request.if_metageneration_match = v.map(|x| x.into());
831 self
832 }
833
834 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
836 where
837 T: std::convert::Into<i64>,
838 {
839 self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
840 self
841 }
842
843 pub fn set_or_clear_if_metageneration_not_match<T>(
845 mut self,
846 v: std::option::Option<T>,
847 ) -> Self
848 where
849 T: std::convert::Into<i64>,
850 {
851 self.0.request.if_metageneration_not_match = v.map(|x| x.into());
852 self
853 }
854
855 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
857 self.0.request.request_id = v.into();
858 self
859 }
860 }
861
862 #[doc(hidden)]
863 impl crate::RequestBuilder for DeleteFolderRecursive {
864 fn request_options(&mut self) -> &mut crate::RequestOptions {
865 &mut self.0.options
866 }
867 }
868
869 #[derive(Clone, Debug)]
886 pub struct GetStorageLayout(RequestBuilder<crate::model::GetStorageLayoutRequest>);
887
888 impl GetStorageLayout {
889 pub(crate) fn new(
890 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
891 ) -> Self {
892 Self(RequestBuilder::new(stub))
893 }
894
895 pub fn with_request<V: Into<crate::model::GetStorageLayoutRequest>>(
897 mut self,
898 v: V,
899 ) -> Self {
900 self.0.request = v.into();
901 self
902 }
903
904 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
906 self.0.options = v.into();
907 self
908 }
909
910 pub async fn send(self) -> Result<crate::model::StorageLayout> {
912 let req = Self::auto_populate(self.0.request, false);
913 (*self.0.stub)
914 .get_storage_layout(req, self.0.options)
915 .await
916 .map(crate::Response::into_body)
917 }
918
919 fn auto_populate(
920 mut req: crate::model::GetStorageLayoutRequest,
921 force: bool,
922 ) -> crate::model::GetStorageLayoutRequest {
923 if force || req.request_id.is_empty() {
924 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
925 }
926 req
927 }
928
929 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
933 self.0.request.name = v.into();
934 self
935 }
936
937 pub fn set_prefix<T: Into<std::string::String>>(mut self, v: T) -> Self {
939 self.0.request.prefix = v.into();
940 self
941 }
942
943 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
945 self.0.request.request_id = v.into();
946 self
947 }
948 }
949
950 #[doc(hidden)]
951 impl crate::RequestBuilder for GetStorageLayout {
952 fn request_options(&mut self) -> &mut crate::RequestOptions {
953 &mut self.0.options
954 }
955 }
956
957 #[derive(Clone, Debug)]
974 pub struct CreateManagedFolder(RequestBuilder<crate::model::CreateManagedFolderRequest>);
975
976 impl CreateManagedFolder {
977 pub(crate) fn new(
978 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
979 ) -> Self {
980 Self(RequestBuilder::new(stub))
981 }
982
983 pub fn with_request<V: Into<crate::model::CreateManagedFolderRequest>>(
985 mut self,
986 v: V,
987 ) -> Self {
988 self.0.request = v.into();
989 self
990 }
991
992 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
994 self.0.options = v.into();
995 self
996 }
997
998 pub async fn send(self) -> Result<crate::model::ManagedFolder> {
1000 let req = Self::auto_populate(self.0.request, false);
1001 (*self.0.stub)
1002 .create_managed_folder(req, self.0.options)
1003 .await
1004 .map(crate::Response::into_body)
1005 }
1006
1007 fn auto_populate(
1008 mut req: crate::model::CreateManagedFolderRequest,
1009 force: bool,
1010 ) -> crate::model::CreateManagedFolderRequest {
1011 if force || req.request_id.is_empty() {
1012 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
1013 }
1014 req
1015 }
1016
1017 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1021 self.0.request.parent = v.into();
1022 self
1023 }
1024
1025 pub fn set_managed_folder<T>(mut self, v: T) -> Self
1029 where
1030 T: std::convert::Into<crate::model::ManagedFolder>,
1031 {
1032 self.0.request.managed_folder = std::option::Option::Some(v.into());
1033 self
1034 }
1035
1036 pub fn set_or_clear_managed_folder<T>(mut self, v: std::option::Option<T>) -> Self
1040 where
1041 T: std::convert::Into<crate::model::ManagedFolder>,
1042 {
1043 self.0.request.managed_folder = v.map(|x| x.into());
1044 self
1045 }
1046
1047 pub fn set_managed_folder_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1051 self.0.request.managed_folder_id = v.into();
1052 self
1053 }
1054
1055 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1057 self.0.request.request_id = v.into();
1058 self
1059 }
1060 }
1061
1062 #[doc(hidden)]
1063 impl crate::RequestBuilder for CreateManagedFolder {
1064 fn request_options(&mut self) -> &mut crate::RequestOptions {
1065 &mut self.0.options
1066 }
1067 }
1068
1069 #[derive(Clone, Debug)]
1086 pub struct DeleteManagedFolder(RequestBuilder<crate::model::DeleteManagedFolderRequest>);
1087
1088 impl DeleteManagedFolder {
1089 pub(crate) fn new(
1090 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1091 ) -> Self {
1092 Self(RequestBuilder::new(stub))
1093 }
1094
1095 pub fn with_request<V: Into<crate::model::DeleteManagedFolderRequest>>(
1097 mut self,
1098 v: V,
1099 ) -> Self {
1100 self.0.request = v.into();
1101 self
1102 }
1103
1104 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1106 self.0.options = v.into();
1107 self
1108 }
1109
1110 pub async fn send(self) -> Result<()> {
1112 let req = Self::auto_populate(self.0.request, false);
1113 (*self.0.stub)
1114 .delete_managed_folder(req, self.0.options)
1115 .await
1116 .map(crate::Response::into_body)
1117 }
1118
1119 fn auto_populate(
1120 mut req: crate::model::DeleteManagedFolderRequest,
1121 force: bool,
1122 ) -> crate::model::DeleteManagedFolderRequest {
1123 if force || req.request_id.is_empty() {
1124 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
1125 }
1126 req
1127 }
1128
1129 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1133 self.0.request.name = v.into();
1134 self
1135 }
1136
1137 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
1139 where
1140 T: std::convert::Into<i64>,
1141 {
1142 self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
1143 self
1144 }
1145
1146 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
1148 where
1149 T: std::convert::Into<i64>,
1150 {
1151 self.0.request.if_metageneration_match = v.map(|x| x.into());
1152 self
1153 }
1154
1155 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
1157 where
1158 T: std::convert::Into<i64>,
1159 {
1160 self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
1161 self
1162 }
1163
1164 pub fn set_or_clear_if_metageneration_not_match<T>(
1166 mut self,
1167 v: std::option::Option<T>,
1168 ) -> Self
1169 where
1170 T: std::convert::Into<i64>,
1171 {
1172 self.0.request.if_metageneration_not_match = v.map(|x| x.into());
1173 self
1174 }
1175
1176 pub fn set_allow_non_empty<T: Into<bool>>(mut self, v: T) -> Self {
1178 self.0.request.allow_non_empty = v.into();
1179 self
1180 }
1181
1182 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1184 self.0.request.request_id = v.into();
1185 self
1186 }
1187 }
1188
1189 #[doc(hidden)]
1190 impl crate::RequestBuilder for DeleteManagedFolder {
1191 fn request_options(&mut self) -> &mut crate::RequestOptions {
1192 &mut self.0.options
1193 }
1194 }
1195
1196 #[derive(Clone, Debug)]
1213 pub struct GetManagedFolder(RequestBuilder<crate::model::GetManagedFolderRequest>);
1214
1215 impl GetManagedFolder {
1216 pub(crate) fn new(
1217 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1218 ) -> Self {
1219 Self(RequestBuilder::new(stub))
1220 }
1221
1222 pub fn with_request<V: Into<crate::model::GetManagedFolderRequest>>(
1224 mut self,
1225 v: V,
1226 ) -> Self {
1227 self.0.request = v.into();
1228 self
1229 }
1230
1231 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1233 self.0.options = v.into();
1234 self
1235 }
1236
1237 pub async fn send(self) -> Result<crate::model::ManagedFolder> {
1239 let req = Self::auto_populate(self.0.request, false);
1240 (*self.0.stub)
1241 .get_managed_folder(req, self.0.options)
1242 .await
1243 .map(crate::Response::into_body)
1244 }
1245
1246 fn auto_populate(
1247 mut req: crate::model::GetManagedFolderRequest,
1248 force: bool,
1249 ) -> crate::model::GetManagedFolderRequest {
1250 if force || req.request_id.is_empty() {
1251 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
1252 }
1253 req
1254 }
1255
1256 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1260 self.0.request.name = v.into();
1261 self
1262 }
1263
1264 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
1266 where
1267 T: std::convert::Into<i64>,
1268 {
1269 self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
1270 self
1271 }
1272
1273 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
1275 where
1276 T: std::convert::Into<i64>,
1277 {
1278 self.0.request.if_metageneration_match = v.map(|x| x.into());
1279 self
1280 }
1281
1282 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
1284 where
1285 T: std::convert::Into<i64>,
1286 {
1287 self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
1288 self
1289 }
1290
1291 pub fn set_or_clear_if_metageneration_not_match<T>(
1293 mut self,
1294 v: std::option::Option<T>,
1295 ) -> Self
1296 where
1297 T: std::convert::Into<i64>,
1298 {
1299 self.0.request.if_metageneration_not_match = v.map(|x| x.into());
1300 self
1301 }
1302
1303 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1305 self.0.request.request_id = v.into();
1306 self
1307 }
1308 }
1309
1310 #[doc(hidden)]
1311 impl crate::RequestBuilder for GetManagedFolder {
1312 fn request_options(&mut self) -> &mut crate::RequestOptions {
1313 &mut self.0.options
1314 }
1315 }
1316
1317 #[derive(Clone, Debug)]
1338 pub struct ListManagedFolders(RequestBuilder<crate::model::ListManagedFoldersRequest>);
1339
1340 impl ListManagedFolders {
1341 pub(crate) fn new(
1342 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1343 ) -> Self {
1344 Self(RequestBuilder::new(stub))
1345 }
1346
1347 pub fn with_request<V: Into<crate::model::ListManagedFoldersRequest>>(
1349 mut self,
1350 v: V,
1351 ) -> Self {
1352 self.0.request = v.into();
1353 self
1354 }
1355
1356 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1358 self.0.options = v.into();
1359 self
1360 }
1361
1362 pub async fn send(self) -> Result<crate::model::ListManagedFoldersResponse> {
1364 let req = Self::auto_populate(self.0.request, false);
1365 (*self.0.stub)
1366 .list_managed_folders(req, self.0.options)
1367 .await
1368 .map(crate::Response::into_body)
1369 }
1370
1371 pub fn by_page(
1373 self,
1374 ) -> impl google_cloud_gax::paginator::Paginator<
1375 crate::model::ListManagedFoldersResponse,
1376 crate::Error,
1377 > {
1378 use std::clone::Clone;
1379 let token = self.0.request.page_token.clone();
1380 let execute = move |token: String| {
1381 let mut builder = self.clone();
1382 let initial = builder.0.request.page_token == token;
1383 builder.0.request = Self::auto_populate(builder.0.request, !initial);
1384 builder.0.request = builder.0.request.set_page_token(token);
1385 builder.send()
1386 };
1387 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1388 }
1389
1390 pub fn by_item(
1392 self,
1393 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1394 crate::model::ListManagedFoldersResponse,
1395 crate::Error,
1396 > {
1397 use google_cloud_gax::paginator::Paginator;
1398 self.by_page().items()
1399 }
1400
1401 fn auto_populate(
1402 mut req: crate::model::ListManagedFoldersRequest,
1403 force: bool,
1404 ) -> crate::model::ListManagedFoldersRequest {
1405 if force || req.request_id.is_empty() {
1406 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
1407 }
1408 req
1409 }
1410
1411 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1415 self.0.request.parent = v.into();
1416 self
1417 }
1418
1419 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1421 self.0.request.page_size = v.into();
1422 self
1423 }
1424
1425 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1427 self.0.request.page_token = v.into();
1428 self
1429 }
1430
1431 pub fn set_prefix<T: Into<std::string::String>>(mut self, v: T) -> Self {
1433 self.0.request.prefix = v.into();
1434 self
1435 }
1436
1437 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1439 self.0.request.request_id = v.into();
1440 self
1441 }
1442 }
1443
1444 #[doc(hidden)]
1445 impl crate::RequestBuilder for ListManagedFolders {
1446 fn request_options(&mut self) -> &mut crate::RequestOptions {
1447 &mut self.0.options
1448 }
1449 }
1450
1451 #[derive(Clone, Debug)]
1469 pub struct CreateAnywhereCache(RequestBuilder<crate::model::CreateAnywhereCacheRequest>);
1470
1471 impl CreateAnywhereCache {
1472 pub(crate) fn new(
1473 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1474 ) -> Self {
1475 Self(RequestBuilder::new(stub))
1476 }
1477
1478 pub fn with_request<V: Into<crate::model::CreateAnywhereCacheRequest>>(
1480 mut self,
1481 v: V,
1482 ) -> Self {
1483 self.0.request = v.into();
1484 self
1485 }
1486
1487 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1489 self.0.options = v.into();
1490 self
1491 }
1492
1493 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1500 let req = Self::auto_populate(self.0.request, false);
1501 (*self.0.stub)
1502 .create_anywhere_cache(req, self.0.options)
1503 .await
1504 .map(crate::Response::into_body)
1505 }
1506
1507 pub fn poller(
1509 self,
1510 ) -> impl google_cloud_lro::Poller<
1511 crate::model::AnywhereCache,
1512 crate::model::CreateAnywhereCacheMetadata,
1513 > {
1514 type Operation = google_cloud_lro::internal::Operation<
1515 crate::model::AnywhereCache,
1516 crate::model::CreateAnywhereCacheMetadata,
1517 >;
1518 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1519 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1520
1521 let stub = self.0.stub.clone();
1522 let mut options = self.0.options.clone();
1523 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1524 let query = move |name| {
1525 let stub = stub.clone();
1526 let options = options.clone();
1527 async {
1528 let op = GetOperation::new(stub)
1529 .set_name(name)
1530 .with_options(options)
1531 .send()
1532 .await?;
1533 Ok(Operation::new(op))
1534 }
1535 };
1536
1537 let start = move || async {
1538 let op = self.send().await?;
1539 Ok(Operation::new(op))
1540 };
1541
1542 google_cloud_lro::internal::new_poller(
1543 polling_error_policy,
1544 polling_backoff_policy,
1545 start,
1546 query,
1547 )
1548 }
1549
1550 fn auto_populate(
1551 mut req: crate::model::CreateAnywhereCacheRequest,
1552 force: bool,
1553 ) -> crate::model::CreateAnywhereCacheRequest {
1554 if force || req.request_id.is_empty() {
1555 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
1556 }
1557 req
1558 }
1559
1560 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1564 self.0.request.parent = v.into();
1565 self
1566 }
1567
1568 pub fn set_anywhere_cache<T>(mut self, v: T) -> Self
1572 where
1573 T: std::convert::Into<crate::model::AnywhereCache>,
1574 {
1575 self.0.request.anywhere_cache = std::option::Option::Some(v.into());
1576 self
1577 }
1578
1579 pub fn set_or_clear_anywhere_cache<T>(mut self, v: std::option::Option<T>) -> Self
1583 where
1584 T: std::convert::Into<crate::model::AnywhereCache>,
1585 {
1586 self.0.request.anywhere_cache = v.map(|x| x.into());
1587 self
1588 }
1589
1590 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1592 self.0.request.request_id = v.into();
1593 self
1594 }
1595 }
1596
1597 #[doc(hidden)]
1598 impl crate::RequestBuilder for CreateAnywhereCache {
1599 fn request_options(&mut self) -> &mut crate::RequestOptions {
1600 &mut self.0.options
1601 }
1602 }
1603
1604 #[derive(Clone, Debug)]
1622 pub struct UpdateAnywhereCache(RequestBuilder<crate::model::UpdateAnywhereCacheRequest>);
1623
1624 impl UpdateAnywhereCache {
1625 pub(crate) fn new(
1626 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1627 ) -> Self {
1628 Self(RequestBuilder::new(stub))
1629 }
1630
1631 pub fn with_request<V: Into<crate::model::UpdateAnywhereCacheRequest>>(
1633 mut self,
1634 v: V,
1635 ) -> Self {
1636 self.0.request = v.into();
1637 self
1638 }
1639
1640 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1642 self.0.options = v.into();
1643 self
1644 }
1645
1646 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1653 let req = Self::auto_populate(self.0.request, false);
1654 (*self.0.stub)
1655 .update_anywhere_cache(req, self.0.options)
1656 .await
1657 .map(crate::Response::into_body)
1658 }
1659
1660 pub fn poller(
1662 self,
1663 ) -> impl google_cloud_lro::Poller<
1664 crate::model::AnywhereCache,
1665 crate::model::UpdateAnywhereCacheMetadata,
1666 > {
1667 type Operation = google_cloud_lro::internal::Operation<
1668 crate::model::AnywhereCache,
1669 crate::model::UpdateAnywhereCacheMetadata,
1670 >;
1671 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1672 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1673
1674 let stub = self.0.stub.clone();
1675 let mut options = self.0.options.clone();
1676 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1677 let query = move |name| {
1678 let stub = stub.clone();
1679 let options = options.clone();
1680 async {
1681 let op = GetOperation::new(stub)
1682 .set_name(name)
1683 .with_options(options)
1684 .send()
1685 .await?;
1686 Ok(Operation::new(op))
1687 }
1688 };
1689
1690 let start = move || async {
1691 let op = self.send().await?;
1692 Ok(Operation::new(op))
1693 };
1694
1695 google_cloud_lro::internal::new_poller(
1696 polling_error_policy,
1697 polling_backoff_policy,
1698 start,
1699 query,
1700 )
1701 }
1702
1703 fn auto_populate(
1704 mut req: crate::model::UpdateAnywhereCacheRequest,
1705 force: bool,
1706 ) -> crate::model::UpdateAnywhereCacheRequest {
1707 if force || req.request_id.is_empty() {
1708 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
1709 }
1710 req
1711 }
1712
1713 pub fn set_anywhere_cache<T>(mut self, v: T) -> Self
1717 where
1718 T: std::convert::Into<crate::model::AnywhereCache>,
1719 {
1720 self.0.request.anywhere_cache = std::option::Option::Some(v.into());
1721 self
1722 }
1723
1724 pub fn set_or_clear_anywhere_cache<T>(mut self, v: std::option::Option<T>) -> Self
1728 where
1729 T: std::convert::Into<crate::model::AnywhereCache>,
1730 {
1731 self.0.request.anywhere_cache = v.map(|x| x.into());
1732 self
1733 }
1734
1735 pub fn set_update_mask<T>(mut self, v: T) -> Self
1739 where
1740 T: std::convert::Into<wkt::FieldMask>,
1741 {
1742 self.0.request.update_mask = std::option::Option::Some(v.into());
1743 self
1744 }
1745
1746 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1750 where
1751 T: std::convert::Into<wkt::FieldMask>,
1752 {
1753 self.0.request.update_mask = v.map(|x| x.into());
1754 self
1755 }
1756
1757 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1759 self.0.request.request_id = v.into();
1760 self
1761 }
1762 }
1763
1764 #[doc(hidden)]
1765 impl crate::RequestBuilder for UpdateAnywhereCache {
1766 fn request_options(&mut self) -> &mut crate::RequestOptions {
1767 &mut self.0.options
1768 }
1769 }
1770
1771 #[derive(Clone, Debug)]
1788 pub struct DisableAnywhereCache(RequestBuilder<crate::model::DisableAnywhereCacheRequest>);
1789
1790 impl DisableAnywhereCache {
1791 pub(crate) fn new(
1792 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1793 ) -> Self {
1794 Self(RequestBuilder::new(stub))
1795 }
1796
1797 pub fn with_request<V: Into<crate::model::DisableAnywhereCacheRequest>>(
1799 mut self,
1800 v: V,
1801 ) -> Self {
1802 self.0.request = v.into();
1803 self
1804 }
1805
1806 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1808 self.0.options = v.into();
1809 self
1810 }
1811
1812 pub async fn send(self) -> Result<crate::model::AnywhereCache> {
1814 let req = Self::auto_populate(self.0.request, false);
1815 (*self.0.stub)
1816 .disable_anywhere_cache(req, self.0.options)
1817 .await
1818 .map(crate::Response::into_body)
1819 }
1820
1821 fn auto_populate(
1822 mut req: crate::model::DisableAnywhereCacheRequest,
1823 force: bool,
1824 ) -> crate::model::DisableAnywhereCacheRequest {
1825 if force || req.request_id.is_empty() {
1826 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
1827 }
1828 req
1829 }
1830
1831 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1835 self.0.request.name = v.into();
1836 self
1837 }
1838
1839 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1841 self.0.request.request_id = v.into();
1842 self
1843 }
1844 }
1845
1846 #[doc(hidden)]
1847 impl crate::RequestBuilder for DisableAnywhereCache {
1848 fn request_options(&mut self) -> &mut crate::RequestOptions {
1849 &mut self.0.options
1850 }
1851 }
1852
1853 #[derive(Clone, Debug)]
1870 pub struct PauseAnywhereCache(RequestBuilder<crate::model::PauseAnywhereCacheRequest>);
1871
1872 impl PauseAnywhereCache {
1873 pub(crate) fn new(
1874 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1875 ) -> Self {
1876 Self(RequestBuilder::new(stub))
1877 }
1878
1879 pub fn with_request<V: Into<crate::model::PauseAnywhereCacheRequest>>(
1881 mut self,
1882 v: V,
1883 ) -> Self {
1884 self.0.request = v.into();
1885 self
1886 }
1887
1888 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1890 self.0.options = v.into();
1891 self
1892 }
1893
1894 pub async fn send(self) -> Result<crate::model::AnywhereCache> {
1896 let req = Self::auto_populate(self.0.request, false);
1897 (*self.0.stub)
1898 .pause_anywhere_cache(req, self.0.options)
1899 .await
1900 .map(crate::Response::into_body)
1901 }
1902
1903 fn auto_populate(
1904 mut req: crate::model::PauseAnywhereCacheRequest,
1905 force: bool,
1906 ) -> crate::model::PauseAnywhereCacheRequest {
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_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1917 self.0.request.name = v.into();
1918 self
1919 }
1920
1921 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1923 self.0.request.request_id = v.into();
1924 self
1925 }
1926 }
1927
1928 #[doc(hidden)]
1929 impl crate::RequestBuilder for PauseAnywhereCache {
1930 fn request_options(&mut self) -> &mut crate::RequestOptions {
1931 &mut self.0.options
1932 }
1933 }
1934
1935 #[derive(Clone, Debug)]
1952 pub struct ResumeAnywhereCache(RequestBuilder<crate::model::ResumeAnywhereCacheRequest>);
1953
1954 impl ResumeAnywhereCache {
1955 pub(crate) fn new(
1956 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1957 ) -> Self {
1958 Self(RequestBuilder::new(stub))
1959 }
1960
1961 pub fn with_request<V: Into<crate::model::ResumeAnywhereCacheRequest>>(
1963 mut self,
1964 v: V,
1965 ) -> Self {
1966 self.0.request = v.into();
1967 self
1968 }
1969
1970 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1972 self.0.options = v.into();
1973 self
1974 }
1975
1976 pub async fn send(self) -> Result<crate::model::AnywhereCache> {
1978 let req = Self::auto_populate(self.0.request, false);
1979 (*self.0.stub)
1980 .resume_anywhere_cache(req, self.0.options)
1981 .await
1982 .map(crate::Response::into_body)
1983 }
1984
1985 fn auto_populate(
1986 mut req: crate::model::ResumeAnywhereCacheRequest,
1987 force: bool,
1988 ) -> crate::model::ResumeAnywhereCacheRequest {
1989 if force || req.request_id.is_empty() {
1990 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
1991 }
1992 req
1993 }
1994
1995 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1999 self.0.request.name = v.into();
2000 self
2001 }
2002
2003 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2005 self.0.request.request_id = v.into();
2006 self
2007 }
2008 }
2009
2010 #[doc(hidden)]
2011 impl crate::RequestBuilder for ResumeAnywhereCache {
2012 fn request_options(&mut self) -> &mut crate::RequestOptions {
2013 &mut self.0.options
2014 }
2015 }
2016
2017 #[derive(Clone, Debug)]
2034 pub struct GetAnywhereCache(RequestBuilder<crate::model::GetAnywhereCacheRequest>);
2035
2036 impl GetAnywhereCache {
2037 pub(crate) fn new(
2038 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2039 ) -> Self {
2040 Self(RequestBuilder::new(stub))
2041 }
2042
2043 pub fn with_request<V: Into<crate::model::GetAnywhereCacheRequest>>(
2045 mut self,
2046 v: V,
2047 ) -> Self {
2048 self.0.request = v.into();
2049 self
2050 }
2051
2052 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2054 self.0.options = v.into();
2055 self
2056 }
2057
2058 pub async fn send(self) -> Result<crate::model::AnywhereCache> {
2060 let req = Self::auto_populate(self.0.request, false);
2061 (*self.0.stub)
2062 .get_anywhere_cache(req, self.0.options)
2063 .await
2064 .map(crate::Response::into_body)
2065 }
2066
2067 fn auto_populate(
2068 mut req: crate::model::GetAnywhereCacheRequest,
2069 force: bool,
2070 ) -> crate::model::GetAnywhereCacheRequest {
2071 if force || req.request_id.is_empty() {
2072 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
2073 }
2074 req
2075 }
2076
2077 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2081 self.0.request.name = v.into();
2082 self
2083 }
2084
2085 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2087 self.0.request.request_id = v.into();
2088 self
2089 }
2090 }
2091
2092 #[doc(hidden)]
2093 impl crate::RequestBuilder for GetAnywhereCache {
2094 fn request_options(&mut self) -> &mut crate::RequestOptions {
2095 &mut self.0.options
2096 }
2097 }
2098
2099 #[derive(Clone, Debug)]
2120 pub struct ListAnywhereCaches(RequestBuilder<crate::model::ListAnywhereCachesRequest>);
2121
2122 impl ListAnywhereCaches {
2123 pub(crate) fn new(
2124 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2125 ) -> Self {
2126 Self(RequestBuilder::new(stub))
2127 }
2128
2129 pub fn with_request<V: Into<crate::model::ListAnywhereCachesRequest>>(
2131 mut self,
2132 v: V,
2133 ) -> Self {
2134 self.0.request = v.into();
2135 self
2136 }
2137
2138 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2140 self.0.options = v.into();
2141 self
2142 }
2143
2144 pub async fn send(self) -> Result<crate::model::ListAnywhereCachesResponse> {
2146 let req = Self::auto_populate(self.0.request, false);
2147 (*self.0.stub)
2148 .list_anywhere_caches(req, self.0.options)
2149 .await
2150 .map(crate::Response::into_body)
2151 }
2152
2153 pub fn by_page(
2155 self,
2156 ) -> impl google_cloud_gax::paginator::Paginator<
2157 crate::model::ListAnywhereCachesResponse,
2158 crate::Error,
2159 > {
2160 use std::clone::Clone;
2161 let token = self.0.request.page_token.clone();
2162 let execute = move |token: String| {
2163 let mut builder = self.clone();
2164 let initial = builder.0.request.page_token == token;
2165 builder.0.request = Self::auto_populate(builder.0.request, !initial);
2166 builder.0.request = builder.0.request.set_page_token(token);
2167 builder.send()
2168 };
2169 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2170 }
2171
2172 pub fn by_item(
2174 self,
2175 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2176 crate::model::ListAnywhereCachesResponse,
2177 crate::Error,
2178 > {
2179 use google_cloud_gax::paginator::Paginator;
2180 self.by_page().items()
2181 }
2182
2183 fn auto_populate(
2184 mut req: crate::model::ListAnywhereCachesRequest,
2185 force: bool,
2186 ) -> crate::model::ListAnywhereCachesRequest {
2187 if force || req.request_id.is_empty() {
2188 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
2189 }
2190 req
2191 }
2192
2193 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2197 self.0.request.parent = v.into();
2198 self
2199 }
2200
2201 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2203 self.0.request.page_size = v.into();
2204 self
2205 }
2206
2207 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2209 self.0.request.page_token = v.into();
2210 self
2211 }
2212
2213 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2215 self.0.request.request_id = v.into();
2216 self
2217 }
2218 }
2219
2220 #[doc(hidden)]
2221 impl crate::RequestBuilder for ListAnywhereCaches {
2222 fn request_options(&mut self) -> &mut crate::RequestOptions {
2223 &mut self.0.options
2224 }
2225 }
2226
2227 #[derive(Clone, Debug)]
2244 pub struct GetProjectIntelligenceConfig(
2245 RequestBuilder<crate::model::GetProjectIntelligenceConfigRequest>,
2246 );
2247
2248 impl GetProjectIntelligenceConfig {
2249 pub(crate) fn new(
2250 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2251 ) -> Self {
2252 Self(RequestBuilder::new(stub))
2253 }
2254
2255 pub fn with_request<V: Into<crate::model::GetProjectIntelligenceConfigRequest>>(
2257 mut self,
2258 v: V,
2259 ) -> Self {
2260 self.0.request = v.into();
2261 self
2262 }
2263
2264 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2266 self.0.options = v.into();
2267 self
2268 }
2269
2270 pub async fn send(self) -> Result<crate::model::IntelligenceConfig> {
2272 (*self.0.stub)
2273 .get_project_intelligence_config(self.0.request, self.0.options)
2274 .await
2275 .map(crate::Response::into_body)
2276 }
2277
2278 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2282 self.0.request.name = v.into();
2283 self
2284 }
2285 }
2286
2287 #[doc(hidden)]
2288 impl crate::RequestBuilder for GetProjectIntelligenceConfig {
2289 fn request_options(&mut self) -> &mut crate::RequestOptions {
2290 &mut self.0.options
2291 }
2292 }
2293
2294 #[derive(Clone, Debug)]
2311 pub struct UpdateProjectIntelligenceConfig(
2312 RequestBuilder<crate::model::UpdateProjectIntelligenceConfigRequest>,
2313 );
2314
2315 impl UpdateProjectIntelligenceConfig {
2316 pub(crate) fn new(
2317 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2318 ) -> Self {
2319 Self(RequestBuilder::new(stub))
2320 }
2321
2322 pub fn with_request<V: Into<crate::model::UpdateProjectIntelligenceConfigRequest>>(
2324 mut self,
2325 v: V,
2326 ) -> Self {
2327 self.0.request = v.into();
2328 self
2329 }
2330
2331 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2333 self.0.options = v.into();
2334 self
2335 }
2336
2337 pub async fn send(self) -> Result<crate::model::IntelligenceConfig> {
2339 (*self.0.stub)
2340 .update_project_intelligence_config(self.0.request, self.0.options)
2341 .await
2342 .map(crate::Response::into_body)
2343 }
2344
2345 pub fn set_intelligence_config<T>(mut self, v: T) -> Self
2349 where
2350 T: std::convert::Into<crate::model::IntelligenceConfig>,
2351 {
2352 self.0.request.intelligence_config = std::option::Option::Some(v.into());
2353 self
2354 }
2355
2356 pub fn set_or_clear_intelligence_config<T>(mut self, v: std::option::Option<T>) -> Self
2360 where
2361 T: std::convert::Into<crate::model::IntelligenceConfig>,
2362 {
2363 self.0.request.intelligence_config = v.map(|x| x.into());
2364 self
2365 }
2366
2367 pub fn set_update_mask<T>(mut self, v: T) -> Self
2371 where
2372 T: std::convert::Into<wkt::FieldMask>,
2373 {
2374 self.0.request.update_mask = std::option::Option::Some(v.into());
2375 self
2376 }
2377
2378 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2382 where
2383 T: std::convert::Into<wkt::FieldMask>,
2384 {
2385 self.0.request.update_mask = v.map(|x| x.into());
2386 self
2387 }
2388
2389 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2391 self.0.request.request_id = v.into();
2392 self
2393 }
2394 }
2395
2396 #[doc(hidden)]
2397 impl crate::RequestBuilder for UpdateProjectIntelligenceConfig {
2398 fn request_options(&mut self) -> &mut crate::RequestOptions {
2399 &mut self.0.options
2400 }
2401 }
2402
2403 #[derive(Clone, Debug)]
2420 pub struct GetFolderIntelligenceConfig(
2421 RequestBuilder<crate::model::GetFolderIntelligenceConfigRequest>,
2422 );
2423
2424 impl GetFolderIntelligenceConfig {
2425 pub(crate) fn new(
2426 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2427 ) -> Self {
2428 Self(RequestBuilder::new(stub))
2429 }
2430
2431 pub fn with_request<V: Into<crate::model::GetFolderIntelligenceConfigRequest>>(
2433 mut self,
2434 v: V,
2435 ) -> Self {
2436 self.0.request = v.into();
2437 self
2438 }
2439
2440 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2442 self.0.options = v.into();
2443 self
2444 }
2445
2446 pub async fn send(self) -> Result<crate::model::IntelligenceConfig> {
2448 (*self.0.stub)
2449 .get_folder_intelligence_config(self.0.request, self.0.options)
2450 .await
2451 .map(crate::Response::into_body)
2452 }
2453
2454 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2458 self.0.request.name = v.into();
2459 self
2460 }
2461 }
2462
2463 #[doc(hidden)]
2464 impl crate::RequestBuilder for GetFolderIntelligenceConfig {
2465 fn request_options(&mut self) -> &mut crate::RequestOptions {
2466 &mut self.0.options
2467 }
2468 }
2469
2470 #[derive(Clone, Debug)]
2487 pub struct UpdateFolderIntelligenceConfig(
2488 RequestBuilder<crate::model::UpdateFolderIntelligenceConfigRequest>,
2489 );
2490
2491 impl UpdateFolderIntelligenceConfig {
2492 pub(crate) fn new(
2493 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2494 ) -> Self {
2495 Self(RequestBuilder::new(stub))
2496 }
2497
2498 pub fn with_request<V: Into<crate::model::UpdateFolderIntelligenceConfigRequest>>(
2500 mut self,
2501 v: V,
2502 ) -> Self {
2503 self.0.request = v.into();
2504 self
2505 }
2506
2507 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2509 self.0.options = v.into();
2510 self
2511 }
2512
2513 pub async fn send(self) -> Result<crate::model::IntelligenceConfig> {
2515 (*self.0.stub)
2516 .update_folder_intelligence_config(self.0.request, self.0.options)
2517 .await
2518 .map(crate::Response::into_body)
2519 }
2520
2521 pub fn set_intelligence_config<T>(mut self, v: T) -> Self
2525 where
2526 T: std::convert::Into<crate::model::IntelligenceConfig>,
2527 {
2528 self.0.request.intelligence_config = std::option::Option::Some(v.into());
2529 self
2530 }
2531
2532 pub fn set_or_clear_intelligence_config<T>(mut self, v: std::option::Option<T>) -> Self
2536 where
2537 T: std::convert::Into<crate::model::IntelligenceConfig>,
2538 {
2539 self.0.request.intelligence_config = v.map(|x| x.into());
2540 self
2541 }
2542
2543 pub fn set_update_mask<T>(mut self, v: T) -> Self
2547 where
2548 T: std::convert::Into<wkt::FieldMask>,
2549 {
2550 self.0.request.update_mask = std::option::Option::Some(v.into());
2551 self
2552 }
2553
2554 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2558 where
2559 T: std::convert::Into<wkt::FieldMask>,
2560 {
2561 self.0.request.update_mask = v.map(|x| x.into());
2562 self
2563 }
2564
2565 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2567 self.0.request.request_id = v.into();
2568 self
2569 }
2570 }
2571
2572 #[doc(hidden)]
2573 impl crate::RequestBuilder for UpdateFolderIntelligenceConfig {
2574 fn request_options(&mut self) -> &mut crate::RequestOptions {
2575 &mut self.0.options
2576 }
2577 }
2578
2579 #[derive(Clone, Debug)]
2596 pub struct GetOrganizationIntelligenceConfig(
2597 RequestBuilder<crate::model::GetOrganizationIntelligenceConfigRequest>,
2598 );
2599
2600 impl GetOrganizationIntelligenceConfig {
2601 pub(crate) fn new(
2602 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2603 ) -> Self {
2604 Self(RequestBuilder::new(stub))
2605 }
2606
2607 pub fn with_request<V: Into<crate::model::GetOrganizationIntelligenceConfigRequest>>(
2609 mut self,
2610 v: V,
2611 ) -> Self {
2612 self.0.request = v.into();
2613 self
2614 }
2615
2616 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2618 self.0.options = v.into();
2619 self
2620 }
2621
2622 pub async fn send(self) -> Result<crate::model::IntelligenceConfig> {
2624 (*self.0.stub)
2625 .get_organization_intelligence_config(self.0.request, self.0.options)
2626 .await
2627 .map(crate::Response::into_body)
2628 }
2629
2630 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2634 self.0.request.name = v.into();
2635 self
2636 }
2637 }
2638
2639 #[doc(hidden)]
2640 impl crate::RequestBuilder for GetOrganizationIntelligenceConfig {
2641 fn request_options(&mut self) -> &mut crate::RequestOptions {
2642 &mut self.0.options
2643 }
2644 }
2645
2646 #[derive(Clone, Debug)]
2663 pub struct UpdateOrganizationIntelligenceConfig(
2664 RequestBuilder<crate::model::UpdateOrganizationIntelligenceConfigRequest>,
2665 );
2666
2667 impl UpdateOrganizationIntelligenceConfig {
2668 pub(crate) fn new(
2669 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2670 ) -> Self {
2671 Self(RequestBuilder::new(stub))
2672 }
2673
2674 pub fn with_request<V: Into<crate::model::UpdateOrganizationIntelligenceConfigRequest>>(
2676 mut self,
2677 v: V,
2678 ) -> Self {
2679 self.0.request = v.into();
2680 self
2681 }
2682
2683 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2685 self.0.options = v.into();
2686 self
2687 }
2688
2689 pub async fn send(self) -> Result<crate::model::IntelligenceConfig> {
2691 (*self.0.stub)
2692 .update_organization_intelligence_config(self.0.request, self.0.options)
2693 .await
2694 .map(crate::Response::into_body)
2695 }
2696
2697 pub fn set_intelligence_config<T>(mut self, v: T) -> Self
2701 where
2702 T: std::convert::Into<crate::model::IntelligenceConfig>,
2703 {
2704 self.0.request.intelligence_config = std::option::Option::Some(v.into());
2705 self
2706 }
2707
2708 pub fn set_or_clear_intelligence_config<T>(mut self, v: std::option::Option<T>) -> Self
2712 where
2713 T: std::convert::Into<crate::model::IntelligenceConfig>,
2714 {
2715 self.0.request.intelligence_config = v.map(|x| x.into());
2716 self
2717 }
2718
2719 pub fn set_update_mask<T>(mut self, v: T) -> Self
2723 where
2724 T: std::convert::Into<wkt::FieldMask>,
2725 {
2726 self.0.request.update_mask = std::option::Option::Some(v.into());
2727 self
2728 }
2729
2730 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2734 where
2735 T: std::convert::Into<wkt::FieldMask>,
2736 {
2737 self.0.request.update_mask = v.map(|x| x.into());
2738 self
2739 }
2740
2741 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2743 self.0.request.request_id = v.into();
2744 self
2745 }
2746 }
2747
2748 #[doc(hidden)]
2749 impl crate::RequestBuilder for UpdateOrganizationIntelligenceConfig {
2750 fn request_options(&mut self) -> &mut crate::RequestOptions {
2751 &mut self.0.options
2752 }
2753 }
2754
2755 #[derive(Clone, Debug)]
2772 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
2773
2774 impl GetIamPolicy {
2775 pub(crate) fn new(
2776 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2777 ) -> Self {
2778 Self(RequestBuilder::new(stub))
2779 }
2780
2781 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
2783 mut self,
2784 v: V,
2785 ) -> Self {
2786 self.0.request = v.into();
2787 self
2788 }
2789
2790 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2792 self.0.options = v.into();
2793 self
2794 }
2795
2796 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
2798 (*self.0.stub)
2799 .get_iam_policy(self.0.request, self.0.options)
2800 .await
2801 .map(crate::Response::into_body)
2802 }
2803
2804 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2808 self.0.request.resource = v.into();
2809 self
2810 }
2811
2812 pub fn set_options<T>(mut self, v: T) -> Self
2814 where
2815 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
2816 {
2817 self.0.request.options = std::option::Option::Some(v.into());
2818 self
2819 }
2820
2821 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
2823 where
2824 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
2825 {
2826 self.0.request.options = v.map(|x| x.into());
2827 self
2828 }
2829 }
2830
2831 #[doc(hidden)]
2832 impl crate::RequestBuilder for GetIamPolicy {
2833 fn request_options(&mut self) -> &mut crate::RequestOptions {
2834 &mut self.0.options
2835 }
2836 }
2837
2838 #[derive(Clone, Debug)]
2855 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
2856
2857 impl SetIamPolicy {
2858 pub(crate) fn new(
2859 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2860 ) -> Self {
2861 Self(RequestBuilder::new(stub))
2862 }
2863
2864 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
2866 mut self,
2867 v: V,
2868 ) -> Self {
2869 self.0.request = v.into();
2870 self
2871 }
2872
2873 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2875 self.0.options = v.into();
2876 self
2877 }
2878
2879 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
2881 (*self.0.stub)
2882 .set_iam_policy(self.0.request, self.0.options)
2883 .await
2884 .map(crate::Response::into_body)
2885 }
2886
2887 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2891 self.0.request.resource = v.into();
2892 self
2893 }
2894
2895 pub fn set_policy<T>(mut self, v: T) -> Self
2899 where
2900 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
2901 {
2902 self.0.request.policy = std::option::Option::Some(v.into());
2903 self
2904 }
2905
2906 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
2910 where
2911 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
2912 {
2913 self.0.request.policy = v.map(|x| x.into());
2914 self
2915 }
2916
2917 pub fn set_update_mask<T>(mut self, v: T) -> Self
2919 where
2920 T: std::convert::Into<wkt::FieldMask>,
2921 {
2922 self.0.request.update_mask = std::option::Option::Some(v.into());
2923 self
2924 }
2925
2926 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2928 where
2929 T: std::convert::Into<wkt::FieldMask>,
2930 {
2931 self.0.request.update_mask = v.map(|x| x.into());
2932 self
2933 }
2934 }
2935
2936 #[doc(hidden)]
2937 impl crate::RequestBuilder for SetIamPolicy {
2938 fn request_options(&mut self) -> &mut crate::RequestOptions {
2939 &mut self.0.options
2940 }
2941 }
2942
2943 #[derive(Clone, Debug)]
2960 pub struct TestIamPermissions(
2961 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
2962 );
2963
2964 impl TestIamPermissions {
2965 pub(crate) fn new(
2966 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2967 ) -> Self {
2968 Self(RequestBuilder::new(stub))
2969 }
2970
2971 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
2973 mut self,
2974 v: V,
2975 ) -> Self {
2976 self.0.request = v.into();
2977 self
2978 }
2979
2980 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2982 self.0.options = v.into();
2983 self
2984 }
2985
2986 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
2988 (*self.0.stub)
2989 .test_iam_permissions(self.0.request, self.0.options)
2990 .await
2991 .map(crate::Response::into_body)
2992 }
2993
2994 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2998 self.0.request.resource = v.into();
2999 self
3000 }
3001
3002 pub fn set_permissions<T, V>(mut self, v: T) -> Self
3006 where
3007 T: std::iter::IntoIterator<Item = V>,
3008 V: std::convert::Into<std::string::String>,
3009 {
3010 use std::iter::Iterator;
3011 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
3012 self
3013 }
3014 }
3015
3016 #[doc(hidden)]
3017 impl crate::RequestBuilder for TestIamPermissions {
3018 fn request_options(&mut self) -> &mut crate::RequestOptions {
3019 &mut self.0.options
3020 }
3021 }
3022
3023 #[derive(Clone, Debug)]
3040 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
3041
3042 impl GetOperation {
3043 pub(crate) fn new(
3044 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
3045 ) -> Self {
3046 Self(RequestBuilder::new(stub))
3047 }
3048
3049 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
3051 mut self,
3052 v: V,
3053 ) -> Self {
3054 self.0.request = v.into();
3055 self
3056 }
3057
3058 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3060 self.0.options = v.into();
3061 self
3062 }
3063
3064 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3066 (*self.0.stub)
3067 .get_operation(self.0.request, self.0.options)
3068 .await
3069 .map(crate::Response::into_body)
3070 }
3071
3072 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3074 self.0.request.name = v.into();
3075 self
3076 }
3077 }
3078
3079 #[doc(hidden)]
3080 impl crate::RequestBuilder for GetOperation {
3081 fn request_options(&mut self) -> &mut crate::RequestOptions {
3082 &mut self.0.options
3083 }
3084 }
3085}