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