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)]
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<gax::options::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(gax::response::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 gax::options::internal::RequestBuilder for CreateFolder {
154 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
155 &mut self.0.options
156 }
157 }
158
159 #[derive(Clone, Debug)]
177 pub struct DeleteFolder(RequestBuilder<crate::model::DeleteFolderRequest>);
178
179 impl DeleteFolder {
180 pub(crate) fn new(
181 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
182 ) -> Self {
183 Self(RequestBuilder::new(stub))
184 }
185
186 pub fn with_request<V: Into<crate::model::DeleteFolderRequest>>(mut self, v: V) -> Self {
188 self.0.request = v.into();
189 self
190 }
191
192 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
194 self.0.options = v.into();
195 self
196 }
197
198 pub async fn send(self) -> Result<()> {
200 let req = Self::auto_populate(self.0.request, false);
201 (*self.0.stub)
202 .delete_folder(req, self.0.options)
203 .await
204 .map(gax::response::Response::into_body)
205 }
206
207 fn auto_populate(
208 mut req: crate::model::DeleteFolderRequest,
209 force: bool,
210 ) -> crate::model::DeleteFolderRequest {
211 if force || req.request_id.is_empty() {
212 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
213 }
214 req
215 }
216
217 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
221 self.0.request.name = v.into();
222 self
223 }
224
225 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
227 where
228 T: std::convert::Into<i64>,
229 {
230 self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
231 self
232 }
233
234 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
236 where
237 T: std::convert::Into<i64>,
238 {
239 self.0.request.if_metageneration_match = v.map(|x| x.into());
240 self
241 }
242
243 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
245 where
246 T: std::convert::Into<i64>,
247 {
248 self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
249 self
250 }
251
252 pub fn set_or_clear_if_metageneration_not_match<T>(
254 mut self,
255 v: std::option::Option<T>,
256 ) -> Self
257 where
258 T: std::convert::Into<i64>,
259 {
260 self.0.request.if_metageneration_not_match = v.map(|x| x.into());
261 self
262 }
263
264 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
266 self.0.request.request_id = v.into();
267 self
268 }
269 }
270
271 #[doc(hidden)]
272 impl gax::options::internal::RequestBuilder for DeleteFolder {
273 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
274 &mut self.0.options
275 }
276 }
277
278 #[derive(Clone, Debug)]
296 pub struct GetFolder(RequestBuilder<crate::model::GetFolderRequest>);
297
298 impl GetFolder {
299 pub(crate) fn new(
300 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
301 ) -> Self {
302 Self(RequestBuilder::new(stub))
303 }
304
305 pub fn with_request<V: Into<crate::model::GetFolderRequest>>(mut self, v: V) -> Self {
307 self.0.request = v.into();
308 self
309 }
310
311 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
313 self.0.options = v.into();
314 self
315 }
316
317 pub async fn send(self) -> Result<crate::model::Folder> {
319 let req = Self::auto_populate(self.0.request, false);
320 (*self.0.stub)
321 .get_folder(req, self.0.options)
322 .await
323 .map(gax::response::Response::into_body)
324 }
325
326 fn auto_populate(
327 mut req: crate::model::GetFolderRequest,
328 force: bool,
329 ) -> crate::model::GetFolderRequest {
330 if force || req.request_id.is_empty() {
331 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
332 }
333 req
334 }
335
336 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
340 self.0.request.name = v.into();
341 self
342 }
343
344 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
346 where
347 T: std::convert::Into<i64>,
348 {
349 self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
350 self
351 }
352
353 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
355 where
356 T: std::convert::Into<i64>,
357 {
358 self.0.request.if_metageneration_match = v.map(|x| x.into());
359 self
360 }
361
362 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
364 where
365 T: std::convert::Into<i64>,
366 {
367 self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
368 self
369 }
370
371 pub fn set_or_clear_if_metageneration_not_match<T>(
373 mut self,
374 v: std::option::Option<T>,
375 ) -> Self
376 where
377 T: std::convert::Into<i64>,
378 {
379 self.0.request.if_metageneration_not_match = v.map(|x| x.into());
380 self
381 }
382
383 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
385 self.0.request.request_id = v.into();
386 self
387 }
388 }
389
390 #[doc(hidden)]
391 impl gax::options::internal::RequestBuilder for GetFolder {
392 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
393 &mut self.0.options
394 }
395 }
396
397 #[derive(Clone, Debug)]
419 pub struct ListFolders(RequestBuilder<crate::model::ListFoldersRequest>);
420
421 impl ListFolders {
422 pub(crate) fn new(
423 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
424 ) -> Self {
425 Self(RequestBuilder::new(stub))
426 }
427
428 pub fn with_request<V: Into<crate::model::ListFoldersRequest>>(mut self, v: V) -> Self {
430 self.0.request = v.into();
431 self
432 }
433
434 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
436 self.0.options = v.into();
437 self
438 }
439
440 pub async fn send(self) -> Result<crate::model::ListFoldersResponse> {
442 (*self.0.stub)
443 .list_folders(self.0.request, self.0.options)
444 .await
445 .map(gax::response::Response::into_body)
446 }
447
448 pub fn by_page(
450 self,
451 ) -> impl gax::paginator::Paginator<crate::model::ListFoldersResponse, gax::error::Error>
452 {
453 use std::clone::Clone;
454 let token = self.0.request.page_token.clone();
455 let execute = move |token: String| {
456 let mut builder = self.clone();
457 builder.0.request = builder.0.request.set_page_token(token);
458 builder.send()
459 };
460 gax::paginator::internal::new_paginator(token, execute)
461 }
462
463 pub fn by_item(
465 self,
466 ) -> impl gax::paginator::ItemPaginator<crate::model::ListFoldersResponse, gax::error::Error>
467 {
468 use gax::paginator::Paginator;
469 self.by_page().items()
470 }
471
472 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
476 self.0.request.parent = v.into();
477 self
478 }
479
480 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
482 self.0.request.page_size = v.into();
483 self
484 }
485
486 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
488 self.0.request.page_token = v.into();
489 self
490 }
491
492 pub fn set_prefix<T: Into<std::string::String>>(mut self, v: T) -> Self {
494 self.0.request.prefix = v.into();
495 self
496 }
497
498 pub fn set_delimiter<T: Into<std::string::String>>(mut self, v: T) -> Self {
500 self.0.request.delimiter = v.into();
501 self
502 }
503
504 pub fn set_lexicographic_start<T: Into<std::string::String>>(mut self, v: T) -> Self {
506 self.0.request.lexicographic_start = v.into();
507 self
508 }
509
510 pub fn set_lexicographic_end<T: Into<std::string::String>>(mut self, v: T) -> Self {
512 self.0.request.lexicographic_end = v.into();
513 self
514 }
515
516 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
518 self.0.request.request_id = v.into();
519 self
520 }
521 }
522
523 #[doc(hidden)]
524 impl gax::options::internal::RequestBuilder for ListFolders {
525 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
526 &mut self.0.options
527 }
528 }
529
530 #[derive(Clone, Debug)]
549 pub struct RenameFolder(RequestBuilder<crate::model::RenameFolderRequest>);
550
551 impl RenameFolder {
552 pub(crate) fn new(
553 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
554 ) -> Self {
555 Self(RequestBuilder::new(stub))
556 }
557
558 pub fn with_request<V: Into<crate::model::RenameFolderRequest>>(mut self, v: V) -> Self {
560 self.0.request = v.into();
561 self
562 }
563
564 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
566 self.0.options = v.into();
567 self
568 }
569
570 pub async fn send(self) -> Result<longrunning::model::Operation> {
577 let req = Self::auto_populate(self.0.request, false);
578 (*self.0.stub)
579 .rename_folder(req, self.0.options)
580 .await
581 .map(gax::response::Response::into_body)
582 }
583
584 pub fn poller(
586 self,
587 ) -> impl lro::Poller<crate::model::Folder, crate::model::RenameFolderMetadata> {
588 type Operation =
589 lro::internal::Operation<crate::model::Folder, crate::model::RenameFolderMetadata>;
590 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
591 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
592
593 let stub = self.0.stub.clone();
594 let mut options = self.0.options.clone();
595 options.set_retry_policy(gax::retry_policy::NeverRetry);
596 let query = move |name| {
597 let stub = stub.clone();
598 let options = options.clone();
599 async {
600 let op = GetOperation::new(stub)
601 .set_name(name)
602 .with_options(options)
603 .send()
604 .await?;
605 Ok(Operation::new(op))
606 }
607 };
608
609 let start = move || async {
610 let op = self.send().await?;
611 Ok(Operation::new(op))
612 };
613
614 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
615 }
616
617 fn auto_populate(
618 mut req: crate::model::RenameFolderRequest,
619 force: bool,
620 ) -> crate::model::RenameFolderRequest {
621 if force || req.request_id.is_empty() {
622 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
623 }
624 req
625 }
626
627 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
631 self.0.request.name = v.into();
632 self
633 }
634
635 pub fn set_destination_folder_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
639 self.0.request.destination_folder_id = v.into();
640 self
641 }
642
643 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
645 where
646 T: std::convert::Into<i64>,
647 {
648 self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
649 self
650 }
651
652 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
654 where
655 T: std::convert::Into<i64>,
656 {
657 self.0.request.if_metageneration_match = v.map(|x| x.into());
658 self
659 }
660
661 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
663 where
664 T: std::convert::Into<i64>,
665 {
666 self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
667 self
668 }
669
670 pub fn set_or_clear_if_metageneration_not_match<T>(
672 mut self,
673 v: std::option::Option<T>,
674 ) -> Self
675 where
676 T: std::convert::Into<i64>,
677 {
678 self.0.request.if_metageneration_not_match = v.map(|x| x.into());
679 self
680 }
681
682 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
684 self.0.request.request_id = v.into();
685 self
686 }
687 }
688
689 #[doc(hidden)]
690 impl gax::options::internal::RequestBuilder for RenameFolder {
691 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
692 &mut self.0.options
693 }
694 }
695
696 #[derive(Clone, Debug)]
714 pub struct GetStorageLayout(RequestBuilder<crate::model::GetStorageLayoutRequest>);
715
716 impl GetStorageLayout {
717 pub(crate) fn new(
718 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
719 ) -> Self {
720 Self(RequestBuilder::new(stub))
721 }
722
723 pub fn with_request<V: Into<crate::model::GetStorageLayoutRequest>>(
725 mut self,
726 v: V,
727 ) -> Self {
728 self.0.request = v.into();
729 self
730 }
731
732 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
734 self.0.options = v.into();
735 self
736 }
737
738 pub async fn send(self) -> Result<crate::model::StorageLayout> {
740 let req = Self::auto_populate(self.0.request, false);
741 (*self.0.stub)
742 .get_storage_layout(req, self.0.options)
743 .await
744 .map(gax::response::Response::into_body)
745 }
746
747 fn auto_populate(
748 mut req: crate::model::GetStorageLayoutRequest,
749 force: bool,
750 ) -> crate::model::GetStorageLayoutRequest {
751 if force || req.request_id.is_empty() {
752 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
753 }
754 req
755 }
756
757 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
761 self.0.request.name = v.into();
762 self
763 }
764
765 pub fn set_prefix<T: Into<std::string::String>>(mut self, v: T) -> Self {
767 self.0.request.prefix = v.into();
768 self
769 }
770
771 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
773 self.0.request.request_id = v.into();
774 self
775 }
776 }
777
778 #[doc(hidden)]
779 impl gax::options::internal::RequestBuilder for GetStorageLayout {
780 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
781 &mut self.0.options
782 }
783 }
784
785 #[derive(Clone, Debug)]
803 pub struct CreateManagedFolder(RequestBuilder<crate::model::CreateManagedFolderRequest>);
804
805 impl CreateManagedFolder {
806 pub(crate) fn new(
807 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
808 ) -> Self {
809 Self(RequestBuilder::new(stub))
810 }
811
812 pub fn with_request<V: Into<crate::model::CreateManagedFolderRequest>>(
814 mut self,
815 v: V,
816 ) -> Self {
817 self.0.request = v.into();
818 self
819 }
820
821 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
823 self.0.options = v.into();
824 self
825 }
826
827 pub async fn send(self) -> Result<crate::model::ManagedFolder> {
829 let req = Self::auto_populate(self.0.request, false);
830 (*self.0.stub)
831 .create_managed_folder(req, self.0.options)
832 .await
833 .map(gax::response::Response::into_body)
834 }
835
836 fn auto_populate(
837 mut req: crate::model::CreateManagedFolderRequest,
838 force: bool,
839 ) -> crate::model::CreateManagedFolderRequest {
840 if force || req.request_id.is_empty() {
841 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
842 }
843 req
844 }
845
846 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
850 self.0.request.parent = v.into();
851 self
852 }
853
854 pub fn set_managed_folder<T>(mut self, v: T) -> Self
858 where
859 T: std::convert::Into<crate::model::ManagedFolder>,
860 {
861 self.0.request.managed_folder = std::option::Option::Some(v.into());
862 self
863 }
864
865 pub fn set_or_clear_managed_folder<T>(mut self, v: std::option::Option<T>) -> Self
869 where
870 T: std::convert::Into<crate::model::ManagedFolder>,
871 {
872 self.0.request.managed_folder = v.map(|x| x.into());
873 self
874 }
875
876 pub fn set_managed_folder_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
880 self.0.request.managed_folder_id = v.into();
881 self
882 }
883
884 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
886 self.0.request.request_id = v.into();
887 self
888 }
889 }
890
891 #[doc(hidden)]
892 impl gax::options::internal::RequestBuilder for CreateManagedFolder {
893 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
894 &mut self.0.options
895 }
896 }
897
898 #[derive(Clone, Debug)]
916 pub struct DeleteManagedFolder(RequestBuilder<crate::model::DeleteManagedFolderRequest>);
917
918 impl DeleteManagedFolder {
919 pub(crate) fn new(
920 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
921 ) -> Self {
922 Self(RequestBuilder::new(stub))
923 }
924
925 pub fn with_request<V: Into<crate::model::DeleteManagedFolderRequest>>(
927 mut self,
928 v: V,
929 ) -> Self {
930 self.0.request = v.into();
931 self
932 }
933
934 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
936 self.0.options = v.into();
937 self
938 }
939
940 pub async fn send(self) -> Result<()> {
942 let req = Self::auto_populate(self.0.request, false);
943 (*self.0.stub)
944 .delete_managed_folder(req, self.0.options)
945 .await
946 .map(gax::response::Response::into_body)
947 }
948
949 fn auto_populate(
950 mut req: crate::model::DeleteManagedFolderRequest,
951 force: bool,
952 ) -> crate::model::DeleteManagedFolderRequest {
953 if force || req.request_id.is_empty() {
954 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
955 }
956 req
957 }
958
959 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
963 self.0.request.name = v.into();
964 self
965 }
966
967 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
969 where
970 T: std::convert::Into<i64>,
971 {
972 self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
973 self
974 }
975
976 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
978 where
979 T: std::convert::Into<i64>,
980 {
981 self.0.request.if_metageneration_match = v.map(|x| x.into());
982 self
983 }
984
985 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
987 where
988 T: std::convert::Into<i64>,
989 {
990 self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
991 self
992 }
993
994 pub fn set_or_clear_if_metageneration_not_match<T>(
996 mut self,
997 v: std::option::Option<T>,
998 ) -> Self
999 where
1000 T: std::convert::Into<i64>,
1001 {
1002 self.0.request.if_metageneration_not_match = v.map(|x| x.into());
1003 self
1004 }
1005
1006 pub fn set_allow_non_empty<T: Into<bool>>(mut self, v: T) -> Self {
1008 self.0.request.allow_non_empty = v.into();
1009 self
1010 }
1011
1012 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1014 self.0.request.request_id = v.into();
1015 self
1016 }
1017 }
1018
1019 #[doc(hidden)]
1020 impl gax::options::internal::RequestBuilder for DeleteManagedFolder {
1021 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1022 &mut self.0.options
1023 }
1024 }
1025
1026 #[derive(Clone, Debug)]
1044 pub struct GetManagedFolder(RequestBuilder<crate::model::GetManagedFolderRequest>);
1045
1046 impl GetManagedFolder {
1047 pub(crate) fn new(
1048 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1049 ) -> Self {
1050 Self(RequestBuilder::new(stub))
1051 }
1052
1053 pub fn with_request<V: Into<crate::model::GetManagedFolderRequest>>(
1055 mut self,
1056 v: V,
1057 ) -> Self {
1058 self.0.request = v.into();
1059 self
1060 }
1061
1062 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1064 self.0.options = v.into();
1065 self
1066 }
1067
1068 pub async fn send(self) -> Result<crate::model::ManagedFolder> {
1070 let req = Self::auto_populate(self.0.request, false);
1071 (*self.0.stub)
1072 .get_managed_folder(req, self.0.options)
1073 .await
1074 .map(gax::response::Response::into_body)
1075 }
1076
1077 fn auto_populate(
1078 mut req: crate::model::GetManagedFolderRequest,
1079 force: bool,
1080 ) -> crate::model::GetManagedFolderRequest {
1081 if force || req.request_id.is_empty() {
1082 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
1083 }
1084 req
1085 }
1086
1087 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1091 self.0.request.name = v.into();
1092 self
1093 }
1094
1095 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
1097 where
1098 T: std::convert::Into<i64>,
1099 {
1100 self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
1101 self
1102 }
1103
1104 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
1106 where
1107 T: std::convert::Into<i64>,
1108 {
1109 self.0.request.if_metageneration_match = v.map(|x| x.into());
1110 self
1111 }
1112
1113 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
1115 where
1116 T: std::convert::Into<i64>,
1117 {
1118 self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
1119 self
1120 }
1121
1122 pub fn set_or_clear_if_metageneration_not_match<T>(
1124 mut self,
1125 v: std::option::Option<T>,
1126 ) -> Self
1127 where
1128 T: std::convert::Into<i64>,
1129 {
1130 self.0.request.if_metageneration_not_match = v.map(|x| x.into());
1131 self
1132 }
1133
1134 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1136 self.0.request.request_id = v.into();
1137 self
1138 }
1139 }
1140
1141 #[doc(hidden)]
1142 impl gax::options::internal::RequestBuilder for GetManagedFolder {
1143 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1144 &mut self.0.options
1145 }
1146 }
1147
1148 #[derive(Clone, Debug)]
1170 pub struct ListManagedFolders(RequestBuilder<crate::model::ListManagedFoldersRequest>);
1171
1172 impl ListManagedFolders {
1173 pub(crate) fn new(
1174 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1175 ) -> Self {
1176 Self(RequestBuilder::new(stub))
1177 }
1178
1179 pub fn with_request<V: Into<crate::model::ListManagedFoldersRequest>>(
1181 mut self,
1182 v: V,
1183 ) -> Self {
1184 self.0.request = v.into();
1185 self
1186 }
1187
1188 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1190 self.0.options = v.into();
1191 self
1192 }
1193
1194 pub async fn send(self) -> Result<crate::model::ListManagedFoldersResponse> {
1196 let req = Self::auto_populate(self.0.request, false);
1197 (*self.0.stub)
1198 .list_managed_folders(req, self.0.options)
1199 .await
1200 .map(gax::response::Response::into_body)
1201 }
1202
1203 pub fn by_page(
1205 self,
1206 ) -> impl gax::paginator::Paginator<crate::model::ListManagedFoldersResponse, gax::error::Error>
1207 {
1208 use std::clone::Clone;
1209 let token = self.0.request.page_token.clone();
1210 let execute = move |token: String| {
1211 let mut builder = self.clone();
1212 let initial = builder.0.request.page_token == token;
1213 builder.0.request = Self::auto_populate(builder.0.request, !initial);
1214 builder.0.request = builder.0.request.set_page_token(token);
1215 builder.send()
1216 };
1217 gax::paginator::internal::new_paginator(token, execute)
1218 }
1219
1220 pub fn by_item(
1222 self,
1223 ) -> impl gax::paginator::ItemPaginator<
1224 crate::model::ListManagedFoldersResponse,
1225 gax::error::Error,
1226 > {
1227 use gax::paginator::Paginator;
1228 self.by_page().items()
1229 }
1230
1231 fn auto_populate(
1232 mut req: crate::model::ListManagedFoldersRequest,
1233 force: bool,
1234 ) -> crate::model::ListManagedFoldersRequest {
1235 if force || req.request_id.is_empty() {
1236 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
1237 }
1238 req
1239 }
1240
1241 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1245 self.0.request.parent = v.into();
1246 self
1247 }
1248
1249 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1251 self.0.request.page_size = v.into();
1252 self
1253 }
1254
1255 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1257 self.0.request.page_token = v.into();
1258 self
1259 }
1260
1261 pub fn set_prefix<T: Into<std::string::String>>(mut self, v: T) -> Self {
1263 self.0.request.prefix = v.into();
1264 self
1265 }
1266
1267 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1269 self.0.request.request_id = v.into();
1270 self
1271 }
1272 }
1273
1274 #[doc(hidden)]
1275 impl gax::options::internal::RequestBuilder for ListManagedFolders {
1276 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1277 &mut self.0.options
1278 }
1279 }
1280
1281 #[derive(Clone, Debug)]
1300 pub struct CreateAnywhereCache(RequestBuilder<crate::model::CreateAnywhereCacheRequest>);
1301
1302 impl CreateAnywhereCache {
1303 pub(crate) fn new(
1304 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1305 ) -> Self {
1306 Self(RequestBuilder::new(stub))
1307 }
1308
1309 pub fn with_request<V: Into<crate::model::CreateAnywhereCacheRequest>>(
1311 mut self,
1312 v: V,
1313 ) -> Self {
1314 self.0.request = v.into();
1315 self
1316 }
1317
1318 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1320 self.0.options = v.into();
1321 self
1322 }
1323
1324 pub async fn send(self) -> Result<longrunning::model::Operation> {
1331 let req = Self::auto_populate(self.0.request, false);
1332 (*self.0.stub)
1333 .create_anywhere_cache(req, self.0.options)
1334 .await
1335 .map(gax::response::Response::into_body)
1336 }
1337
1338 pub fn poller(
1340 self,
1341 ) -> impl lro::Poller<crate::model::AnywhereCache, crate::model::CreateAnywhereCacheMetadata>
1342 {
1343 type Operation = lro::internal::Operation<
1344 crate::model::AnywhereCache,
1345 crate::model::CreateAnywhereCacheMetadata,
1346 >;
1347 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1348 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1349
1350 let stub = self.0.stub.clone();
1351 let mut options = self.0.options.clone();
1352 options.set_retry_policy(gax::retry_policy::NeverRetry);
1353 let query = move |name| {
1354 let stub = stub.clone();
1355 let options = options.clone();
1356 async {
1357 let op = GetOperation::new(stub)
1358 .set_name(name)
1359 .with_options(options)
1360 .send()
1361 .await?;
1362 Ok(Operation::new(op))
1363 }
1364 };
1365
1366 let start = move || async {
1367 let op = self.send().await?;
1368 Ok(Operation::new(op))
1369 };
1370
1371 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1372 }
1373
1374 fn auto_populate(
1375 mut req: crate::model::CreateAnywhereCacheRequest,
1376 force: bool,
1377 ) -> crate::model::CreateAnywhereCacheRequest {
1378 if force || req.request_id.is_empty() {
1379 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
1380 }
1381 req
1382 }
1383
1384 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1388 self.0.request.parent = v.into();
1389 self
1390 }
1391
1392 pub fn set_anywhere_cache<T>(mut self, v: T) -> Self
1396 where
1397 T: std::convert::Into<crate::model::AnywhereCache>,
1398 {
1399 self.0.request.anywhere_cache = std::option::Option::Some(v.into());
1400 self
1401 }
1402
1403 pub fn set_or_clear_anywhere_cache<T>(mut self, v: std::option::Option<T>) -> Self
1407 where
1408 T: std::convert::Into<crate::model::AnywhereCache>,
1409 {
1410 self.0.request.anywhere_cache = v.map(|x| x.into());
1411 self
1412 }
1413
1414 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1416 self.0.request.request_id = v.into();
1417 self
1418 }
1419 }
1420
1421 #[doc(hidden)]
1422 impl gax::options::internal::RequestBuilder for CreateAnywhereCache {
1423 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1424 &mut self.0.options
1425 }
1426 }
1427
1428 #[derive(Clone, Debug)]
1447 pub struct UpdateAnywhereCache(RequestBuilder<crate::model::UpdateAnywhereCacheRequest>);
1448
1449 impl UpdateAnywhereCache {
1450 pub(crate) fn new(
1451 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1452 ) -> Self {
1453 Self(RequestBuilder::new(stub))
1454 }
1455
1456 pub fn with_request<V: Into<crate::model::UpdateAnywhereCacheRequest>>(
1458 mut self,
1459 v: V,
1460 ) -> Self {
1461 self.0.request = v.into();
1462 self
1463 }
1464
1465 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1467 self.0.options = v.into();
1468 self
1469 }
1470
1471 pub async fn send(self) -> Result<longrunning::model::Operation> {
1478 let req = Self::auto_populate(self.0.request, false);
1479 (*self.0.stub)
1480 .update_anywhere_cache(req, self.0.options)
1481 .await
1482 .map(gax::response::Response::into_body)
1483 }
1484
1485 pub fn poller(
1487 self,
1488 ) -> impl lro::Poller<crate::model::AnywhereCache, crate::model::UpdateAnywhereCacheMetadata>
1489 {
1490 type Operation = lro::internal::Operation<
1491 crate::model::AnywhereCache,
1492 crate::model::UpdateAnywhereCacheMetadata,
1493 >;
1494 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1495 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1496
1497 let stub = self.0.stub.clone();
1498 let mut options = self.0.options.clone();
1499 options.set_retry_policy(gax::retry_policy::NeverRetry);
1500 let query = move |name| {
1501 let stub = stub.clone();
1502 let options = options.clone();
1503 async {
1504 let op = GetOperation::new(stub)
1505 .set_name(name)
1506 .with_options(options)
1507 .send()
1508 .await?;
1509 Ok(Operation::new(op))
1510 }
1511 };
1512
1513 let start = move || async {
1514 let op = self.send().await?;
1515 Ok(Operation::new(op))
1516 };
1517
1518 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1519 }
1520
1521 fn auto_populate(
1522 mut req: crate::model::UpdateAnywhereCacheRequest,
1523 force: bool,
1524 ) -> crate::model::UpdateAnywhereCacheRequest {
1525 if force || req.request_id.is_empty() {
1526 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
1527 }
1528 req
1529 }
1530
1531 pub fn set_anywhere_cache<T>(mut self, v: T) -> Self
1535 where
1536 T: std::convert::Into<crate::model::AnywhereCache>,
1537 {
1538 self.0.request.anywhere_cache = std::option::Option::Some(v.into());
1539 self
1540 }
1541
1542 pub fn set_or_clear_anywhere_cache<T>(mut self, v: std::option::Option<T>) -> Self
1546 where
1547 T: std::convert::Into<crate::model::AnywhereCache>,
1548 {
1549 self.0.request.anywhere_cache = v.map(|x| x.into());
1550 self
1551 }
1552
1553 pub fn set_update_mask<T>(mut self, v: T) -> Self
1557 where
1558 T: std::convert::Into<wkt::FieldMask>,
1559 {
1560 self.0.request.update_mask = std::option::Option::Some(v.into());
1561 self
1562 }
1563
1564 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1568 where
1569 T: std::convert::Into<wkt::FieldMask>,
1570 {
1571 self.0.request.update_mask = v.map(|x| x.into());
1572 self
1573 }
1574
1575 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1577 self.0.request.request_id = v.into();
1578 self
1579 }
1580 }
1581
1582 #[doc(hidden)]
1583 impl gax::options::internal::RequestBuilder for UpdateAnywhereCache {
1584 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1585 &mut self.0.options
1586 }
1587 }
1588
1589 #[derive(Clone, Debug)]
1607 pub struct DisableAnywhereCache(RequestBuilder<crate::model::DisableAnywhereCacheRequest>);
1608
1609 impl DisableAnywhereCache {
1610 pub(crate) fn new(
1611 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1612 ) -> Self {
1613 Self(RequestBuilder::new(stub))
1614 }
1615
1616 pub fn with_request<V: Into<crate::model::DisableAnywhereCacheRequest>>(
1618 mut self,
1619 v: V,
1620 ) -> Self {
1621 self.0.request = v.into();
1622 self
1623 }
1624
1625 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1627 self.0.options = v.into();
1628 self
1629 }
1630
1631 pub async fn send(self) -> Result<crate::model::AnywhereCache> {
1633 let req = Self::auto_populate(self.0.request, false);
1634 (*self.0.stub)
1635 .disable_anywhere_cache(req, self.0.options)
1636 .await
1637 .map(gax::response::Response::into_body)
1638 }
1639
1640 fn auto_populate(
1641 mut req: crate::model::DisableAnywhereCacheRequest,
1642 force: bool,
1643 ) -> crate::model::DisableAnywhereCacheRequest {
1644 if force || req.request_id.is_empty() {
1645 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
1646 }
1647 req
1648 }
1649
1650 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1654 self.0.request.name = v.into();
1655 self
1656 }
1657
1658 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1660 self.0.request.request_id = v.into();
1661 self
1662 }
1663 }
1664
1665 #[doc(hidden)]
1666 impl gax::options::internal::RequestBuilder for DisableAnywhereCache {
1667 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1668 &mut self.0.options
1669 }
1670 }
1671
1672 #[derive(Clone, Debug)]
1690 pub struct PauseAnywhereCache(RequestBuilder<crate::model::PauseAnywhereCacheRequest>);
1691
1692 impl PauseAnywhereCache {
1693 pub(crate) fn new(
1694 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1695 ) -> Self {
1696 Self(RequestBuilder::new(stub))
1697 }
1698
1699 pub fn with_request<V: Into<crate::model::PauseAnywhereCacheRequest>>(
1701 mut self,
1702 v: V,
1703 ) -> Self {
1704 self.0.request = v.into();
1705 self
1706 }
1707
1708 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1710 self.0.options = v.into();
1711 self
1712 }
1713
1714 pub async fn send(self) -> Result<crate::model::AnywhereCache> {
1716 let req = Self::auto_populate(self.0.request, false);
1717 (*self.0.stub)
1718 .pause_anywhere_cache(req, self.0.options)
1719 .await
1720 .map(gax::response::Response::into_body)
1721 }
1722
1723 fn auto_populate(
1724 mut req: crate::model::PauseAnywhereCacheRequest,
1725 force: bool,
1726 ) -> crate::model::PauseAnywhereCacheRequest {
1727 if force || req.request_id.is_empty() {
1728 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
1729 }
1730 req
1731 }
1732
1733 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1737 self.0.request.name = v.into();
1738 self
1739 }
1740
1741 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1743 self.0.request.request_id = v.into();
1744 self
1745 }
1746 }
1747
1748 #[doc(hidden)]
1749 impl gax::options::internal::RequestBuilder for PauseAnywhereCache {
1750 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1751 &mut self.0.options
1752 }
1753 }
1754
1755 #[derive(Clone, Debug)]
1773 pub struct ResumeAnywhereCache(RequestBuilder<crate::model::ResumeAnywhereCacheRequest>);
1774
1775 impl ResumeAnywhereCache {
1776 pub(crate) fn new(
1777 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1778 ) -> Self {
1779 Self(RequestBuilder::new(stub))
1780 }
1781
1782 pub fn with_request<V: Into<crate::model::ResumeAnywhereCacheRequest>>(
1784 mut self,
1785 v: V,
1786 ) -> Self {
1787 self.0.request = v.into();
1788 self
1789 }
1790
1791 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1793 self.0.options = v.into();
1794 self
1795 }
1796
1797 pub async fn send(self) -> Result<crate::model::AnywhereCache> {
1799 let req = Self::auto_populate(self.0.request, false);
1800 (*self.0.stub)
1801 .resume_anywhere_cache(req, self.0.options)
1802 .await
1803 .map(gax::response::Response::into_body)
1804 }
1805
1806 fn auto_populate(
1807 mut req: crate::model::ResumeAnywhereCacheRequest,
1808 force: bool,
1809 ) -> crate::model::ResumeAnywhereCacheRequest {
1810 if force || req.request_id.is_empty() {
1811 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
1812 }
1813 req
1814 }
1815
1816 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1820 self.0.request.name = v.into();
1821 self
1822 }
1823
1824 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1826 self.0.request.request_id = v.into();
1827 self
1828 }
1829 }
1830
1831 #[doc(hidden)]
1832 impl gax::options::internal::RequestBuilder for ResumeAnywhereCache {
1833 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1834 &mut self.0.options
1835 }
1836 }
1837
1838 #[derive(Clone, Debug)]
1856 pub struct GetAnywhereCache(RequestBuilder<crate::model::GetAnywhereCacheRequest>);
1857
1858 impl GetAnywhereCache {
1859 pub(crate) fn new(
1860 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1861 ) -> Self {
1862 Self(RequestBuilder::new(stub))
1863 }
1864
1865 pub fn with_request<V: Into<crate::model::GetAnywhereCacheRequest>>(
1867 mut self,
1868 v: V,
1869 ) -> Self {
1870 self.0.request = v.into();
1871 self
1872 }
1873
1874 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1876 self.0.options = v.into();
1877 self
1878 }
1879
1880 pub async fn send(self) -> Result<crate::model::AnywhereCache> {
1882 let req = Self::auto_populate(self.0.request, false);
1883 (*self.0.stub)
1884 .get_anywhere_cache(req, self.0.options)
1885 .await
1886 .map(gax::response::Response::into_body)
1887 }
1888
1889 fn auto_populate(
1890 mut req: crate::model::GetAnywhereCacheRequest,
1891 force: bool,
1892 ) -> crate::model::GetAnywhereCacheRequest {
1893 if force || req.request_id.is_empty() {
1894 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
1895 }
1896 req
1897 }
1898
1899 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1903 self.0.request.name = v.into();
1904 self
1905 }
1906
1907 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1909 self.0.request.request_id = v.into();
1910 self
1911 }
1912 }
1913
1914 #[doc(hidden)]
1915 impl gax::options::internal::RequestBuilder for GetAnywhereCache {
1916 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1917 &mut self.0.options
1918 }
1919 }
1920
1921 #[derive(Clone, Debug)]
1943 pub struct ListAnywhereCaches(RequestBuilder<crate::model::ListAnywhereCachesRequest>);
1944
1945 impl ListAnywhereCaches {
1946 pub(crate) fn new(
1947 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1948 ) -> Self {
1949 Self(RequestBuilder::new(stub))
1950 }
1951
1952 pub fn with_request<V: Into<crate::model::ListAnywhereCachesRequest>>(
1954 mut self,
1955 v: V,
1956 ) -> Self {
1957 self.0.request = v.into();
1958 self
1959 }
1960
1961 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1963 self.0.options = v.into();
1964 self
1965 }
1966
1967 pub async fn send(self) -> Result<crate::model::ListAnywhereCachesResponse> {
1969 let req = Self::auto_populate(self.0.request, false);
1970 (*self.0.stub)
1971 .list_anywhere_caches(req, self.0.options)
1972 .await
1973 .map(gax::response::Response::into_body)
1974 }
1975
1976 pub fn by_page(
1978 self,
1979 ) -> impl gax::paginator::Paginator<crate::model::ListAnywhereCachesResponse, gax::error::Error>
1980 {
1981 use std::clone::Clone;
1982 let token = self.0.request.page_token.clone();
1983 let execute = move |token: String| {
1984 let mut builder = self.clone();
1985 let initial = builder.0.request.page_token == token;
1986 builder.0.request = Self::auto_populate(builder.0.request, !initial);
1987 builder.0.request = builder.0.request.set_page_token(token);
1988 builder.send()
1989 };
1990 gax::paginator::internal::new_paginator(token, execute)
1991 }
1992
1993 pub fn by_item(
1995 self,
1996 ) -> impl gax::paginator::ItemPaginator<
1997 crate::model::ListAnywhereCachesResponse,
1998 gax::error::Error,
1999 > {
2000 use gax::paginator::Paginator;
2001 self.by_page().items()
2002 }
2003
2004 fn auto_populate(
2005 mut req: crate::model::ListAnywhereCachesRequest,
2006 force: bool,
2007 ) -> crate::model::ListAnywhereCachesRequest {
2008 if force || req.request_id.is_empty() {
2009 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
2010 }
2011 req
2012 }
2013
2014 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2018 self.0.request.parent = v.into();
2019 self
2020 }
2021
2022 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2024 self.0.request.page_size = v.into();
2025 self
2026 }
2027
2028 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2030 self.0.request.page_token = v.into();
2031 self
2032 }
2033
2034 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2036 self.0.request.request_id = v.into();
2037 self
2038 }
2039 }
2040
2041 #[doc(hidden)]
2042 impl gax::options::internal::RequestBuilder for ListAnywhereCaches {
2043 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2044 &mut self.0.options
2045 }
2046 }
2047
2048 #[derive(Clone, Debug)]
2066 pub struct GetProjectIntelligenceConfig(
2067 RequestBuilder<crate::model::GetProjectIntelligenceConfigRequest>,
2068 );
2069
2070 impl GetProjectIntelligenceConfig {
2071 pub(crate) fn new(
2072 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2073 ) -> Self {
2074 Self(RequestBuilder::new(stub))
2075 }
2076
2077 pub fn with_request<V: Into<crate::model::GetProjectIntelligenceConfigRequest>>(
2079 mut self,
2080 v: V,
2081 ) -> Self {
2082 self.0.request = v.into();
2083 self
2084 }
2085
2086 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2088 self.0.options = v.into();
2089 self
2090 }
2091
2092 pub async fn send(self) -> Result<crate::model::IntelligenceConfig> {
2094 (*self.0.stub)
2095 .get_project_intelligence_config(self.0.request, self.0.options)
2096 .await
2097 .map(gax::response::Response::into_body)
2098 }
2099
2100 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2104 self.0.request.name = v.into();
2105 self
2106 }
2107 }
2108
2109 #[doc(hidden)]
2110 impl gax::options::internal::RequestBuilder for GetProjectIntelligenceConfig {
2111 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2112 &mut self.0.options
2113 }
2114 }
2115
2116 #[derive(Clone, Debug)]
2134 pub struct UpdateProjectIntelligenceConfig(
2135 RequestBuilder<crate::model::UpdateProjectIntelligenceConfigRequest>,
2136 );
2137
2138 impl UpdateProjectIntelligenceConfig {
2139 pub(crate) fn new(
2140 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2141 ) -> Self {
2142 Self(RequestBuilder::new(stub))
2143 }
2144
2145 pub fn with_request<V: Into<crate::model::UpdateProjectIntelligenceConfigRequest>>(
2147 mut self,
2148 v: V,
2149 ) -> Self {
2150 self.0.request = v.into();
2151 self
2152 }
2153
2154 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2156 self.0.options = v.into();
2157 self
2158 }
2159
2160 pub async fn send(self) -> Result<crate::model::IntelligenceConfig> {
2162 (*self.0.stub)
2163 .update_project_intelligence_config(self.0.request, self.0.options)
2164 .await
2165 .map(gax::response::Response::into_body)
2166 }
2167
2168 pub fn set_intelligence_config<T>(mut self, v: T) -> Self
2172 where
2173 T: std::convert::Into<crate::model::IntelligenceConfig>,
2174 {
2175 self.0.request.intelligence_config = std::option::Option::Some(v.into());
2176 self
2177 }
2178
2179 pub fn set_or_clear_intelligence_config<T>(mut self, v: std::option::Option<T>) -> Self
2183 where
2184 T: std::convert::Into<crate::model::IntelligenceConfig>,
2185 {
2186 self.0.request.intelligence_config = v.map(|x| x.into());
2187 self
2188 }
2189
2190 pub fn set_update_mask<T>(mut self, v: T) -> Self
2194 where
2195 T: std::convert::Into<wkt::FieldMask>,
2196 {
2197 self.0.request.update_mask = std::option::Option::Some(v.into());
2198 self
2199 }
2200
2201 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2205 where
2206 T: std::convert::Into<wkt::FieldMask>,
2207 {
2208 self.0.request.update_mask = v.map(|x| x.into());
2209 self
2210 }
2211
2212 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2214 self.0.request.request_id = v.into();
2215 self
2216 }
2217 }
2218
2219 #[doc(hidden)]
2220 impl gax::options::internal::RequestBuilder for UpdateProjectIntelligenceConfig {
2221 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2222 &mut self.0.options
2223 }
2224 }
2225
2226 #[derive(Clone, Debug)]
2244 pub struct GetFolderIntelligenceConfig(
2245 RequestBuilder<crate::model::GetFolderIntelligenceConfigRequest>,
2246 );
2247
2248 impl GetFolderIntelligenceConfig {
2249 pub(crate) fn new(
2250 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2251 ) -> Self {
2252 Self(RequestBuilder::new(stub))
2253 }
2254
2255 pub fn with_request<V: Into<crate::model::GetFolderIntelligenceConfigRequest>>(
2257 mut self,
2258 v: V,
2259 ) -> Self {
2260 self.0.request = v.into();
2261 self
2262 }
2263
2264 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2266 self.0.options = v.into();
2267 self
2268 }
2269
2270 pub async fn send(self) -> Result<crate::model::IntelligenceConfig> {
2272 (*self.0.stub)
2273 .get_folder_intelligence_config(self.0.request, self.0.options)
2274 .await
2275 .map(gax::response::Response::into_body)
2276 }
2277
2278 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2282 self.0.request.name = v.into();
2283 self
2284 }
2285 }
2286
2287 #[doc(hidden)]
2288 impl gax::options::internal::RequestBuilder for GetFolderIntelligenceConfig {
2289 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2290 &mut self.0.options
2291 }
2292 }
2293
2294 #[derive(Clone, Debug)]
2312 pub struct UpdateFolderIntelligenceConfig(
2313 RequestBuilder<crate::model::UpdateFolderIntelligenceConfigRequest>,
2314 );
2315
2316 impl UpdateFolderIntelligenceConfig {
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::UpdateFolderIntelligenceConfigRequest>>(
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<gax::options::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_folder_intelligence_config(self.0.request, self.0.options)
2342 .await
2343 .map(gax::response::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 gax::options::internal::RequestBuilder for UpdateFolderIntelligenceConfig {
2399 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2400 &mut self.0.options
2401 }
2402 }
2403
2404 #[derive(Clone, Debug)]
2422 pub struct GetOrganizationIntelligenceConfig(
2423 RequestBuilder<crate::model::GetOrganizationIntelligenceConfigRequest>,
2424 );
2425
2426 impl GetOrganizationIntelligenceConfig {
2427 pub(crate) fn new(
2428 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2429 ) -> Self {
2430 Self(RequestBuilder::new(stub))
2431 }
2432
2433 pub fn with_request<V: Into<crate::model::GetOrganizationIntelligenceConfigRequest>>(
2435 mut self,
2436 v: V,
2437 ) -> Self {
2438 self.0.request = v.into();
2439 self
2440 }
2441
2442 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2444 self.0.options = v.into();
2445 self
2446 }
2447
2448 pub async fn send(self) -> Result<crate::model::IntelligenceConfig> {
2450 (*self.0.stub)
2451 .get_organization_intelligence_config(self.0.request, self.0.options)
2452 .await
2453 .map(gax::response::Response::into_body)
2454 }
2455
2456 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2460 self.0.request.name = v.into();
2461 self
2462 }
2463 }
2464
2465 #[doc(hidden)]
2466 impl gax::options::internal::RequestBuilder for GetOrganizationIntelligenceConfig {
2467 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2468 &mut self.0.options
2469 }
2470 }
2471
2472 #[derive(Clone, Debug)]
2490 pub struct UpdateOrganizationIntelligenceConfig(
2491 RequestBuilder<crate::model::UpdateOrganizationIntelligenceConfigRequest>,
2492 );
2493
2494 impl UpdateOrganizationIntelligenceConfig {
2495 pub(crate) fn new(
2496 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2497 ) -> Self {
2498 Self(RequestBuilder::new(stub))
2499 }
2500
2501 pub fn with_request<V: Into<crate::model::UpdateOrganizationIntelligenceConfigRequest>>(
2503 mut self,
2504 v: V,
2505 ) -> Self {
2506 self.0.request = v.into();
2507 self
2508 }
2509
2510 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2512 self.0.options = v.into();
2513 self
2514 }
2515
2516 pub async fn send(self) -> Result<crate::model::IntelligenceConfig> {
2518 (*self.0.stub)
2519 .update_organization_intelligence_config(self.0.request, self.0.options)
2520 .await
2521 .map(gax::response::Response::into_body)
2522 }
2523
2524 pub fn set_intelligence_config<T>(mut self, v: T) -> Self
2528 where
2529 T: std::convert::Into<crate::model::IntelligenceConfig>,
2530 {
2531 self.0.request.intelligence_config = std::option::Option::Some(v.into());
2532 self
2533 }
2534
2535 pub fn set_or_clear_intelligence_config<T>(mut self, v: std::option::Option<T>) -> Self
2539 where
2540 T: std::convert::Into<crate::model::IntelligenceConfig>,
2541 {
2542 self.0.request.intelligence_config = v.map(|x| x.into());
2543 self
2544 }
2545
2546 pub fn set_update_mask<T>(mut self, v: T) -> Self
2550 where
2551 T: std::convert::Into<wkt::FieldMask>,
2552 {
2553 self.0.request.update_mask = std::option::Option::Some(v.into());
2554 self
2555 }
2556
2557 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2561 where
2562 T: std::convert::Into<wkt::FieldMask>,
2563 {
2564 self.0.request.update_mask = v.map(|x| x.into());
2565 self
2566 }
2567
2568 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2570 self.0.request.request_id = v.into();
2571 self
2572 }
2573 }
2574
2575 #[doc(hidden)]
2576 impl gax::options::internal::RequestBuilder for UpdateOrganizationIntelligenceConfig {
2577 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2578 &mut self.0.options
2579 }
2580 }
2581
2582 #[derive(Clone, Debug)]
2600 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
2601
2602 impl GetIamPolicy {
2603 pub(crate) fn new(
2604 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2605 ) -> Self {
2606 Self(RequestBuilder::new(stub))
2607 }
2608
2609 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
2611 self.0.request = v.into();
2612 self
2613 }
2614
2615 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2617 self.0.options = v.into();
2618 self
2619 }
2620
2621 pub async fn send(self) -> Result<iam_v1::model::Policy> {
2623 (*self.0.stub)
2624 .get_iam_policy(self.0.request, self.0.options)
2625 .await
2626 .map(gax::response::Response::into_body)
2627 }
2628
2629 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2633 self.0.request.resource = v.into();
2634 self
2635 }
2636
2637 pub fn set_options<T>(mut self, v: T) -> Self
2639 where
2640 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
2641 {
2642 self.0.request.options = std::option::Option::Some(v.into());
2643 self
2644 }
2645
2646 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
2648 where
2649 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
2650 {
2651 self.0.request.options = v.map(|x| x.into());
2652 self
2653 }
2654 }
2655
2656 #[doc(hidden)]
2657 impl gax::options::internal::RequestBuilder for GetIamPolicy {
2658 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2659 &mut self.0.options
2660 }
2661 }
2662
2663 #[derive(Clone, Debug)]
2681 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
2682
2683 impl SetIamPolicy {
2684 pub(crate) fn new(
2685 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2686 ) -> Self {
2687 Self(RequestBuilder::new(stub))
2688 }
2689
2690 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
2692 self.0.request = v.into();
2693 self
2694 }
2695
2696 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2698 self.0.options = v.into();
2699 self
2700 }
2701
2702 pub async fn send(self) -> Result<iam_v1::model::Policy> {
2704 (*self.0.stub)
2705 .set_iam_policy(self.0.request, self.0.options)
2706 .await
2707 .map(gax::response::Response::into_body)
2708 }
2709
2710 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2714 self.0.request.resource = v.into();
2715 self
2716 }
2717
2718 pub fn set_policy<T>(mut self, v: T) -> Self
2722 where
2723 T: std::convert::Into<iam_v1::model::Policy>,
2724 {
2725 self.0.request.policy = std::option::Option::Some(v.into());
2726 self
2727 }
2728
2729 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
2733 where
2734 T: std::convert::Into<iam_v1::model::Policy>,
2735 {
2736 self.0.request.policy = v.map(|x| x.into());
2737 self
2738 }
2739
2740 pub fn set_update_mask<T>(mut self, v: T) -> Self
2742 where
2743 T: std::convert::Into<wkt::FieldMask>,
2744 {
2745 self.0.request.update_mask = std::option::Option::Some(v.into());
2746 self
2747 }
2748
2749 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2751 where
2752 T: std::convert::Into<wkt::FieldMask>,
2753 {
2754 self.0.request.update_mask = v.map(|x| x.into());
2755 self
2756 }
2757 }
2758
2759 #[doc(hidden)]
2760 impl gax::options::internal::RequestBuilder for SetIamPolicy {
2761 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2762 &mut self.0.options
2763 }
2764 }
2765
2766 #[derive(Clone, Debug)]
2784 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
2785
2786 impl TestIamPermissions {
2787 pub(crate) fn new(
2788 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2789 ) -> Self {
2790 Self(RequestBuilder::new(stub))
2791 }
2792
2793 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
2795 mut self,
2796 v: V,
2797 ) -> Self {
2798 self.0.request = v.into();
2799 self
2800 }
2801
2802 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2804 self.0.options = v.into();
2805 self
2806 }
2807
2808 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
2810 (*self.0.stub)
2811 .test_iam_permissions(self.0.request, self.0.options)
2812 .await
2813 .map(gax::response::Response::into_body)
2814 }
2815
2816 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2820 self.0.request.resource = v.into();
2821 self
2822 }
2823
2824 pub fn set_permissions<T, V>(mut self, v: T) -> Self
2828 where
2829 T: std::iter::IntoIterator<Item = V>,
2830 V: std::convert::Into<std::string::String>,
2831 {
2832 use std::iter::Iterator;
2833 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
2834 self
2835 }
2836 }
2837
2838 #[doc(hidden)]
2839 impl gax::options::internal::RequestBuilder for TestIamPermissions {
2840 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2841 &mut self.0.options
2842 }
2843 }
2844
2845 #[derive(Clone, Debug)]
2863 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
2864
2865 impl GetOperation {
2866 pub(crate) fn new(
2867 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2868 ) -> Self {
2869 Self(RequestBuilder::new(stub))
2870 }
2871
2872 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
2874 mut self,
2875 v: V,
2876 ) -> Self {
2877 self.0.request = v.into();
2878 self
2879 }
2880
2881 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2883 self.0.options = v.into();
2884 self
2885 }
2886
2887 pub async fn send(self) -> Result<longrunning::model::Operation> {
2889 (*self.0.stub)
2890 .get_operation(self.0.request, self.0.options)
2891 .await
2892 .map(gax::response::Response::into_body)
2893 }
2894
2895 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2897 self.0.request.name = v.into();
2898 self
2899 }
2900 }
2901
2902 #[doc(hidden)]
2903 impl gax::options::internal::RequestBuilder for GetOperation {
2904 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2905 &mut self.0.options
2906 }
2907 }
2908}