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 DeleteBucket(RequestBuilder<crate::model::DeleteBucketRequest>);
62
63 impl DeleteBucket {
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::DeleteBucketRequest>>(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<()> {
84 (*self.0.stub)
85 .delete_bucket(self.0.request, self.0.options)
86 .await
87 .map(gax::response::Response::into_body)
88 }
89
90 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
94 self.0.request.name = v.into();
95 self
96 }
97
98 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
100 where
101 T: std::convert::Into<i64>,
102 {
103 self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
104 self
105 }
106
107 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
109 where
110 T: std::convert::Into<i64>,
111 {
112 self.0.request.if_metageneration_match = v.map(|x| x.into());
113 self
114 }
115
116 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
118 where
119 T: std::convert::Into<i64>,
120 {
121 self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
122 self
123 }
124
125 pub fn set_or_clear_if_metageneration_not_match<T>(
127 mut self,
128 v: std::option::Option<T>,
129 ) -> Self
130 where
131 T: std::convert::Into<i64>,
132 {
133 self.0.request.if_metageneration_not_match = v.map(|x| x.into());
134 self
135 }
136 }
137
138 #[doc(hidden)]
139 impl gax::options::internal::RequestBuilder for DeleteBucket {
140 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
141 &mut self.0.options
142 }
143 }
144
145 #[derive(Clone, Debug)]
163 pub struct GetBucket(RequestBuilder<crate::model::GetBucketRequest>);
164
165 impl GetBucket {
166 pub(crate) fn new(
167 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
168 ) -> Self {
169 Self(RequestBuilder::new(stub))
170 }
171
172 pub fn with_request<V: Into<crate::model::GetBucketRequest>>(mut self, v: V) -> Self {
174 self.0.request = v.into();
175 self
176 }
177
178 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
180 self.0.options = v.into();
181 self
182 }
183
184 pub async fn send(self) -> Result<crate::model::Bucket> {
186 (*self.0.stub)
187 .get_bucket(self.0.request, self.0.options)
188 .await
189 .map(gax::response::Response::into_body)
190 }
191
192 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
196 self.0.request.name = v.into();
197 self
198 }
199
200 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
202 where
203 T: std::convert::Into<i64>,
204 {
205 self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
206 self
207 }
208
209 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
211 where
212 T: std::convert::Into<i64>,
213 {
214 self.0.request.if_metageneration_match = v.map(|x| x.into());
215 self
216 }
217
218 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
220 where
221 T: std::convert::Into<i64>,
222 {
223 self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
224 self
225 }
226
227 pub fn set_or_clear_if_metageneration_not_match<T>(
229 mut self,
230 v: std::option::Option<T>,
231 ) -> Self
232 where
233 T: std::convert::Into<i64>,
234 {
235 self.0.request.if_metageneration_not_match = v.map(|x| x.into());
236 self
237 }
238
239 pub fn set_read_mask<T>(mut self, v: T) -> Self
241 where
242 T: std::convert::Into<wkt::FieldMask>,
243 {
244 self.0.request.read_mask = std::option::Option::Some(v.into());
245 self
246 }
247
248 pub fn set_or_clear_read_mask<T>(mut self, v: std::option::Option<T>) -> Self
250 where
251 T: std::convert::Into<wkt::FieldMask>,
252 {
253 self.0.request.read_mask = v.map(|x| x.into());
254 self
255 }
256 }
257
258 #[doc(hidden)]
259 impl gax::options::internal::RequestBuilder for GetBucket {
260 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
261 &mut self.0.options
262 }
263 }
264
265 #[derive(Clone, Debug)]
283 pub struct CreateBucket(RequestBuilder<crate::model::CreateBucketRequest>);
284
285 impl CreateBucket {
286 pub(crate) fn new(
287 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
288 ) -> Self {
289 Self(RequestBuilder::new(stub))
290 }
291
292 pub fn with_request<V: Into<crate::model::CreateBucketRequest>>(mut self, v: V) -> Self {
294 self.0.request = v.into();
295 self
296 }
297
298 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
300 self.0.options = v.into();
301 self
302 }
303
304 pub async fn send(self) -> Result<crate::model::Bucket> {
306 (*self.0.stub)
307 .create_bucket(self.0.request, self.0.options)
308 .await
309 .map(gax::response::Response::into_body)
310 }
311
312 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
316 self.0.request.parent = v.into();
317 self
318 }
319
320 pub fn set_bucket<T>(mut self, v: T) -> Self
322 where
323 T: std::convert::Into<crate::model::Bucket>,
324 {
325 self.0.request.bucket = std::option::Option::Some(v.into());
326 self
327 }
328
329 pub fn set_or_clear_bucket<T>(mut self, v: std::option::Option<T>) -> Self
331 where
332 T: std::convert::Into<crate::model::Bucket>,
333 {
334 self.0.request.bucket = v.map(|x| x.into());
335 self
336 }
337
338 pub fn set_bucket_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
342 self.0.request.bucket_id = v.into();
343 self
344 }
345
346 pub fn set_predefined_acl<T: Into<std::string::String>>(mut self, v: T) -> Self {
348 self.0.request.predefined_acl = v.into();
349 self
350 }
351
352 pub fn set_predefined_default_object_acl<T: Into<std::string::String>>(
354 mut self,
355 v: T,
356 ) -> Self {
357 self.0.request.predefined_default_object_acl = v.into();
358 self
359 }
360
361 pub fn set_enable_object_retention<T: Into<bool>>(mut self, v: T) -> Self {
363 self.0.request.enable_object_retention = v.into();
364 self
365 }
366 }
367
368 #[doc(hidden)]
369 impl gax::options::internal::RequestBuilder for CreateBucket {
370 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
371 &mut self.0.options
372 }
373 }
374
375 #[derive(Clone, Debug)]
397 pub struct ListBuckets(RequestBuilder<crate::model::ListBucketsRequest>);
398
399 impl ListBuckets {
400 pub(crate) fn new(
401 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
402 ) -> Self {
403 Self(RequestBuilder::new(stub))
404 }
405
406 pub fn with_request<V: Into<crate::model::ListBucketsRequest>>(mut self, v: V) -> Self {
408 self.0.request = v.into();
409 self
410 }
411
412 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
414 self.0.options = v.into();
415 self
416 }
417
418 pub async fn send(self) -> Result<crate::model::ListBucketsResponse> {
420 (*self.0.stub)
421 .list_buckets(self.0.request, self.0.options)
422 .await
423 .map(gax::response::Response::into_body)
424 }
425
426 pub fn by_page(
428 self,
429 ) -> impl gax::paginator::Paginator<crate::model::ListBucketsResponse, gax::error::Error>
430 {
431 use std::clone::Clone;
432 let token = self.0.request.page_token.clone();
433 let execute = move |token: String| {
434 let mut builder = self.clone();
435 builder.0.request = builder.0.request.set_page_token(token);
436 builder.send()
437 };
438 gax::paginator::internal::new_paginator(token, execute)
439 }
440
441 pub fn by_item(
443 self,
444 ) -> impl gax::paginator::ItemPaginator<crate::model::ListBucketsResponse, gax::error::Error>
445 {
446 use gax::paginator::Paginator;
447 self.by_page().items()
448 }
449
450 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
454 self.0.request.parent = v.into();
455 self
456 }
457
458 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
460 self.0.request.page_size = v.into();
461 self
462 }
463
464 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
466 self.0.request.page_token = v.into();
467 self
468 }
469
470 pub fn set_prefix<T: Into<std::string::String>>(mut self, v: T) -> Self {
472 self.0.request.prefix = v.into();
473 self
474 }
475
476 pub fn set_read_mask<T>(mut self, v: T) -> Self
478 where
479 T: std::convert::Into<wkt::FieldMask>,
480 {
481 self.0.request.read_mask = std::option::Option::Some(v.into());
482 self
483 }
484
485 pub fn set_or_clear_read_mask<T>(mut self, v: std::option::Option<T>) -> Self
487 where
488 T: std::convert::Into<wkt::FieldMask>,
489 {
490 self.0.request.read_mask = v.map(|x| x.into());
491 self
492 }
493 }
494
495 #[doc(hidden)]
496 impl gax::options::internal::RequestBuilder for ListBuckets {
497 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
498 &mut self.0.options
499 }
500 }
501
502 #[derive(Clone, Debug)]
520 pub struct LockBucketRetentionPolicy(
521 RequestBuilder<crate::model::LockBucketRetentionPolicyRequest>,
522 );
523
524 impl LockBucketRetentionPolicy {
525 pub(crate) fn new(
526 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
527 ) -> Self {
528 Self(RequestBuilder::new(stub))
529 }
530
531 pub fn with_request<V: Into<crate::model::LockBucketRetentionPolicyRequest>>(
533 mut self,
534 v: V,
535 ) -> Self {
536 self.0.request = v.into();
537 self
538 }
539
540 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
542 self.0.options = v.into();
543 self
544 }
545
546 pub async fn send(self) -> Result<crate::model::Bucket> {
548 (*self.0.stub)
549 .lock_bucket_retention_policy(self.0.request, self.0.options)
550 .await
551 .map(gax::response::Response::into_body)
552 }
553
554 pub fn set_bucket<T: Into<std::string::String>>(mut self, v: T) -> Self {
558 self.0.request.bucket = v.into();
559 self
560 }
561
562 pub fn set_if_metageneration_match<T: Into<i64>>(mut self, v: T) -> Self {
566 self.0.request.if_metageneration_match = v.into();
567 self
568 }
569 }
570
571 #[doc(hidden)]
572 impl gax::options::internal::RequestBuilder for LockBucketRetentionPolicy {
573 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
574 &mut self.0.options
575 }
576 }
577
578 #[derive(Clone, Debug)]
596 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
597
598 impl GetIamPolicy {
599 pub(crate) fn new(
600 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
601 ) -> Self {
602 Self(RequestBuilder::new(stub))
603 }
604
605 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
607 self.0.request = v.into();
608 self
609 }
610
611 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
613 self.0.options = v.into();
614 self
615 }
616
617 pub async fn send(self) -> Result<iam_v1::model::Policy> {
619 (*self.0.stub)
620 .get_iam_policy(self.0.request, self.0.options)
621 .await
622 .map(gax::response::Response::into_body)
623 }
624
625 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
629 self.0.request.resource = v.into();
630 self
631 }
632
633 pub fn set_options<T>(mut self, v: T) -> Self
635 where
636 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
637 {
638 self.0.request.options = std::option::Option::Some(v.into());
639 self
640 }
641
642 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
644 where
645 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
646 {
647 self.0.request.options = v.map(|x| x.into());
648 self
649 }
650 }
651
652 #[doc(hidden)]
653 impl gax::options::internal::RequestBuilder for GetIamPolicy {
654 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
655 &mut self.0.options
656 }
657 }
658
659 #[derive(Clone, Debug)]
677 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
678
679 impl SetIamPolicy {
680 pub(crate) fn new(
681 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
682 ) -> Self {
683 Self(RequestBuilder::new(stub))
684 }
685
686 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
688 self.0.request = v.into();
689 self
690 }
691
692 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
694 self.0.options = v.into();
695 self
696 }
697
698 pub async fn send(self) -> Result<iam_v1::model::Policy> {
700 (*self.0.stub)
701 .set_iam_policy(self.0.request, self.0.options)
702 .await
703 .map(gax::response::Response::into_body)
704 }
705
706 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
710 self.0.request.resource = v.into();
711 self
712 }
713
714 pub fn set_policy<T>(mut self, v: T) -> Self
718 where
719 T: std::convert::Into<iam_v1::model::Policy>,
720 {
721 self.0.request.policy = std::option::Option::Some(v.into());
722 self
723 }
724
725 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
729 where
730 T: std::convert::Into<iam_v1::model::Policy>,
731 {
732 self.0.request.policy = v.map(|x| x.into());
733 self
734 }
735
736 pub fn set_update_mask<T>(mut self, v: T) -> Self
738 where
739 T: std::convert::Into<wkt::FieldMask>,
740 {
741 self.0.request.update_mask = std::option::Option::Some(v.into());
742 self
743 }
744
745 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
747 where
748 T: std::convert::Into<wkt::FieldMask>,
749 {
750 self.0.request.update_mask = v.map(|x| x.into());
751 self
752 }
753 }
754
755 #[doc(hidden)]
756 impl gax::options::internal::RequestBuilder for SetIamPolicy {
757 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
758 &mut self.0.options
759 }
760 }
761
762 #[derive(Clone, Debug)]
780 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
781
782 impl TestIamPermissions {
783 pub(crate) fn new(
784 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
785 ) -> Self {
786 Self(RequestBuilder::new(stub))
787 }
788
789 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
791 mut self,
792 v: V,
793 ) -> Self {
794 self.0.request = v.into();
795 self
796 }
797
798 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
800 self.0.options = v.into();
801 self
802 }
803
804 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
806 (*self.0.stub)
807 .test_iam_permissions(self.0.request, self.0.options)
808 .await
809 .map(gax::response::Response::into_body)
810 }
811
812 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
816 self.0.request.resource = v.into();
817 self
818 }
819
820 pub fn set_permissions<T, V>(mut self, v: T) -> Self
824 where
825 T: std::iter::IntoIterator<Item = V>,
826 V: std::convert::Into<std::string::String>,
827 {
828 use std::iter::Iterator;
829 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
830 self
831 }
832 }
833
834 #[doc(hidden)]
835 impl gax::options::internal::RequestBuilder for TestIamPermissions {
836 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
837 &mut self.0.options
838 }
839 }
840
841 #[derive(Clone, Debug)]
859 pub struct UpdateBucket(RequestBuilder<crate::model::UpdateBucketRequest>);
860
861 impl UpdateBucket {
862 pub(crate) fn new(
863 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
864 ) -> Self {
865 Self(RequestBuilder::new(stub))
866 }
867
868 pub fn with_request<V: Into<crate::model::UpdateBucketRequest>>(mut self, v: V) -> Self {
870 self.0.request = v.into();
871 self
872 }
873
874 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
876 self.0.options = v.into();
877 self
878 }
879
880 pub async fn send(self) -> Result<crate::model::Bucket> {
882 (*self.0.stub)
883 .update_bucket(self.0.request, self.0.options)
884 .await
885 .map(gax::response::Response::into_body)
886 }
887
888 pub fn set_bucket<T>(mut self, v: T) -> Self
892 where
893 T: std::convert::Into<crate::model::Bucket>,
894 {
895 self.0.request.bucket = std::option::Option::Some(v.into());
896 self
897 }
898
899 pub fn set_or_clear_bucket<T>(mut self, v: std::option::Option<T>) -> Self
903 where
904 T: std::convert::Into<crate::model::Bucket>,
905 {
906 self.0.request.bucket = v.map(|x| x.into());
907 self
908 }
909
910 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
912 where
913 T: std::convert::Into<i64>,
914 {
915 self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
916 self
917 }
918
919 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
921 where
922 T: std::convert::Into<i64>,
923 {
924 self.0.request.if_metageneration_match = v.map(|x| x.into());
925 self
926 }
927
928 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
930 where
931 T: std::convert::Into<i64>,
932 {
933 self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
934 self
935 }
936
937 pub fn set_or_clear_if_metageneration_not_match<T>(
939 mut self,
940 v: std::option::Option<T>,
941 ) -> Self
942 where
943 T: std::convert::Into<i64>,
944 {
945 self.0.request.if_metageneration_not_match = v.map(|x| x.into());
946 self
947 }
948
949 pub fn set_predefined_acl<T: Into<std::string::String>>(mut self, v: T) -> Self {
951 self.0.request.predefined_acl = v.into();
952 self
953 }
954
955 pub fn set_predefined_default_object_acl<T: Into<std::string::String>>(
957 mut self,
958 v: T,
959 ) -> Self {
960 self.0.request.predefined_default_object_acl = v.into();
961 self
962 }
963
964 pub fn set_update_mask<T>(mut self, v: T) -> Self
968 where
969 T: std::convert::Into<wkt::FieldMask>,
970 {
971 self.0.request.update_mask = std::option::Option::Some(v.into());
972 self
973 }
974
975 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
979 where
980 T: std::convert::Into<wkt::FieldMask>,
981 {
982 self.0.request.update_mask = v.map(|x| x.into());
983 self
984 }
985 }
986
987 #[doc(hidden)]
988 impl gax::options::internal::RequestBuilder for UpdateBucket {
989 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
990 &mut self.0.options
991 }
992 }
993
994 #[derive(Clone, Debug)]
1012 pub struct ComposeObject(RequestBuilder<crate::model::ComposeObjectRequest>);
1013
1014 impl ComposeObject {
1015 pub(crate) fn new(
1016 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1017 ) -> Self {
1018 Self(RequestBuilder::new(stub))
1019 }
1020
1021 pub fn with_request<V: Into<crate::model::ComposeObjectRequest>>(mut self, v: V) -> Self {
1023 self.0.request = v.into();
1024 self
1025 }
1026
1027 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1029 self.0.options = v.into();
1030 self
1031 }
1032
1033 pub async fn send(self) -> Result<crate::model::Object> {
1035 (*self.0.stub)
1036 .compose_object(self.0.request, self.0.options)
1037 .await
1038 .map(gax::response::Response::into_body)
1039 }
1040
1041 pub fn set_destination<T>(mut self, v: T) -> Self
1045 where
1046 T: std::convert::Into<crate::model::Object>,
1047 {
1048 self.0.request.destination = std::option::Option::Some(v.into());
1049 self
1050 }
1051
1052 pub fn set_or_clear_destination<T>(mut self, v: std::option::Option<T>) -> Self
1056 where
1057 T: std::convert::Into<crate::model::Object>,
1058 {
1059 self.0.request.destination = v.map(|x| x.into());
1060 self
1061 }
1062
1063 pub fn set_source_objects<T, V>(mut self, v: T) -> Self
1065 where
1066 T: std::iter::IntoIterator<Item = V>,
1067 V: std::convert::Into<crate::model::compose_object_request::SourceObject>,
1068 {
1069 use std::iter::Iterator;
1070 self.0.request.source_objects = v.into_iter().map(|i| i.into()).collect();
1071 self
1072 }
1073
1074 pub fn set_destination_predefined_acl<T: Into<std::string::String>>(
1076 mut self,
1077 v: T,
1078 ) -> Self {
1079 self.0.request.destination_predefined_acl = v.into();
1080 self
1081 }
1082
1083 pub fn set_if_generation_match<T>(mut self, v: T) -> Self
1085 where
1086 T: std::convert::Into<i64>,
1087 {
1088 self.0.request.if_generation_match = std::option::Option::Some(v.into());
1089 self
1090 }
1091
1092 pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
1094 where
1095 T: std::convert::Into<i64>,
1096 {
1097 self.0.request.if_generation_match = v.map(|x| x.into());
1098 self
1099 }
1100
1101 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
1103 where
1104 T: std::convert::Into<i64>,
1105 {
1106 self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
1107 self
1108 }
1109
1110 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
1112 where
1113 T: std::convert::Into<i64>,
1114 {
1115 self.0.request.if_metageneration_match = v.map(|x| x.into());
1116 self
1117 }
1118
1119 pub fn set_kms_key<T: Into<std::string::String>>(mut self, v: T) -> Self {
1121 self.0.request.kms_key = v.into();
1122 self
1123 }
1124
1125 pub fn set_common_object_request_params<T>(mut self, v: T) -> Self
1127 where
1128 T: std::convert::Into<crate::model::CommonObjectRequestParams>,
1129 {
1130 self.0.request.common_object_request_params = std::option::Option::Some(v.into());
1131 self
1132 }
1133
1134 pub fn set_or_clear_common_object_request_params<T>(
1136 mut self,
1137 v: std::option::Option<T>,
1138 ) -> Self
1139 where
1140 T: std::convert::Into<crate::model::CommonObjectRequestParams>,
1141 {
1142 self.0.request.common_object_request_params = v.map(|x| x.into());
1143 self
1144 }
1145
1146 pub fn set_object_checksums<T>(mut self, v: T) -> Self
1148 where
1149 T: std::convert::Into<crate::model::ObjectChecksums>,
1150 {
1151 self.0.request.object_checksums = std::option::Option::Some(v.into());
1152 self
1153 }
1154
1155 pub fn set_or_clear_object_checksums<T>(mut self, v: std::option::Option<T>) -> Self
1157 where
1158 T: std::convert::Into<crate::model::ObjectChecksums>,
1159 {
1160 self.0.request.object_checksums = v.map(|x| x.into());
1161 self
1162 }
1163 }
1164
1165 #[doc(hidden)]
1166 impl gax::options::internal::RequestBuilder for ComposeObject {
1167 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1168 &mut self.0.options
1169 }
1170 }
1171
1172 #[derive(Clone, Debug)]
1190 pub struct DeleteObject(RequestBuilder<crate::model::DeleteObjectRequest>);
1191
1192 impl DeleteObject {
1193 pub(crate) fn new(
1194 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1195 ) -> Self {
1196 Self(RequestBuilder::new(stub))
1197 }
1198
1199 pub fn with_request<V: Into<crate::model::DeleteObjectRequest>>(mut self, v: V) -> Self {
1201 self.0.request = v.into();
1202 self
1203 }
1204
1205 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1207 self.0.options = v.into();
1208 self
1209 }
1210
1211 pub async fn send(self) -> Result<()> {
1213 (*self.0.stub)
1214 .delete_object(self.0.request, self.0.options)
1215 .await
1216 .map(gax::response::Response::into_body)
1217 }
1218
1219 pub fn set_bucket<T: Into<std::string::String>>(mut self, v: T) -> Self {
1223 self.0.request.bucket = v.into();
1224 self
1225 }
1226
1227 pub fn set_object<T: Into<std::string::String>>(mut self, v: T) -> Self {
1231 self.0.request.object = v.into();
1232 self
1233 }
1234
1235 pub fn set_generation<T: Into<i64>>(mut self, v: T) -> Self {
1237 self.0.request.generation = v.into();
1238 self
1239 }
1240
1241 pub fn set_if_generation_match<T>(mut self, v: T) -> Self
1243 where
1244 T: std::convert::Into<i64>,
1245 {
1246 self.0.request.if_generation_match = std::option::Option::Some(v.into());
1247 self
1248 }
1249
1250 pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
1252 where
1253 T: std::convert::Into<i64>,
1254 {
1255 self.0.request.if_generation_match = v.map(|x| x.into());
1256 self
1257 }
1258
1259 pub fn set_if_generation_not_match<T>(mut self, v: T) -> Self
1261 where
1262 T: std::convert::Into<i64>,
1263 {
1264 self.0.request.if_generation_not_match = std::option::Option::Some(v.into());
1265 self
1266 }
1267
1268 pub fn set_or_clear_if_generation_not_match<T>(mut self, v: std::option::Option<T>) -> Self
1270 where
1271 T: std::convert::Into<i64>,
1272 {
1273 self.0.request.if_generation_not_match = v.map(|x| x.into());
1274 self
1275 }
1276
1277 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
1279 where
1280 T: std::convert::Into<i64>,
1281 {
1282 self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
1283 self
1284 }
1285
1286 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
1288 where
1289 T: std::convert::Into<i64>,
1290 {
1291 self.0.request.if_metageneration_match = v.map(|x| x.into());
1292 self
1293 }
1294
1295 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
1297 where
1298 T: std::convert::Into<i64>,
1299 {
1300 self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
1301 self
1302 }
1303
1304 pub fn set_or_clear_if_metageneration_not_match<T>(
1306 mut self,
1307 v: std::option::Option<T>,
1308 ) -> Self
1309 where
1310 T: std::convert::Into<i64>,
1311 {
1312 self.0.request.if_metageneration_not_match = v.map(|x| x.into());
1313 self
1314 }
1315
1316 pub fn set_common_object_request_params<T>(mut self, v: T) -> Self
1318 where
1319 T: std::convert::Into<crate::model::CommonObjectRequestParams>,
1320 {
1321 self.0.request.common_object_request_params = std::option::Option::Some(v.into());
1322 self
1323 }
1324
1325 pub fn set_or_clear_common_object_request_params<T>(
1327 mut self,
1328 v: std::option::Option<T>,
1329 ) -> Self
1330 where
1331 T: std::convert::Into<crate::model::CommonObjectRequestParams>,
1332 {
1333 self.0.request.common_object_request_params = v.map(|x| x.into());
1334 self
1335 }
1336 }
1337
1338 #[doc(hidden)]
1339 impl gax::options::internal::RequestBuilder for DeleteObject {
1340 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1341 &mut self.0.options
1342 }
1343 }
1344
1345 #[derive(Clone, Debug)]
1363 pub struct RestoreObject(RequestBuilder<crate::model::RestoreObjectRequest>);
1364
1365 impl RestoreObject {
1366 pub(crate) fn new(
1367 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1368 ) -> Self {
1369 Self(RequestBuilder::new(stub))
1370 }
1371
1372 pub fn with_request<V: Into<crate::model::RestoreObjectRequest>>(mut self, v: V) -> Self {
1374 self.0.request = v.into();
1375 self
1376 }
1377
1378 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1380 self.0.options = v.into();
1381 self
1382 }
1383
1384 pub async fn send(self) -> Result<crate::model::Object> {
1386 (*self.0.stub)
1387 .restore_object(self.0.request, self.0.options)
1388 .await
1389 .map(gax::response::Response::into_body)
1390 }
1391
1392 pub fn set_bucket<T: Into<std::string::String>>(mut self, v: T) -> Self {
1396 self.0.request.bucket = v.into();
1397 self
1398 }
1399
1400 pub fn set_object<T: Into<std::string::String>>(mut self, v: T) -> Self {
1404 self.0.request.object = v.into();
1405 self
1406 }
1407
1408 pub fn set_generation<T: Into<i64>>(mut self, v: T) -> Self {
1412 self.0.request.generation = v.into();
1413 self
1414 }
1415
1416 pub fn set_restore_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1418 self.0.request.restore_token = v.into();
1419 self
1420 }
1421
1422 pub fn set_if_generation_match<T>(mut self, v: T) -> Self
1424 where
1425 T: std::convert::Into<i64>,
1426 {
1427 self.0.request.if_generation_match = std::option::Option::Some(v.into());
1428 self
1429 }
1430
1431 pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
1433 where
1434 T: std::convert::Into<i64>,
1435 {
1436 self.0.request.if_generation_match = v.map(|x| x.into());
1437 self
1438 }
1439
1440 pub fn set_if_generation_not_match<T>(mut self, v: T) -> Self
1442 where
1443 T: std::convert::Into<i64>,
1444 {
1445 self.0.request.if_generation_not_match = std::option::Option::Some(v.into());
1446 self
1447 }
1448
1449 pub fn set_or_clear_if_generation_not_match<T>(mut self, v: std::option::Option<T>) -> Self
1451 where
1452 T: std::convert::Into<i64>,
1453 {
1454 self.0.request.if_generation_not_match = v.map(|x| x.into());
1455 self
1456 }
1457
1458 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
1460 where
1461 T: std::convert::Into<i64>,
1462 {
1463 self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
1464 self
1465 }
1466
1467 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
1469 where
1470 T: std::convert::Into<i64>,
1471 {
1472 self.0.request.if_metageneration_match = v.map(|x| x.into());
1473 self
1474 }
1475
1476 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
1478 where
1479 T: std::convert::Into<i64>,
1480 {
1481 self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
1482 self
1483 }
1484
1485 pub fn set_or_clear_if_metageneration_not_match<T>(
1487 mut self,
1488 v: std::option::Option<T>,
1489 ) -> Self
1490 where
1491 T: std::convert::Into<i64>,
1492 {
1493 self.0.request.if_metageneration_not_match = v.map(|x| x.into());
1494 self
1495 }
1496
1497 pub fn set_copy_source_acl<T>(mut self, v: T) -> Self
1499 where
1500 T: std::convert::Into<bool>,
1501 {
1502 self.0.request.copy_source_acl = std::option::Option::Some(v.into());
1503 self
1504 }
1505
1506 pub fn set_or_clear_copy_source_acl<T>(mut self, v: std::option::Option<T>) -> Self
1508 where
1509 T: std::convert::Into<bool>,
1510 {
1511 self.0.request.copy_source_acl = v.map(|x| x.into());
1512 self
1513 }
1514
1515 pub fn set_common_object_request_params<T>(mut self, v: T) -> Self
1517 where
1518 T: std::convert::Into<crate::model::CommonObjectRequestParams>,
1519 {
1520 self.0.request.common_object_request_params = std::option::Option::Some(v.into());
1521 self
1522 }
1523
1524 pub fn set_or_clear_common_object_request_params<T>(
1526 mut self,
1527 v: std::option::Option<T>,
1528 ) -> Self
1529 where
1530 T: std::convert::Into<crate::model::CommonObjectRequestParams>,
1531 {
1532 self.0.request.common_object_request_params = v.map(|x| x.into());
1533 self
1534 }
1535 }
1536
1537 #[doc(hidden)]
1538 impl gax::options::internal::RequestBuilder for RestoreObject {
1539 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1540 &mut self.0.options
1541 }
1542 }
1543
1544 #[derive(Clone, Debug)]
1562 pub struct GetObject(RequestBuilder<crate::model::GetObjectRequest>);
1563
1564 impl GetObject {
1565 pub(crate) fn new(
1566 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1567 ) -> Self {
1568 Self(RequestBuilder::new(stub))
1569 }
1570
1571 pub fn with_request<V: Into<crate::model::GetObjectRequest>>(mut self, v: V) -> Self {
1573 self.0.request = v.into();
1574 self
1575 }
1576
1577 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1579 self.0.options = v.into();
1580 self
1581 }
1582
1583 pub async fn send(self) -> Result<crate::model::Object> {
1585 (*self.0.stub)
1586 .get_object(self.0.request, self.0.options)
1587 .await
1588 .map(gax::response::Response::into_body)
1589 }
1590
1591 pub fn set_bucket<T: Into<std::string::String>>(mut self, v: T) -> Self {
1595 self.0.request.bucket = v.into();
1596 self
1597 }
1598
1599 pub fn set_object<T: Into<std::string::String>>(mut self, v: T) -> Self {
1603 self.0.request.object = v.into();
1604 self
1605 }
1606
1607 pub fn set_generation<T: Into<i64>>(mut self, v: T) -> Self {
1609 self.0.request.generation = v.into();
1610 self
1611 }
1612
1613 pub fn set_soft_deleted<T>(mut self, v: T) -> Self
1615 where
1616 T: std::convert::Into<bool>,
1617 {
1618 self.0.request.soft_deleted = std::option::Option::Some(v.into());
1619 self
1620 }
1621
1622 pub fn set_or_clear_soft_deleted<T>(mut self, v: std::option::Option<T>) -> Self
1624 where
1625 T: std::convert::Into<bool>,
1626 {
1627 self.0.request.soft_deleted = v.map(|x| x.into());
1628 self
1629 }
1630
1631 pub fn set_if_generation_match<T>(mut self, v: T) -> Self
1633 where
1634 T: std::convert::Into<i64>,
1635 {
1636 self.0.request.if_generation_match = std::option::Option::Some(v.into());
1637 self
1638 }
1639
1640 pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
1642 where
1643 T: std::convert::Into<i64>,
1644 {
1645 self.0.request.if_generation_match = v.map(|x| x.into());
1646 self
1647 }
1648
1649 pub fn set_if_generation_not_match<T>(mut self, v: T) -> Self
1651 where
1652 T: std::convert::Into<i64>,
1653 {
1654 self.0.request.if_generation_not_match = std::option::Option::Some(v.into());
1655 self
1656 }
1657
1658 pub fn set_or_clear_if_generation_not_match<T>(mut self, v: std::option::Option<T>) -> Self
1660 where
1661 T: std::convert::Into<i64>,
1662 {
1663 self.0.request.if_generation_not_match = v.map(|x| x.into());
1664 self
1665 }
1666
1667 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
1669 where
1670 T: std::convert::Into<i64>,
1671 {
1672 self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
1673 self
1674 }
1675
1676 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
1678 where
1679 T: std::convert::Into<i64>,
1680 {
1681 self.0.request.if_metageneration_match = v.map(|x| x.into());
1682 self
1683 }
1684
1685 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
1687 where
1688 T: std::convert::Into<i64>,
1689 {
1690 self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
1691 self
1692 }
1693
1694 pub fn set_or_clear_if_metageneration_not_match<T>(
1696 mut self,
1697 v: std::option::Option<T>,
1698 ) -> Self
1699 where
1700 T: std::convert::Into<i64>,
1701 {
1702 self.0.request.if_metageneration_not_match = v.map(|x| x.into());
1703 self
1704 }
1705
1706 pub fn set_common_object_request_params<T>(mut self, v: T) -> Self
1708 where
1709 T: std::convert::Into<crate::model::CommonObjectRequestParams>,
1710 {
1711 self.0.request.common_object_request_params = std::option::Option::Some(v.into());
1712 self
1713 }
1714
1715 pub fn set_or_clear_common_object_request_params<T>(
1717 mut self,
1718 v: std::option::Option<T>,
1719 ) -> Self
1720 where
1721 T: std::convert::Into<crate::model::CommonObjectRequestParams>,
1722 {
1723 self.0.request.common_object_request_params = v.map(|x| x.into());
1724 self
1725 }
1726
1727 pub fn set_read_mask<T>(mut self, v: T) -> Self
1729 where
1730 T: std::convert::Into<wkt::FieldMask>,
1731 {
1732 self.0.request.read_mask = std::option::Option::Some(v.into());
1733 self
1734 }
1735
1736 pub fn set_or_clear_read_mask<T>(mut self, v: std::option::Option<T>) -> Self
1738 where
1739 T: std::convert::Into<wkt::FieldMask>,
1740 {
1741 self.0.request.read_mask = v.map(|x| x.into());
1742 self
1743 }
1744
1745 pub fn set_restore_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1747 self.0.request.restore_token = v.into();
1748 self
1749 }
1750 }
1751
1752 #[doc(hidden)]
1753 impl gax::options::internal::RequestBuilder for GetObject {
1754 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1755 &mut self.0.options
1756 }
1757 }
1758
1759 #[derive(Clone, Debug)]
1777 pub struct UpdateObject(RequestBuilder<crate::model::UpdateObjectRequest>);
1778
1779 impl UpdateObject {
1780 pub(crate) fn new(
1781 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1782 ) -> Self {
1783 Self(RequestBuilder::new(stub))
1784 }
1785
1786 pub fn with_request<V: Into<crate::model::UpdateObjectRequest>>(mut self, v: V) -> Self {
1788 self.0.request = v.into();
1789 self
1790 }
1791
1792 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1794 self.0.options = v.into();
1795 self
1796 }
1797
1798 pub async fn send(self) -> Result<crate::model::Object> {
1800 (*self.0.stub)
1801 .update_object(self.0.request, self.0.options)
1802 .await
1803 .map(gax::response::Response::into_body)
1804 }
1805
1806 pub fn set_object<T>(mut self, v: T) -> Self
1810 where
1811 T: std::convert::Into<crate::model::Object>,
1812 {
1813 self.0.request.object = std::option::Option::Some(v.into());
1814 self
1815 }
1816
1817 pub fn set_or_clear_object<T>(mut self, v: std::option::Option<T>) -> Self
1821 where
1822 T: std::convert::Into<crate::model::Object>,
1823 {
1824 self.0.request.object = v.map(|x| x.into());
1825 self
1826 }
1827
1828 pub fn set_if_generation_match<T>(mut self, v: T) -> Self
1830 where
1831 T: std::convert::Into<i64>,
1832 {
1833 self.0.request.if_generation_match = std::option::Option::Some(v.into());
1834 self
1835 }
1836
1837 pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
1839 where
1840 T: std::convert::Into<i64>,
1841 {
1842 self.0.request.if_generation_match = v.map(|x| x.into());
1843 self
1844 }
1845
1846 pub fn set_if_generation_not_match<T>(mut self, v: T) -> Self
1848 where
1849 T: std::convert::Into<i64>,
1850 {
1851 self.0.request.if_generation_not_match = std::option::Option::Some(v.into());
1852 self
1853 }
1854
1855 pub fn set_or_clear_if_generation_not_match<T>(mut self, v: std::option::Option<T>) -> Self
1857 where
1858 T: std::convert::Into<i64>,
1859 {
1860 self.0.request.if_generation_not_match = v.map(|x| x.into());
1861 self
1862 }
1863
1864 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
1866 where
1867 T: std::convert::Into<i64>,
1868 {
1869 self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
1870 self
1871 }
1872
1873 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
1875 where
1876 T: std::convert::Into<i64>,
1877 {
1878 self.0.request.if_metageneration_match = v.map(|x| x.into());
1879 self
1880 }
1881
1882 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
1884 where
1885 T: std::convert::Into<i64>,
1886 {
1887 self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
1888 self
1889 }
1890
1891 pub fn set_or_clear_if_metageneration_not_match<T>(
1893 mut self,
1894 v: std::option::Option<T>,
1895 ) -> Self
1896 where
1897 T: std::convert::Into<i64>,
1898 {
1899 self.0.request.if_metageneration_not_match = v.map(|x| x.into());
1900 self
1901 }
1902
1903 pub fn set_predefined_acl<T: Into<std::string::String>>(mut self, v: T) -> Self {
1905 self.0.request.predefined_acl = v.into();
1906 self
1907 }
1908
1909 pub fn set_update_mask<T>(mut self, v: T) -> Self
1913 where
1914 T: std::convert::Into<wkt::FieldMask>,
1915 {
1916 self.0.request.update_mask = std::option::Option::Some(v.into());
1917 self
1918 }
1919
1920 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1924 where
1925 T: std::convert::Into<wkt::FieldMask>,
1926 {
1927 self.0.request.update_mask = v.map(|x| x.into());
1928 self
1929 }
1930
1931 pub fn set_common_object_request_params<T>(mut self, v: T) -> Self
1933 where
1934 T: std::convert::Into<crate::model::CommonObjectRequestParams>,
1935 {
1936 self.0.request.common_object_request_params = std::option::Option::Some(v.into());
1937 self
1938 }
1939
1940 pub fn set_or_clear_common_object_request_params<T>(
1942 mut self,
1943 v: std::option::Option<T>,
1944 ) -> Self
1945 where
1946 T: std::convert::Into<crate::model::CommonObjectRequestParams>,
1947 {
1948 self.0.request.common_object_request_params = v.map(|x| x.into());
1949 self
1950 }
1951
1952 pub fn set_override_unlocked_retention<T: Into<bool>>(mut self, v: T) -> Self {
1954 self.0.request.override_unlocked_retention = v.into();
1955 self
1956 }
1957 }
1958
1959 #[doc(hidden)]
1960 impl gax::options::internal::RequestBuilder for UpdateObject {
1961 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1962 &mut self.0.options
1963 }
1964 }
1965
1966 #[derive(Clone, Debug)]
1988 pub struct ListObjects(RequestBuilder<crate::model::ListObjectsRequest>);
1989
1990 impl ListObjects {
1991 pub(crate) fn new(
1992 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1993 ) -> Self {
1994 Self(RequestBuilder::new(stub))
1995 }
1996
1997 pub fn with_request<V: Into<crate::model::ListObjectsRequest>>(mut self, v: V) -> Self {
1999 self.0.request = v.into();
2000 self
2001 }
2002
2003 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2005 self.0.options = v.into();
2006 self
2007 }
2008
2009 pub async fn send(self) -> Result<crate::model::ListObjectsResponse> {
2011 (*self.0.stub)
2012 .list_objects(self.0.request, self.0.options)
2013 .await
2014 .map(gax::response::Response::into_body)
2015 }
2016
2017 pub fn by_page(
2019 self,
2020 ) -> impl gax::paginator::Paginator<crate::model::ListObjectsResponse, gax::error::Error>
2021 {
2022 use std::clone::Clone;
2023 let token = self.0.request.page_token.clone();
2024 let execute = move |token: String| {
2025 let mut builder = self.clone();
2026 builder.0.request = builder.0.request.set_page_token(token);
2027 builder.send()
2028 };
2029 gax::paginator::internal::new_paginator(token, execute)
2030 }
2031
2032 pub fn by_item(
2034 self,
2035 ) -> impl gax::paginator::ItemPaginator<crate::model::ListObjectsResponse, gax::error::Error>
2036 {
2037 use gax::paginator::Paginator;
2038 self.by_page().items()
2039 }
2040
2041 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2045 self.0.request.parent = v.into();
2046 self
2047 }
2048
2049 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2051 self.0.request.page_size = v.into();
2052 self
2053 }
2054
2055 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2057 self.0.request.page_token = v.into();
2058 self
2059 }
2060
2061 pub fn set_delimiter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2063 self.0.request.delimiter = v.into();
2064 self
2065 }
2066
2067 pub fn set_include_trailing_delimiter<T: Into<bool>>(mut self, v: T) -> Self {
2069 self.0.request.include_trailing_delimiter = v.into();
2070 self
2071 }
2072
2073 pub fn set_prefix<T: Into<std::string::String>>(mut self, v: T) -> Self {
2075 self.0.request.prefix = v.into();
2076 self
2077 }
2078
2079 pub fn set_versions<T: Into<bool>>(mut self, v: T) -> Self {
2081 self.0.request.versions = v.into();
2082 self
2083 }
2084
2085 pub fn set_read_mask<T>(mut self, v: T) -> Self
2087 where
2088 T: std::convert::Into<wkt::FieldMask>,
2089 {
2090 self.0.request.read_mask = std::option::Option::Some(v.into());
2091 self
2092 }
2093
2094 pub fn set_or_clear_read_mask<T>(mut self, v: std::option::Option<T>) -> Self
2096 where
2097 T: std::convert::Into<wkt::FieldMask>,
2098 {
2099 self.0.request.read_mask = v.map(|x| x.into());
2100 self
2101 }
2102
2103 pub fn set_lexicographic_start<T: Into<std::string::String>>(mut self, v: T) -> Self {
2105 self.0.request.lexicographic_start = v.into();
2106 self
2107 }
2108
2109 pub fn set_lexicographic_end<T: Into<std::string::String>>(mut self, v: T) -> Self {
2111 self.0.request.lexicographic_end = v.into();
2112 self
2113 }
2114
2115 pub fn set_soft_deleted<T: Into<bool>>(mut self, v: T) -> Self {
2117 self.0.request.soft_deleted = v.into();
2118 self
2119 }
2120
2121 pub fn set_include_folders_as_prefixes<T: Into<bool>>(mut self, v: T) -> Self {
2123 self.0.request.include_folders_as_prefixes = v.into();
2124 self
2125 }
2126
2127 pub fn set_match_glob<T: Into<std::string::String>>(mut self, v: T) -> Self {
2129 self.0.request.match_glob = v.into();
2130 self
2131 }
2132
2133 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2135 self.0.request.filter = v.into();
2136 self
2137 }
2138 }
2139
2140 #[doc(hidden)]
2141 impl gax::options::internal::RequestBuilder for ListObjects {
2142 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2143 &mut self.0.options
2144 }
2145 }
2146
2147 #[derive(Clone, Debug)]
2165 pub struct RewriteObject(RequestBuilder<crate::model::RewriteObjectRequest>);
2166
2167 impl RewriteObject {
2168 pub(crate) fn new(
2169 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2170 ) -> Self {
2171 Self(RequestBuilder::new(stub))
2172 }
2173
2174 pub fn with_request<V: Into<crate::model::RewriteObjectRequest>>(mut self, v: V) -> Self {
2176 self.0.request = v.into();
2177 self
2178 }
2179
2180 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2182 self.0.options = v.into();
2183 self
2184 }
2185
2186 pub async fn send(self) -> Result<crate::model::RewriteResponse> {
2188 (*self.0.stub)
2189 .rewrite_object(self.0.request, self.0.options)
2190 .await
2191 .map(gax::response::Response::into_body)
2192 }
2193
2194 pub fn set_destination_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2198 self.0.request.destination_name = v.into();
2199 self
2200 }
2201
2202 pub fn set_destination_bucket<T: Into<std::string::String>>(mut self, v: T) -> Self {
2206 self.0.request.destination_bucket = v.into();
2207 self
2208 }
2209
2210 pub fn set_destination_kms_key<T: Into<std::string::String>>(mut self, v: T) -> Self {
2212 self.0.request.destination_kms_key = v.into();
2213 self
2214 }
2215
2216 pub fn set_destination<T>(mut self, v: T) -> Self
2218 where
2219 T: std::convert::Into<crate::model::Object>,
2220 {
2221 self.0.request.destination = std::option::Option::Some(v.into());
2222 self
2223 }
2224
2225 pub fn set_or_clear_destination<T>(mut self, v: std::option::Option<T>) -> Self
2227 where
2228 T: std::convert::Into<crate::model::Object>,
2229 {
2230 self.0.request.destination = v.map(|x| x.into());
2231 self
2232 }
2233
2234 pub fn set_source_bucket<T: Into<std::string::String>>(mut self, v: T) -> Self {
2238 self.0.request.source_bucket = v.into();
2239 self
2240 }
2241
2242 pub fn set_source_object<T: Into<std::string::String>>(mut self, v: T) -> Self {
2246 self.0.request.source_object = v.into();
2247 self
2248 }
2249
2250 pub fn set_source_generation<T: Into<i64>>(mut self, v: T) -> Self {
2252 self.0.request.source_generation = v.into();
2253 self
2254 }
2255
2256 pub fn set_rewrite_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2258 self.0.request.rewrite_token = v.into();
2259 self
2260 }
2261
2262 pub fn set_destination_predefined_acl<T: Into<std::string::String>>(
2264 mut self,
2265 v: T,
2266 ) -> Self {
2267 self.0.request.destination_predefined_acl = v.into();
2268 self
2269 }
2270
2271 pub fn set_if_generation_match<T>(mut self, v: T) -> Self
2273 where
2274 T: std::convert::Into<i64>,
2275 {
2276 self.0.request.if_generation_match = std::option::Option::Some(v.into());
2277 self
2278 }
2279
2280 pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
2282 where
2283 T: std::convert::Into<i64>,
2284 {
2285 self.0.request.if_generation_match = v.map(|x| x.into());
2286 self
2287 }
2288
2289 pub fn set_if_generation_not_match<T>(mut self, v: T) -> Self
2291 where
2292 T: std::convert::Into<i64>,
2293 {
2294 self.0.request.if_generation_not_match = std::option::Option::Some(v.into());
2295 self
2296 }
2297
2298 pub fn set_or_clear_if_generation_not_match<T>(mut self, v: std::option::Option<T>) -> Self
2300 where
2301 T: std::convert::Into<i64>,
2302 {
2303 self.0.request.if_generation_not_match = v.map(|x| x.into());
2304 self
2305 }
2306
2307 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
2309 where
2310 T: std::convert::Into<i64>,
2311 {
2312 self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
2313 self
2314 }
2315
2316 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
2318 where
2319 T: std::convert::Into<i64>,
2320 {
2321 self.0.request.if_metageneration_match = v.map(|x| x.into());
2322 self
2323 }
2324
2325 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
2327 where
2328 T: std::convert::Into<i64>,
2329 {
2330 self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
2331 self
2332 }
2333
2334 pub fn set_or_clear_if_metageneration_not_match<T>(
2336 mut self,
2337 v: std::option::Option<T>,
2338 ) -> Self
2339 where
2340 T: std::convert::Into<i64>,
2341 {
2342 self.0.request.if_metageneration_not_match = v.map(|x| x.into());
2343 self
2344 }
2345
2346 pub fn set_if_source_generation_match<T>(mut self, v: T) -> Self
2348 where
2349 T: std::convert::Into<i64>,
2350 {
2351 self.0.request.if_source_generation_match = std::option::Option::Some(v.into());
2352 self
2353 }
2354
2355 pub fn set_or_clear_if_source_generation_match<T>(
2357 mut self,
2358 v: std::option::Option<T>,
2359 ) -> Self
2360 where
2361 T: std::convert::Into<i64>,
2362 {
2363 self.0.request.if_source_generation_match = v.map(|x| x.into());
2364 self
2365 }
2366
2367 pub fn set_if_source_generation_not_match<T>(mut self, v: T) -> Self
2369 where
2370 T: std::convert::Into<i64>,
2371 {
2372 self.0.request.if_source_generation_not_match = std::option::Option::Some(v.into());
2373 self
2374 }
2375
2376 pub fn set_or_clear_if_source_generation_not_match<T>(
2378 mut self,
2379 v: std::option::Option<T>,
2380 ) -> Self
2381 where
2382 T: std::convert::Into<i64>,
2383 {
2384 self.0.request.if_source_generation_not_match = v.map(|x| x.into());
2385 self
2386 }
2387
2388 pub fn set_if_source_metageneration_match<T>(mut self, v: T) -> Self
2390 where
2391 T: std::convert::Into<i64>,
2392 {
2393 self.0.request.if_source_metageneration_match = std::option::Option::Some(v.into());
2394 self
2395 }
2396
2397 pub fn set_or_clear_if_source_metageneration_match<T>(
2399 mut self,
2400 v: std::option::Option<T>,
2401 ) -> Self
2402 where
2403 T: std::convert::Into<i64>,
2404 {
2405 self.0.request.if_source_metageneration_match = v.map(|x| x.into());
2406 self
2407 }
2408
2409 pub fn set_if_source_metageneration_not_match<T>(mut self, v: T) -> Self
2411 where
2412 T: std::convert::Into<i64>,
2413 {
2414 self.0.request.if_source_metageneration_not_match = std::option::Option::Some(v.into());
2415 self
2416 }
2417
2418 pub fn set_or_clear_if_source_metageneration_not_match<T>(
2420 mut self,
2421 v: std::option::Option<T>,
2422 ) -> Self
2423 where
2424 T: std::convert::Into<i64>,
2425 {
2426 self.0.request.if_source_metageneration_not_match = v.map(|x| x.into());
2427 self
2428 }
2429
2430 pub fn set_max_bytes_rewritten_per_call<T: Into<i64>>(mut self, v: T) -> Self {
2432 self.0.request.max_bytes_rewritten_per_call = v.into();
2433 self
2434 }
2435
2436 pub fn set_copy_source_encryption_algorithm<T: Into<std::string::String>>(
2438 mut self,
2439 v: T,
2440 ) -> Self {
2441 self.0.request.copy_source_encryption_algorithm = v.into();
2442 self
2443 }
2444
2445 pub fn set_copy_source_encryption_key_bytes<T: Into<::bytes::Bytes>>(
2447 mut self,
2448 v: T,
2449 ) -> Self {
2450 self.0.request.copy_source_encryption_key_bytes = v.into();
2451 self
2452 }
2453
2454 pub fn set_copy_source_encryption_key_sha256_bytes<T: Into<::bytes::Bytes>>(
2456 mut self,
2457 v: T,
2458 ) -> Self {
2459 self.0.request.copy_source_encryption_key_sha256_bytes = v.into();
2460 self
2461 }
2462
2463 pub fn set_common_object_request_params<T>(mut self, v: T) -> Self
2465 where
2466 T: std::convert::Into<crate::model::CommonObjectRequestParams>,
2467 {
2468 self.0.request.common_object_request_params = std::option::Option::Some(v.into());
2469 self
2470 }
2471
2472 pub fn set_or_clear_common_object_request_params<T>(
2474 mut self,
2475 v: std::option::Option<T>,
2476 ) -> Self
2477 where
2478 T: std::convert::Into<crate::model::CommonObjectRequestParams>,
2479 {
2480 self.0.request.common_object_request_params = v.map(|x| x.into());
2481 self
2482 }
2483
2484 pub fn set_object_checksums<T>(mut self, v: T) -> Self
2486 where
2487 T: std::convert::Into<crate::model::ObjectChecksums>,
2488 {
2489 self.0.request.object_checksums = std::option::Option::Some(v.into());
2490 self
2491 }
2492
2493 pub fn set_or_clear_object_checksums<T>(mut self, v: std::option::Option<T>) -> Self
2495 where
2496 T: std::convert::Into<crate::model::ObjectChecksums>,
2497 {
2498 self.0.request.object_checksums = v.map(|x| x.into());
2499 self
2500 }
2501 }
2502
2503 #[doc(hidden)]
2504 impl gax::options::internal::RequestBuilder for RewriteObject {
2505 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2506 &mut self.0.options
2507 }
2508 }
2509
2510 #[derive(Clone, Debug)]
2528 pub struct MoveObject(RequestBuilder<crate::model::MoveObjectRequest>);
2529
2530 impl MoveObject {
2531 pub(crate) fn new(
2532 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2533 ) -> Self {
2534 Self(RequestBuilder::new(stub))
2535 }
2536
2537 pub fn with_request<V: Into<crate::model::MoveObjectRequest>>(mut self, v: V) -> Self {
2539 self.0.request = v.into();
2540 self
2541 }
2542
2543 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2545 self.0.options = v.into();
2546 self
2547 }
2548
2549 pub async fn send(self) -> Result<crate::model::Object> {
2551 (*self.0.stub)
2552 .move_object(self.0.request, self.0.options)
2553 .await
2554 .map(gax::response::Response::into_body)
2555 }
2556
2557 pub fn set_bucket<T: Into<std::string::String>>(mut self, v: T) -> Self {
2561 self.0.request.bucket = v.into();
2562 self
2563 }
2564
2565 pub fn set_source_object<T: Into<std::string::String>>(mut self, v: T) -> Self {
2569 self.0.request.source_object = v.into();
2570 self
2571 }
2572
2573 pub fn set_destination_object<T: Into<std::string::String>>(mut self, v: T) -> Self {
2577 self.0.request.destination_object = v.into();
2578 self
2579 }
2580
2581 pub fn set_if_source_generation_match<T>(mut self, v: T) -> Self
2583 where
2584 T: std::convert::Into<i64>,
2585 {
2586 self.0.request.if_source_generation_match = std::option::Option::Some(v.into());
2587 self
2588 }
2589
2590 pub fn set_or_clear_if_source_generation_match<T>(
2592 mut self,
2593 v: std::option::Option<T>,
2594 ) -> Self
2595 where
2596 T: std::convert::Into<i64>,
2597 {
2598 self.0.request.if_source_generation_match = v.map(|x| x.into());
2599 self
2600 }
2601
2602 pub fn set_if_source_generation_not_match<T>(mut self, v: T) -> Self
2604 where
2605 T: std::convert::Into<i64>,
2606 {
2607 self.0.request.if_source_generation_not_match = std::option::Option::Some(v.into());
2608 self
2609 }
2610
2611 pub fn set_or_clear_if_source_generation_not_match<T>(
2613 mut self,
2614 v: std::option::Option<T>,
2615 ) -> Self
2616 where
2617 T: std::convert::Into<i64>,
2618 {
2619 self.0.request.if_source_generation_not_match = v.map(|x| x.into());
2620 self
2621 }
2622
2623 pub fn set_if_source_metageneration_match<T>(mut self, v: T) -> Self
2625 where
2626 T: std::convert::Into<i64>,
2627 {
2628 self.0.request.if_source_metageneration_match = std::option::Option::Some(v.into());
2629 self
2630 }
2631
2632 pub fn set_or_clear_if_source_metageneration_match<T>(
2634 mut self,
2635 v: std::option::Option<T>,
2636 ) -> Self
2637 where
2638 T: std::convert::Into<i64>,
2639 {
2640 self.0.request.if_source_metageneration_match = v.map(|x| x.into());
2641 self
2642 }
2643
2644 pub fn set_if_source_metageneration_not_match<T>(mut self, v: T) -> Self
2646 where
2647 T: std::convert::Into<i64>,
2648 {
2649 self.0.request.if_source_metageneration_not_match = std::option::Option::Some(v.into());
2650 self
2651 }
2652
2653 pub fn set_or_clear_if_source_metageneration_not_match<T>(
2655 mut self,
2656 v: std::option::Option<T>,
2657 ) -> Self
2658 where
2659 T: std::convert::Into<i64>,
2660 {
2661 self.0.request.if_source_metageneration_not_match = v.map(|x| x.into());
2662 self
2663 }
2664
2665 pub fn set_if_generation_match<T>(mut self, v: T) -> Self
2667 where
2668 T: std::convert::Into<i64>,
2669 {
2670 self.0.request.if_generation_match = std::option::Option::Some(v.into());
2671 self
2672 }
2673
2674 pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
2676 where
2677 T: std::convert::Into<i64>,
2678 {
2679 self.0.request.if_generation_match = v.map(|x| x.into());
2680 self
2681 }
2682
2683 pub fn set_if_generation_not_match<T>(mut self, v: T) -> Self
2685 where
2686 T: std::convert::Into<i64>,
2687 {
2688 self.0.request.if_generation_not_match = std::option::Option::Some(v.into());
2689 self
2690 }
2691
2692 pub fn set_or_clear_if_generation_not_match<T>(mut self, v: std::option::Option<T>) -> Self
2694 where
2695 T: std::convert::Into<i64>,
2696 {
2697 self.0.request.if_generation_not_match = v.map(|x| x.into());
2698 self
2699 }
2700
2701 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
2703 where
2704 T: std::convert::Into<i64>,
2705 {
2706 self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
2707 self
2708 }
2709
2710 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
2712 where
2713 T: std::convert::Into<i64>,
2714 {
2715 self.0.request.if_metageneration_match = v.map(|x| x.into());
2716 self
2717 }
2718
2719 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
2721 where
2722 T: std::convert::Into<i64>,
2723 {
2724 self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
2725 self
2726 }
2727
2728 pub fn set_or_clear_if_metageneration_not_match<T>(
2730 mut self,
2731 v: std::option::Option<T>,
2732 ) -> Self
2733 where
2734 T: std::convert::Into<i64>,
2735 {
2736 self.0.request.if_metageneration_not_match = v.map(|x| x.into());
2737 self
2738 }
2739 }
2740
2741 #[doc(hidden)]
2742 impl gax::options::internal::RequestBuilder for MoveObject {
2743 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2744 &mut self.0.options
2745 }
2746 }
2747}