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: gax::options::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: gax::options::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<gax::options::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(gax::response::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 gax::options::internal::RequestBuilder for CreateFolder {
153 fn request_options(&mut self) -> &mut gax::options::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<gax::options::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(gax::response::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 gax::options::internal::RequestBuilder for DeleteFolder {
271 fn request_options(&mut self) -> &mut gax::options::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<gax::options::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(gax::response::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 gax::options::internal::RequestBuilder for GetFolder {
389 fn request_options(&mut self) -> &mut gax::options::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<gax::options::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(gax::response::Response::into_body)
442 }
443
444 pub fn by_page(
446 self,
447 ) -> impl gax::paginator::Paginator<crate::model::ListFoldersResponse, gax::error::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 gax::paginator::internal::new_paginator(token, execute)
457 }
458
459 pub fn by_item(
461 self,
462 ) -> impl gax::paginator::ItemPaginator<crate::model::ListFoldersResponse, gax::error::Error>
463 {
464 use gax::paginator::Paginator;
465 self.by_page().items()
466 }
467
468 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
472 self.0.request.parent = v.into();
473 self
474 }
475
476 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
478 self.0.request.page_size = v.into();
479 self
480 }
481
482 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
484 self.0.request.page_token = v.into();
485 self
486 }
487
488 pub fn set_prefix<T: Into<std::string::String>>(mut self, v: T) -> Self {
490 self.0.request.prefix = v.into();
491 self
492 }
493
494 pub fn set_delimiter<T: Into<std::string::String>>(mut self, v: T) -> Self {
496 self.0.request.delimiter = v.into();
497 self
498 }
499
500 pub fn set_lexicographic_start<T: Into<std::string::String>>(mut self, v: T) -> Self {
502 self.0.request.lexicographic_start = v.into();
503 self
504 }
505
506 pub fn set_lexicographic_end<T: Into<std::string::String>>(mut self, v: T) -> Self {
508 self.0.request.lexicographic_end = v.into();
509 self
510 }
511
512 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
514 self.0.request.request_id = v.into();
515 self
516 }
517 }
518
519 #[doc(hidden)]
520 impl gax::options::internal::RequestBuilder for ListFolders {
521 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
522 &mut self.0.options
523 }
524 }
525
526 #[derive(Clone, Debug)]
544 pub struct RenameFolder(RequestBuilder<crate::model::RenameFolderRequest>);
545
546 impl RenameFolder {
547 pub(crate) fn new(
548 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
549 ) -> Self {
550 Self(RequestBuilder::new(stub))
551 }
552
553 pub fn with_request<V: Into<crate::model::RenameFolderRequest>>(mut self, v: V) -> Self {
555 self.0.request = v.into();
556 self
557 }
558
559 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
561 self.0.options = v.into();
562 self
563 }
564
565 pub async fn send(self) -> Result<longrunning::model::Operation> {
572 let req = Self::auto_populate(self.0.request, false);
573 (*self.0.stub)
574 .rename_folder(req, self.0.options)
575 .await
576 .map(gax::response::Response::into_body)
577 }
578
579 pub fn poller(
581 self,
582 ) -> impl lro::Poller<crate::model::Folder, crate::model::RenameFolderMetadata> {
583 type Operation =
584 lro::internal::Operation<crate::model::Folder, crate::model::RenameFolderMetadata>;
585 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
586 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
587
588 let stub = self.0.stub.clone();
589 let mut options = self.0.options.clone();
590 options.set_retry_policy(gax::retry_policy::NeverRetry);
591 let query = move |name| {
592 let stub = stub.clone();
593 let options = options.clone();
594 async {
595 let op = GetOperation::new(stub)
596 .set_name(name)
597 .with_options(options)
598 .send()
599 .await?;
600 Ok(Operation::new(op))
601 }
602 };
603
604 let start = move || async {
605 let op = self.send().await?;
606 Ok(Operation::new(op))
607 };
608
609 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
610 }
611
612 fn auto_populate(
613 mut req: crate::model::RenameFolderRequest,
614 force: bool,
615 ) -> crate::model::RenameFolderRequest {
616 if force || req.request_id.is_empty() {
617 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
618 }
619 req
620 }
621
622 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
626 self.0.request.name = v.into();
627 self
628 }
629
630 pub fn set_destination_folder_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
634 self.0.request.destination_folder_id = v.into();
635 self
636 }
637
638 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
640 where
641 T: std::convert::Into<i64>,
642 {
643 self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
644 self
645 }
646
647 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
649 where
650 T: std::convert::Into<i64>,
651 {
652 self.0.request.if_metageneration_match = v.map(|x| x.into());
653 self
654 }
655
656 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
658 where
659 T: std::convert::Into<i64>,
660 {
661 self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
662 self
663 }
664
665 pub fn set_or_clear_if_metageneration_not_match<T>(
667 mut self,
668 v: std::option::Option<T>,
669 ) -> Self
670 where
671 T: std::convert::Into<i64>,
672 {
673 self.0.request.if_metageneration_not_match = v.map(|x| x.into());
674 self
675 }
676
677 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
679 self.0.request.request_id = v.into();
680 self
681 }
682 }
683
684 #[doc(hidden)]
685 impl gax::options::internal::RequestBuilder for RenameFolder {
686 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
687 &mut self.0.options
688 }
689 }
690
691 #[derive(Clone, Debug)]
708 pub struct GetStorageLayout(RequestBuilder<crate::model::GetStorageLayoutRequest>);
709
710 impl GetStorageLayout {
711 pub(crate) fn new(
712 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
713 ) -> Self {
714 Self(RequestBuilder::new(stub))
715 }
716
717 pub fn with_request<V: Into<crate::model::GetStorageLayoutRequest>>(
719 mut self,
720 v: V,
721 ) -> Self {
722 self.0.request = v.into();
723 self
724 }
725
726 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
728 self.0.options = v.into();
729 self
730 }
731
732 pub async fn send(self) -> Result<crate::model::StorageLayout> {
734 let req = Self::auto_populate(self.0.request, false);
735 (*self.0.stub)
736 .get_storage_layout(req, self.0.options)
737 .await
738 .map(gax::response::Response::into_body)
739 }
740
741 fn auto_populate(
742 mut req: crate::model::GetStorageLayoutRequest,
743 force: bool,
744 ) -> crate::model::GetStorageLayoutRequest {
745 if force || req.request_id.is_empty() {
746 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
747 }
748 req
749 }
750
751 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
755 self.0.request.name = v.into();
756 self
757 }
758
759 pub fn set_prefix<T: Into<std::string::String>>(mut self, v: T) -> Self {
761 self.0.request.prefix = v.into();
762 self
763 }
764
765 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
767 self.0.request.request_id = v.into();
768 self
769 }
770 }
771
772 #[doc(hidden)]
773 impl gax::options::internal::RequestBuilder for GetStorageLayout {
774 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
775 &mut self.0.options
776 }
777 }
778
779 #[derive(Clone, Debug)]
796 pub struct CreateManagedFolder(RequestBuilder<crate::model::CreateManagedFolderRequest>);
797
798 impl CreateManagedFolder {
799 pub(crate) fn new(
800 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
801 ) -> Self {
802 Self(RequestBuilder::new(stub))
803 }
804
805 pub fn with_request<V: Into<crate::model::CreateManagedFolderRequest>>(
807 mut self,
808 v: V,
809 ) -> Self {
810 self.0.request = v.into();
811 self
812 }
813
814 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
816 self.0.options = v.into();
817 self
818 }
819
820 pub async fn send(self) -> Result<crate::model::ManagedFolder> {
822 let req = Self::auto_populate(self.0.request, false);
823 (*self.0.stub)
824 .create_managed_folder(req, self.0.options)
825 .await
826 .map(gax::response::Response::into_body)
827 }
828
829 fn auto_populate(
830 mut req: crate::model::CreateManagedFolderRequest,
831 force: bool,
832 ) -> crate::model::CreateManagedFolderRequest {
833 if force || req.request_id.is_empty() {
834 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
835 }
836 req
837 }
838
839 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
843 self.0.request.parent = v.into();
844 self
845 }
846
847 pub fn set_managed_folder<T>(mut self, v: T) -> Self
851 where
852 T: std::convert::Into<crate::model::ManagedFolder>,
853 {
854 self.0.request.managed_folder = std::option::Option::Some(v.into());
855 self
856 }
857
858 pub fn set_or_clear_managed_folder<T>(mut self, v: std::option::Option<T>) -> Self
862 where
863 T: std::convert::Into<crate::model::ManagedFolder>,
864 {
865 self.0.request.managed_folder = v.map(|x| x.into());
866 self
867 }
868
869 pub fn set_managed_folder_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
873 self.0.request.managed_folder_id = v.into();
874 self
875 }
876
877 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
879 self.0.request.request_id = v.into();
880 self
881 }
882 }
883
884 #[doc(hidden)]
885 impl gax::options::internal::RequestBuilder for CreateManagedFolder {
886 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
887 &mut self.0.options
888 }
889 }
890
891 #[derive(Clone, Debug)]
908 pub struct DeleteManagedFolder(RequestBuilder<crate::model::DeleteManagedFolderRequest>);
909
910 impl DeleteManagedFolder {
911 pub(crate) fn new(
912 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
913 ) -> Self {
914 Self(RequestBuilder::new(stub))
915 }
916
917 pub fn with_request<V: Into<crate::model::DeleteManagedFolderRequest>>(
919 mut self,
920 v: V,
921 ) -> Self {
922 self.0.request = v.into();
923 self
924 }
925
926 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
928 self.0.options = v.into();
929 self
930 }
931
932 pub async fn send(self) -> Result<()> {
934 let req = Self::auto_populate(self.0.request, false);
935 (*self.0.stub)
936 .delete_managed_folder(req, self.0.options)
937 .await
938 .map(gax::response::Response::into_body)
939 }
940
941 fn auto_populate(
942 mut req: crate::model::DeleteManagedFolderRequest,
943 force: bool,
944 ) -> crate::model::DeleteManagedFolderRequest {
945 if force || req.request_id.is_empty() {
946 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
947 }
948 req
949 }
950
951 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
955 self.0.request.name = v.into();
956 self
957 }
958
959 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
961 where
962 T: std::convert::Into<i64>,
963 {
964 self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
965 self
966 }
967
968 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
970 where
971 T: std::convert::Into<i64>,
972 {
973 self.0.request.if_metageneration_match = v.map(|x| x.into());
974 self
975 }
976
977 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
979 where
980 T: std::convert::Into<i64>,
981 {
982 self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
983 self
984 }
985
986 pub fn set_or_clear_if_metageneration_not_match<T>(
988 mut self,
989 v: std::option::Option<T>,
990 ) -> Self
991 where
992 T: std::convert::Into<i64>,
993 {
994 self.0.request.if_metageneration_not_match = v.map(|x| x.into());
995 self
996 }
997
998 pub fn set_allow_non_empty<T: Into<bool>>(mut self, v: T) -> Self {
1000 self.0.request.allow_non_empty = v.into();
1001 self
1002 }
1003
1004 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1006 self.0.request.request_id = v.into();
1007 self
1008 }
1009 }
1010
1011 #[doc(hidden)]
1012 impl gax::options::internal::RequestBuilder for DeleteManagedFolder {
1013 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1014 &mut self.0.options
1015 }
1016 }
1017
1018 #[derive(Clone, Debug)]
1035 pub struct GetManagedFolder(RequestBuilder<crate::model::GetManagedFolderRequest>);
1036
1037 impl GetManagedFolder {
1038 pub(crate) fn new(
1039 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1040 ) -> Self {
1041 Self(RequestBuilder::new(stub))
1042 }
1043
1044 pub fn with_request<V: Into<crate::model::GetManagedFolderRequest>>(
1046 mut self,
1047 v: V,
1048 ) -> Self {
1049 self.0.request = v.into();
1050 self
1051 }
1052
1053 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1055 self.0.options = v.into();
1056 self
1057 }
1058
1059 pub async fn send(self) -> Result<crate::model::ManagedFolder> {
1061 let req = Self::auto_populate(self.0.request, false);
1062 (*self.0.stub)
1063 .get_managed_folder(req, self.0.options)
1064 .await
1065 .map(gax::response::Response::into_body)
1066 }
1067
1068 fn auto_populate(
1069 mut req: crate::model::GetManagedFolderRequest,
1070 force: bool,
1071 ) -> crate::model::GetManagedFolderRequest {
1072 if force || req.request_id.is_empty() {
1073 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
1074 }
1075 req
1076 }
1077
1078 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1082 self.0.request.name = v.into();
1083 self
1084 }
1085
1086 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
1088 where
1089 T: std::convert::Into<i64>,
1090 {
1091 self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
1092 self
1093 }
1094
1095 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
1097 where
1098 T: std::convert::Into<i64>,
1099 {
1100 self.0.request.if_metageneration_match = v.map(|x| x.into());
1101 self
1102 }
1103
1104 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
1106 where
1107 T: std::convert::Into<i64>,
1108 {
1109 self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
1110 self
1111 }
1112
1113 pub fn set_or_clear_if_metageneration_not_match<T>(
1115 mut self,
1116 v: std::option::Option<T>,
1117 ) -> Self
1118 where
1119 T: std::convert::Into<i64>,
1120 {
1121 self.0.request.if_metageneration_not_match = v.map(|x| x.into());
1122 self
1123 }
1124
1125 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1127 self.0.request.request_id = v.into();
1128 self
1129 }
1130 }
1131
1132 #[doc(hidden)]
1133 impl gax::options::internal::RequestBuilder for GetManagedFolder {
1134 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1135 &mut self.0.options
1136 }
1137 }
1138
1139 #[derive(Clone, Debug)]
1160 pub struct ListManagedFolders(RequestBuilder<crate::model::ListManagedFoldersRequest>);
1161
1162 impl ListManagedFolders {
1163 pub(crate) fn new(
1164 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1165 ) -> Self {
1166 Self(RequestBuilder::new(stub))
1167 }
1168
1169 pub fn with_request<V: Into<crate::model::ListManagedFoldersRequest>>(
1171 mut self,
1172 v: V,
1173 ) -> Self {
1174 self.0.request = v.into();
1175 self
1176 }
1177
1178 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1180 self.0.options = v.into();
1181 self
1182 }
1183
1184 pub async fn send(self) -> Result<crate::model::ListManagedFoldersResponse> {
1186 let req = Self::auto_populate(self.0.request, false);
1187 (*self.0.stub)
1188 .list_managed_folders(req, self.0.options)
1189 .await
1190 .map(gax::response::Response::into_body)
1191 }
1192
1193 pub fn by_page(
1195 self,
1196 ) -> impl gax::paginator::Paginator<crate::model::ListManagedFoldersResponse, gax::error::Error>
1197 {
1198 use std::clone::Clone;
1199 let token = self.0.request.page_token.clone();
1200 let execute = move |token: String| {
1201 let mut builder = self.clone();
1202 let initial = builder.0.request.page_token == token;
1203 builder.0.request = Self::auto_populate(builder.0.request, !initial);
1204 builder.0.request = builder.0.request.set_page_token(token);
1205 builder.send()
1206 };
1207 gax::paginator::internal::new_paginator(token, execute)
1208 }
1209
1210 pub fn by_item(
1212 self,
1213 ) -> impl gax::paginator::ItemPaginator<
1214 crate::model::ListManagedFoldersResponse,
1215 gax::error::Error,
1216 > {
1217 use gax::paginator::Paginator;
1218 self.by_page().items()
1219 }
1220
1221 fn auto_populate(
1222 mut req: crate::model::ListManagedFoldersRequest,
1223 force: bool,
1224 ) -> crate::model::ListManagedFoldersRequest {
1225 if force || req.request_id.is_empty() {
1226 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
1227 }
1228 req
1229 }
1230
1231 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1235 self.0.request.parent = v.into();
1236 self
1237 }
1238
1239 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1241 self.0.request.page_size = v.into();
1242 self
1243 }
1244
1245 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1247 self.0.request.page_token = v.into();
1248 self
1249 }
1250
1251 pub fn set_prefix<T: Into<std::string::String>>(mut self, v: T) -> Self {
1253 self.0.request.prefix = v.into();
1254 self
1255 }
1256
1257 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1259 self.0.request.request_id = v.into();
1260 self
1261 }
1262 }
1263
1264 #[doc(hidden)]
1265 impl gax::options::internal::RequestBuilder for ListManagedFolders {
1266 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1267 &mut self.0.options
1268 }
1269 }
1270
1271 #[derive(Clone, Debug)]
1289 pub struct CreateAnywhereCache(RequestBuilder<crate::model::CreateAnywhereCacheRequest>);
1290
1291 impl CreateAnywhereCache {
1292 pub(crate) fn new(
1293 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1294 ) -> Self {
1295 Self(RequestBuilder::new(stub))
1296 }
1297
1298 pub fn with_request<V: Into<crate::model::CreateAnywhereCacheRequest>>(
1300 mut self,
1301 v: V,
1302 ) -> Self {
1303 self.0.request = v.into();
1304 self
1305 }
1306
1307 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1309 self.0.options = v.into();
1310 self
1311 }
1312
1313 pub async fn send(self) -> Result<longrunning::model::Operation> {
1320 let req = Self::auto_populate(self.0.request, false);
1321 (*self.0.stub)
1322 .create_anywhere_cache(req, self.0.options)
1323 .await
1324 .map(gax::response::Response::into_body)
1325 }
1326
1327 pub fn poller(
1329 self,
1330 ) -> impl lro::Poller<crate::model::AnywhereCache, crate::model::CreateAnywhereCacheMetadata>
1331 {
1332 type Operation = lro::internal::Operation<
1333 crate::model::AnywhereCache,
1334 crate::model::CreateAnywhereCacheMetadata,
1335 >;
1336 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1337 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1338
1339 let stub = self.0.stub.clone();
1340 let mut options = self.0.options.clone();
1341 options.set_retry_policy(gax::retry_policy::NeverRetry);
1342 let query = move |name| {
1343 let stub = stub.clone();
1344 let options = options.clone();
1345 async {
1346 let op = GetOperation::new(stub)
1347 .set_name(name)
1348 .with_options(options)
1349 .send()
1350 .await?;
1351 Ok(Operation::new(op))
1352 }
1353 };
1354
1355 let start = move || async {
1356 let op = self.send().await?;
1357 Ok(Operation::new(op))
1358 };
1359
1360 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1361 }
1362
1363 fn auto_populate(
1364 mut req: crate::model::CreateAnywhereCacheRequest,
1365 force: bool,
1366 ) -> crate::model::CreateAnywhereCacheRequest {
1367 if force || req.request_id.is_empty() {
1368 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
1369 }
1370 req
1371 }
1372
1373 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1377 self.0.request.parent = v.into();
1378 self
1379 }
1380
1381 pub fn set_anywhere_cache<T>(mut self, v: T) -> Self
1385 where
1386 T: std::convert::Into<crate::model::AnywhereCache>,
1387 {
1388 self.0.request.anywhere_cache = std::option::Option::Some(v.into());
1389 self
1390 }
1391
1392 pub fn set_or_clear_anywhere_cache<T>(mut self, v: std::option::Option<T>) -> Self
1396 where
1397 T: std::convert::Into<crate::model::AnywhereCache>,
1398 {
1399 self.0.request.anywhere_cache = v.map(|x| x.into());
1400 self
1401 }
1402
1403 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1405 self.0.request.request_id = v.into();
1406 self
1407 }
1408 }
1409
1410 #[doc(hidden)]
1411 impl gax::options::internal::RequestBuilder for CreateAnywhereCache {
1412 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1413 &mut self.0.options
1414 }
1415 }
1416
1417 #[derive(Clone, Debug)]
1435 pub struct UpdateAnywhereCache(RequestBuilder<crate::model::UpdateAnywhereCacheRequest>);
1436
1437 impl UpdateAnywhereCache {
1438 pub(crate) fn new(
1439 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1440 ) -> Self {
1441 Self(RequestBuilder::new(stub))
1442 }
1443
1444 pub fn with_request<V: Into<crate::model::UpdateAnywhereCacheRequest>>(
1446 mut self,
1447 v: V,
1448 ) -> Self {
1449 self.0.request = v.into();
1450 self
1451 }
1452
1453 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1455 self.0.options = v.into();
1456 self
1457 }
1458
1459 pub async fn send(self) -> Result<longrunning::model::Operation> {
1466 let req = Self::auto_populate(self.0.request, false);
1467 (*self.0.stub)
1468 .update_anywhere_cache(req, self.0.options)
1469 .await
1470 .map(gax::response::Response::into_body)
1471 }
1472
1473 pub fn poller(
1475 self,
1476 ) -> impl lro::Poller<crate::model::AnywhereCache, crate::model::UpdateAnywhereCacheMetadata>
1477 {
1478 type Operation = lro::internal::Operation<
1479 crate::model::AnywhereCache,
1480 crate::model::UpdateAnywhereCacheMetadata,
1481 >;
1482 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1483 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1484
1485 let stub = self.0.stub.clone();
1486 let mut options = self.0.options.clone();
1487 options.set_retry_policy(gax::retry_policy::NeverRetry);
1488 let query = move |name| {
1489 let stub = stub.clone();
1490 let options = options.clone();
1491 async {
1492 let op = GetOperation::new(stub)
1493 .set_name(name)
1494 .with_options(options)
1495 .send()
1496 .await?;
1497 Ok(Operation::new(op))
1498 }
1499 };
1500
1501 let start = move || async {
1502 let op = self.send().await?;
1503 Ok(Operation::new(op))
1504 };
1505
1506 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1507 }
1508
1509 fn auto_populate(
1510 mut req: crate::model::UpdateAnywhereCacheRequest,
1511 force: bool,
1512 ) -> crate::model::UpdateAnywhereCacheRequest {
1513 if force || req.request_id.is_empty() {
1514 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
1515 }
1516 req
1517 }
1518
1519 pub fn set_anywhere_cache<T>(mut self, v: T) -> Self
1523 where
1524 T: std::convert::Into<crate::model::AnywhereCache>,
1525 {
1526 self.0.request.anywhere_cache = std::option::Option::Some(v.into());
1527 self
1528 }
1529
1530 pub fn set_or_clear_anywhere_cache<T>(mut self, v: std::option::Option<T>) -> Self
1534 where
1535 T: std::convert::Into<crate::model::AnywhereCache>,
1536 {
1537 self.0.request.anywhere_cache = v.map(|x| x.into());
1538 self
1539 }
1540
1541 pub fn set_update_mask<T>(mut self, v: T) -> Self
1545 where
1546 T: std::convert::Into<wkt::FieldMask>,
1547 {
1548 self.0.request.update_mask = std::option::Option::Some(v.into());
1549 self
1550 }
1551
1552 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1556 where
1557 T: std::convert::Into<wkt::FieldMask>,
1558 {
1559 self.0.request.update_mask = v.map(|x| x.into());
1560 self
1561 }
1562
1563 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1565 self.0.request.request_id = v.into();
1566 self
1567 }
1568 }
1569
1570 #[doc(hidden)]
1571 impl gax::options::internal::RequestBuilder for UpdateAnywhereCache {
1572 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1573 &mut self.0.options
1574 }
1575 }
1576
1577 #[derive(Clone, Debug)]
1594 pub struct DisableAnywhereCache(RequestBuilder<crate::model::DisableAnywhereCacheRequest>);
1595
1596 impl DisableAnywhereCache {
1597 pub(crate) fn new(
1598 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1599 ) -> Self {
1600 Self(RequestBuilder::new(stub))
1601 }
1602
1603 pub fn with_request<V: Into<crate::model::DisableAnywhereCacheRequest>>(
1605 mut self,
1606 v: V,
1607 ) -> Self {
1608 self.0.request = v.into();
1609 self
1610 }
1611
1612 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1614 self.0.options = v.into();
1615 self
1616 }
1617
1618 pub async fn send(self) -> Result<crate::model::AnywhereCache> {
1620 let req = Self::auto_populate(self.0.request, false);
1621 (*self.0.stub)
1622 .disable_anywhere_cache(req, self.0.options)
1623 .await
1624 .map(gax::response::Response::into_body)
1625 }
1626
1627 fn auto_populate(
1628 mut req: crate::model::DisableAnywhereCacheRequest,
1629 force: bool,
1630 ) -> crate::model::DisableAnywhereCacheRequest {
1631 if force || req.request_id.is_empty() {
1632 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
1633 }
1634 req
1635 }
1636
1637 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1641 self.0.request.name = v.into();
1642 self
1643 }
1644
1645 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1647 self.0.request.request_id = v.into();
1648 self
1649 }
1650 }
1651
1652 #[doc(hidden)]
1653 impl gax::options::internal::RequestBuilder for DisableAnywhereCache {
1654 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1655 &mut self.0.options
1656 }
1657 }
1658
1659 #[derive(Clone, Debug)]
1676 pub struct PauseAnywhereCache(RequestBuilder<crate::model::PauseAnywhereCacheRequest>);
1677
1678 impl PauseAnywhereCache {
1679 pub(crate) fn new(
1680 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1681 ) -> Self {
1682 Self(RequestBuilder::new(stub))
1683 }
1684
1685 pub fn with_request<V: Into<crate::model::PauseAnywhereCacheRequest>>(
1687 mut self,
1688 v: V,
1689 ) -> Self {
1690 self.0.request = v.into();
1691 self
1692 }
1693
1694 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1696 self.0.options = v.into();
1697 self
1698 }
1699
1700 pub async fn send(self) -> Result<crate::model::AnywhereCache> {
1702 let req = Self::auto_populate(self.0.request, false);
1703 (*self.0.stub)
1704 .pause_anywhere_cache(req, self.0.options)
1705 .await
1706 .map(gax::response::Response::into_body)
1707 }
1708
1709 fn auto_populate(
1710 mut req: crate::model::PauseAnywhereCacheRequest,
1711 force: bool,
1712 ) -> crate::model::PauseAnywhereCacheRequest {
1713 if force || req.request_id.is_empty() {
1714 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
1715 }
1716 req
1717 }
1718
1719 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1723 self.0.request.name = v.into();
1724 self
1725 }
1726
1727 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1729 self.0.request.request_id = v.into();
1730 self
1731 }
1732 }
1733
1734 #[doc(hidden)]
1735 impl gax::options::internal::RequestBuilder for PauseAnywhereCache {
1736 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1737 &mut self.0.options
1738 }
1739 }
1740
1741 #[derive(Clone, Debug)]
1758 pub struct ResumeAnywhereCache(RequestBuilder<crate::model::ResumeAnywhereCacheRequest>);
1759
1760 impl ResumeAnywhereCache {
1761 pub(crate) fn new(
1762 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1763 ) -> Self {
1764 Self(RequestBuilder::new(stub))
1765 }
1766
1767 pub fn with_request<V: Into<crate::model::ResumeAnywhereCacheRequest>>(
1769 mut self,
1770 v: V,
1771 ) -> Self {
1772 self.0.request = v.into();
1773 self
1774 }
1775
1776 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1778 self.0.options = v.into();
1779 self
1780 }
1781
1782 pub async fn send(self) -> Result<crate::model::AnywhereCache> {
1784 let req = Self::auto_populate(self.0.request, false);
1785 (*self.0.stub)
1786 .resume_anywhere_cache(req, self.0.options)
1787 .await
1788 .map(gax::response::Response::into_body)
1789 }
1790
1791 fn auto_populate(
1792 mut req: crate::model::ResumeAnywhereCacheRequest,
1793 force: bool,
1794 ) -> crate::model::ResumeAnywhereCacheRequest {
1795 if force || req.request_id.is_empty() {
1796 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
1797 }
1798 req
1799 }
1800
1801 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1805 self.0.request.name = v.into();
1806 self
1807 }
1808
1809 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1811 self.0.request.request_id = v.into();
1812 self
1813 }
1814 }
1815
1816 #[doc(hidden)]
1817 impl gax::options::internal::RequestBuilder for ResumeAnywhereCache {
1818 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1819 &mut self.0.options
1820 }
1821 }
1822
1823 #[derive(Clone, Debug)]
1840 pub struct GetAnywhereCache(RequestBuilder<crate::model::GetAnywhereCacheRequest>);
1841
1842 impl GetAnywhereCache {
1843 pub(crate) fn new(
1844 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1845 ) -> Self {
1846 Self(RequestBuilder::new(stub))
1847 }
1848
1849 pub fn with_request<V: Into<crate::model::GetAnywhereCacheRequest>>(
1851 mut self,
1852 v: V,
1853 ) -> Self {
1854 self.0.request = v.into();
1855 self
1856 }
1857
1858 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1860 self.0.options = v.into();
1861 self
1862 }
1863
1864 pub async fn send(self) -> Result<crate::model::AnywhereCache> {
1866 let req = Self::auto_populate(self.0.request, false);
1867 (*self.0.stub)
1868 .get_anywhere_cache(req, self.0.options)
1869 .await
1870 .map(gax::response::Response::into_body)
1871 }
1872
1873 fn auto_populate(
1874 mut req: crate::model::GetAnywhereCacheRequest,
1875 force: bool,
1876 ) -> crate::model::GetAnywhereCacheRequest {
1877 if force || req.request_id.is_empty() {
1878 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
1879 }
1880 req
1881 }
1882
1883 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1887 self.0.request.name = v.into();
1888 self
1889 }
1890
1891 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1893 self.0.request.request_id = v.into();
1894 self
1895 }
1896 }
1897
1898 #[doc(hidden)]
1899 impl gax::options::internal::RequestBuilder for GetAnywhereCache {
1900 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1901 &mut self.0.options
1902 }
1903 }
1904
1905 #[derive(Clone, Debug)]
1926 pub struct ListAnywhereCaches(RequestBuilder<crate::model::ListAnywhereCachesRequest>);
1927
1928 impl ListAnywhereCaches {
1929 pub(crate) fn new(
1930 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1931 ) -> Self {
1932 Self(RequestBuilder::new(stub))
1933 }
1934
1935 pub fn with_request<V: Into<crate::model::ListAnywhereCachesRequest>>(
1937 mut self,
1938 v: V,
1939 ) -> Self {
1940 self.0.request = v.into();
1941 self
1942 }
1943
1944 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1946 self.0.options = v.into();
1947 self
1948 }
1949
1950 pub async fn send(self) -> Result<crate::model::ListAnywhereCachesResponse> {
1952 let req = Self::auto_populate(self.0.request, false);
1953 (*self.0.stub)
1954 .list_anywhere_caches(req, self.0.options)
1955 .await
1956 .map(gax::response::Response::into_body)
1957 }
1958
1959 pub fn by_page(
1961 self,
1962 ) -> impl gax::paginator::Paginator<crate::model::ListAnywhereCachesResponse, gax::error::Error>
1963 {
1964 use std::clone::Clone;
1965 let token = self.0.request.page_token.clone();
1966 let execute = move |token: String| {
1967 let mut builder = self.clone();
1968 let initial = builder.0.request.page_token == token;
1969 builder.0.request = Self::auto_populate(builder.0.request, !initial);
1970 builder.0.request = builder.0.request.set_page_token(token);
1971 builder.send()
1972 };
1973 gax::paginator::internal::new_paginator(token, execute)
1974 }
1975
1976 pub fn by_item(
1978 self,
1979 ) -> impl gax::paginator::ItemPaginator<
1980 crate::model::ListAnywhereCachesResponse,
1981 gax::error::Error,
1982 > {
1983 use gax::paginator::Paginator;
1984 self.by_page().items()
1985 }
1986
1987 fn auto_populate(
1988 mut req: crate::model::ListAnywhereCachesRequest,
1989 force: bool,
1990 ) -> crate::model::ListAnywhereCachesRequest {
1991 if force || req.request_id.is_empty() {
1992 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
1993 }
1994 req
1995 }
1996
1997 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2001 self.0.request.parent = v.into();
2002 self
2003 }
2004
2005 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2007 self.0.request.page_size = v.into();
2008 self
2009 }
2010
2011 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2013 self.0.request.page_token = v.into();
2014 self
2015 }
2016
2017 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2019 self.0.request.request_id = v.into();
2020 self
2021 }
2022 }
2023
2024 #[doc(hidden)]
2025 impl gax::options::internal::RequestBuilder for ListAnywhereCaches {
2026 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2027 &mut self.0.options
2028 }
2029 }
2030
2031 #[derive(Clone, Debug)]
2048 pub struct GetProjectIntelligenceConfig(
2049 RequestBuilder<crate::model::GetProjectIntelligenceConfigRequest>,
2050 );
2051
2052 impl GetProjectIntelligenceConfig {
2053 pub(crate) fn new(
2054 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2055 ) -> Self {
2056 Self(RequestBuilder::new(stub))
2057 }
2058
2059 pub fn with_request<V: Into<crate::model::GetProjectIntelligenceConfigRequest>>(
2061 mut self,
2062 v: V,
2063 ) -> Self {
2064 self.0.request = v.into();
2065 self
2066 }
2067
2068 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2070 self.0.options = v.into();
2071 self
2072 }
2073
2074 pub async fn send(self) -> Result<crate::model::IntelligenceConfig> {
2076 (*self.0.stub)
2077 .get_project_intelligence_config(self.0.request, self.0.options)
2078 .await
2079 .map(gax::response::Response::into_body)
2080 }
2081
2082 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2086 self.0.request.name = v.into();
2087 self
2088 }
2089 }
2090
2091 #[doc(hidden)]
2092 impl gax::options::internal::RequestBuilder for GetProjectIntelligenceConfig {
2093 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2094 &mut self.0.options
2095 }
2096 }
2097
2098 #[derive(Clone, Debug)]
2115 pub struct UpdateProjectIntelligenceConfig(
2116 RequestBuilder<crate::model::UpdateProjectIntelligenceConfigRequest>,
2117 );
2118
2119 impl UpdateProjectIntelligenceConfig {
2120 pub(crate) fn new(
2121 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2122 ) -> Self {
2123 Self(RequestBuilder::new(stub))
2124 }
2125
2126 pub fn with_request<V: Into<crate::model::UpdateProjectIntelligenceConfigRequest>>(
2128 mut self,
2129 v: V,
2130 ) -> Self {
2131 self.0.request = v.into();
2132 self
2133 }
2134
2135 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2137 self.0.options = v.into();
2138 self
2139 }
2140
2141 pub async fn send(self) -> Result<crate::model::IntelligenceConfig> {
2143 (*self.0.stub)
2144 .update_project_intelligence_config(self.0.request, self.0.options)
2145 .await
2146 .map(gax::response::Response::into_body)
2147 }
2148
2149 pub fn set_intelligence_config<T>(mut self, v: T) -> Self
2153 where
2154 T: std::convert::Into<crate::model::IntelligenceConfig>,
2155 {
2156 self.0.request.intelligence_config = std::option::Option::Some(v.into());
2157 self
2158 }
2159
2160 pub fn set_or_clear_intelligence_config<T>(mut self, v: std::option::Option<T>) -> Self
2164 where
2165 T: std::convert::Into<crate::model::IntelligenceConfig>,
2166 {
2167 self.0.request.intelligence_config = v.map(|x| x.into());
2168 self
2169 }
2170
2171 pub fn set_update_mask<T>(mut self, v: T) -> Self
2175 where
2176 T: std::convert::Into<wkt::FieldMask>,
2177 {
2178 self.0.request.update_mask = std::option::Option::Some(v.into());
2179 self
2180 }
2181
2182 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2186 where
2187 T: std::convert::Into<wkt::FieldMask>,
2188 {
2189 self.0.request.update_mask = v.map(|x| x.into());
2190 self
2191 }
2192
2193 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2195 self.0.request.request_id = v.into();
2196 self
2197 }
2198 }
2199
2200 #[doc(hidden)]
2201 impl gax::options::internal::RequestBuilder for UpdateProjectIntelligenceConfig {
2202 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2203 &mut self.0.options
2204 }
2205 }
2206
2207 #[derive(Clone, Debug)]
2224 pub struct GetFolderIntelligenceConfig(
2225 RequestBuilder<crate::model::GetFolderIntelligenceConfigRequest>,
2226 );
2227
2228 impl GetFolderIntelligenceConfig {
2229 pub(crate) fn new(
2230 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2231 ) -> Self {
2232 Self(RequestBuilder::new(stub))
2233 }
2234
2235 pub fn with_request<V: Into<crate::model::GetFolderIntelligenceConfigRequest>>(
2237 mut self,
2238 v: V,
2239 ) -> Self {
2240 self.0.request = v.into();
2241 self
2242 }
2243
2244 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2246 self.0.options = v.into();
2247 self
2248 }
2249
2250 pub async fn send(self) -> Result<crate::model::IntelligenceConfig> {
2252 (*self.0.stub)
2253 .get_folder_intelligence_config(self.0.request, self.0.options)
2254 .await
2255 .map(gax::response::Response::into_body)
2256 }
2257
2258 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2262 self.0.request.name = v.into();
2263 self
2264 }
2265 }
2266
2267 #[doc(hidden)]
2268 impl gax::options::internal::RequestBuilder for GetFolderIntelligenceConfig {
2269 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2270 &mut self.0.options
2271 }
2272 }
2273
2274 #[derive(Clone, Debug)]
2291 pub struct UpdateFolderIntelligenceConfig(
2292 RequestBuilder<crate::model::UpdateFolderIntelligenceConfigRequest>,
2293 );
2294
2295 impl UpdateFolderIntelligenceConfig {
2296 pub(crate) fn new(
2297 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2298 ) -> Self {
2299 Self(RequestBuilder::new(stub))
2300 }
2301
2302 pub fn with_request<V: Into<crate::model::UpdateFolderIntelligenceConfigRequest>>(
2304 mut self,
2305 v: V,
2306 ) -> Self {
2307 self.0.request = v.into();
2308 self
2309 }
2310
2311 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2313 self.0.options = v.into();
2314 self
2315 }
2316
2317 pub async fn send(self) -> Result<crate::model::IntelligenceConfig> {
2319 (*self.0.stub)
2320 .update_folder_intelligence_config(self.0.request, self.0.options)
2321 .await
2322 .map(gax::response::Response::into_body)
2323 }
2324
2325 pub fn set_intelligence_config<T>(mut self, v: T) -> Self
2329 where
2330 T: std::convert::Into<crate::model::IntelligenceConfig>,
2331 {
2332 self.0.request.intelligence_config = std::option::Option::Some(v.into());
2333 self
2334 }
2335
2336 pub fn set_or_clear_intelligence_config<T>(mut self, v: std::option::Option<T>) -> Self
2340 where
2341 T: std::convert::Into<crate::model::IntelligenceConfig>,
2342 {
2343 self.0.request.intelligence_config = v.map(|x| x.into());
2344 self
2345 }
2346
2347 pub fn set_update_mask<T>(mut self, v: T) -> Self
2351 where
2352 T: std::convert::Into<wkt::FieldMask>,
2353 {
2354 self.0.request.update_mask = std::option::Option::Some(v.into());
2355 self
2356 }
2357
2358 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2362 where
2363 T: std::convert::Into<wkt::FieldMask>,
2364 {
2365 self.0.request.update_mask = v.map(|x| x.into());
2366 self
2367 }
2368
2369 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2371 self.0.request.request_id = v.into();
2372 self
2373 }
2374 }
2375
2376 #[doc(hidden)]
2377 impl gax::options::internal::RequestBuilder for UpdateFolderIntelligenceConfig {
2378 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2379 &mut self.0.options
2380 }
2381 }
2382
2383 #[derive(Clone, Debug)]
2400 pub struct GetOrganizationIntelligenceConfig(
2401 RequestBuilder<crate::model::GetOrganizationIntelligenceConfigRequest>,
2402 );
2403
2404 impl GetOrganizationIntelligenceConfig {
2405 pub(crate) fn new(
2406 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2407 ) -> Self {
2408 Self(RequestBuilder::new(stub))
2409 }
2410
2411 pub fn with_request<V: Into<crate::model::GetOrganizationIntelligenceConfigRequest>>(
2413 mut self,
2414 v: V,
2415 ) -> Self {
2416 self.0.request = v.into();
2417 self
2418 }
2419
2420 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2422 self.0.options = v.into();
2423 self
2424 }
2425
2426 pub async fn send(self) -> Result<crate::model::IntelligenceConfig> {
2428 (*self.0.stub)
2429 .get_organization_intelligence_config(self.0.request, self.0.options)
2430 .await
2431 .map(gax::response::Response::into_body)
2432 }
2433
2434 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2438 self.0.request.name = v.into();
2439 self
2440 }
2441 }
2442
2443 #[doc(hidden)]
2444 impl gax::options::internal::RequestBuilder for GetOrganizationIntelligenceConfig {
2445 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2446 &mut self.0.options
2447 }
2448 }
2449
2450 #[derive(Clone, Debug)]
2467 pub struct UpdateOrganizationIntelligenceConfig(
2468 RequestBuilder<crate::model::UpdateOrganizationIntelligenceConfigRequest>,
2469 );
2470
2471 impl UpdateOrganizationIntelligenceConfig {
2472 pub(crate) fn new(
2473 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2474 ) -> Self {
2475 Self(RequestBuilder::new(stub))
2476 }
2477
2478 pub fn with_request<V: Into<crate::model::UpdateOrganizationIntelligenceConfigRequest>>(
2480 mut self,
2481 v: V,
2482 ) -> Self {
2483 self.0.request = v.into();
2484 self
2485 }
2486
2487 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2489 self.0.options = v.into();
2490 self
2491 }
2492
2493 pub async fn send(self) -> Result<crate::model::IntelligenceConfig> {
2495 (*self.0.stub)
2496 .update_organization_intelligence_config(self.0.request, self.0.options)
2497 .await
2498 .map(gax::response::Response::into_body)
2499 }
2500
2501 pub fn set_intelligence_config<T>(mut self, v: T) -> Self
2505 where
2506 T: std::convert::Into<crate::model::IntelligenceConfig>,
2507 {
2508 self.0.request.intelligence_config = std::option::Option::Some(v.into());
2509 self
2510 }
2511
2512 pub fn set_or_clear_intelligence_config<T>(mut self, v: std::option::Option<T>) -> Self
2516 where
2517 T: std::convert::Into<crate::model::IntelligenceConfig>,
2518 {
2519 self.0.request.intelligence_config = v.map(|x| x.into());
2520 self
2521 }
2522
2523 pub fn set_update_mask<T>(mut self, v: T) -> Self
2527 where
2528 T: std::convert::Into<wkt::FieldMask>,
2529 {
2530 self.0.request.update_mask = std::option::Option::Some(v.into());
2531 self
2532 }
2533
2534 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2538 where
2539 T: std::convert::Into<wkt::FieldMask>,
2540 {
2541 self.0.request.update_mask = v.map(|x| x.into());
2542 self
2543 }
2544
2545 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2547 self.0.request.request_id = v.into();
2548 self
2549 }
2550 }
2551
2552 #[doc(hidden)]
2553 impl gax::options::internal::RequestBuilder for UpdateOrganizationIntelligenceConfig {
2554 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2555 &mut self.0.options
2556 }
2557 }
2558
2559 #[derive(Clone, Debug)]
2576 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
2577
2578 impl GetIamPolicy {
2579 pub(crate) fn new(
2580 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2581 ) -> Self {
2582 Self(RequestBuilder::new(stub))
2583 }
2584
2585 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
2587 self.0.request = v.into();
2588 self
2589 }
2590
2591 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2593 self.0.options = v.into();
2594 self
2595 }
2596
2597 pub async fn send(self) -> Result<iam_v1::model::Policy> {
2599 (*self.0.stub)
2600 .get_iam_policy(self.0.request, self.0.options)
2601 .await
2602 .map(gax::response::Response::into_body)
2603 }
2604
2605 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2609 self.0.request.resource = v.into();
2610 self
2611 }
2612
2613 pub fn set_options<T>(mut self, v: T) -> Self
2615 where
2616 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
2617 {
2618 self.0.request.options = std::option::Option::Some(v.into());
2619 self
2620 }
2621
2622 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
2624 where
2625 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
2626 {
2627 self.0.request.options = v.map(|x| x.into());
2628 self
2629 }
2630 }
2631
2632 #[doc(hidden)]
2633 impl gax::options::internal::RequestBuilder for GetIamPolicy {
2634 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2635 &mut self.0.options
2636 }
2637 }
2638
2639 #[derive(Clone, Debug)]
2656 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
2657
2658 impl SetIamPolicy {
2659 pub(crate) fn new(
2660 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2661 ) -> Self {
2662 Self(RequestBuilder::new(stub))
2663 }
2664
2665 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
2667 self.0.request = v.into();
2668 self
2669 }
2670
2671 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2673 self.0.options = v.into();
2674 self
2675 }
2676
2677 pub async fn send(self) -> Result<iam_v1::model::Policy> {
2679 (*self.0.stub)
2680 .set_iam_policy(self.0.request, self.0.options)
2681 .await
2682 .map(gax::response::Response::into_body)
2683 }
2684
2685 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2689 self.0.request.resource = v.into();
2690 self
2691 }
2692
2693 pub fn set_policy<T>(mut self, v: T) -> Self
2697 where
2698 T: std::convert::Into<iam_v1::model::Policy>,
2699 {
2700 self.0.request.policy = std::option::Option::Some(v.into());
2701 self
2702 }
2703
2704 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
2708 where
2709 T: std::convert::Into<iam_v1::model::Policy>,
2710 {
2711 self.0.request.policy = v.map(|x| x.into());
2712 self
2713 }
2714
2715 pub fn set_update_mask<T>(mut self, v: T) -> Self
2717 where
2718 T: std::convert::Into<wkt::FieldMask>,
2719 {
2720 self.0.request.update_mask = std::option::Option::Some(v.into());
2721 self
2722 }
2723
2724 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2726 where
2727 T: std::convert::Into<wkt::FieldMask>,
2728 {
2729 self.0.request.update_mask = v.map(|x| x.into());
2730 self
2731 }
2732 }
2733
2734 #[doc(hidden)]
2735 impl gax::options::internal::RequestBuilder for SetIamPolicy {
2736 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2737 &mut self.0.options
2738 }
2739 }
2740
2741 #[derive(Clone, Debug)]
2758 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
2759
2760 impl TestIamPermissions {
2761 pub(crate) fn new(
2762 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2763 ) -> Self {
2764 Self(RequestBuilder::new(stub))
2765 }
2766
2767 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
2769 mut self,
2770 v: V,
2771 ) -> Self {
2772 self.0.request = v.into();
2773 self
2774 }
2775
2776 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2778 self.0.options = v.into();
2779 self
2780 }
2781
2782 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
2784 (*self.0.stub)
2785 .test_iam_permissions(self.0.request, self.0.options)
2786 .await
2787 .map(gax::response::Response::into_body)
2788 }
2789
2790 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2794 self.0.request.resource = v.into();
2795 self
2796 }
2797
2798 pub fn set_permissions<T, V>(mut self, v: T) -> Self
2802 where
2803 T: std::iter::IntoIterator<Item = V>,
2804 V: std::convert::Into<std::string::String>,
2805 {
2806 use std::iter::Iterator;
2807 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
2808 self
2809 }
2810 }
2811
2812 #[doc(hidden)]
2813 impl gax::options::internal::RequestBuilder for TestIamPermissions {
2814 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2815 &mut self.0.options
2816 }
2817 }
2818
2819 #[derive(Clone, Debug)]
2836 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
2837
2838 impl GetOperation {
2839 pub(crate) fn new(
2840 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2841 ) -> Self {
2842 Self(RequestBuilder::new(stub))
2843 }
2844
2845 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
2847 mut self,
2848 v: V,
2849 ) -> Self {
2850 self.0.request = v.into();
2851 self
2852 }
2853
2854 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2856 self.0.options = v.into();
2857 self
2858 }
2859
2860 pub async fn send(self) -> Result<longrunning::model::Operation> {
2862 (*self.0.stub)
2863 .get_operation(self.0.request, self.0.options)
2864 .await
2865 .map(gax::response::Response::into_body)
2866 }
2867
2868 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2870 self.0.request.name = v.into();
2871 self
2872 }
2873 }
2874
2875 #[doc(hidden)]
2876 impl gax::options::internal::RequestBuilder for GetOperation {
2877 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2878 &mut self.0.options
2879 }
2880 }
2881}