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 UpdateBucket(RequestBuilder<crate::model::UpdateBucketRequest>);
597
598 impl UpdateBucket {
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<crate::model::UpdateBucketRequest>>(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<crate::model::Bucket> {
619 (*self.0.stub)
620 .update_bucket(self.0.request, self.0.options)
621 .await
622 .map(gax::response::Response::into_body)
623 }
624
625 pub fn set_bucket<T>(mut self, v: T) -> Self
629 where
630 T: std::convert::Into<crate::model::Bucket>,
631 {
632 self.0.request.bucket = std::option::Option::Some(v.into());
633 self
634 }
635
636 pub fn set_or_clear_bucket<T>(mut self, v: std::option::Option<T>) -> Self
640 where
641 T: std::convert::Into<crate::model::Bucket>,
642 {
643 self.0.request.bucket = v.map(|x| x.into());
644 self
645 }
646
647 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
649 where
650 T: std::convert::Into<i64>,
651 {
652 self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
653 self
654 }
655
656 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
658 where
659 T: std::convert::Into<i64>,
660 {
661 self.0.request.if_metageneration_match = v.map(|x| x.into());
662 self
663 }
664
665 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
667 where
668 T: std::convert::Into<i64>,
669 {
670 self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
671 self
672 }
673
674 pub fn set_or_clear_if_metageneration_not_match<T>(
676 mut self,
677 v: std::option::Option<T>,
678 ) -> Self
679 where
680 T: std::convert::Into<i64>,
681 {
682 self.0.request.if_metageneration_not_match = v.map(|x| x.into());
683 self
684 }
685
686 pub fn set_predefined_acl<T: Into<std::string::String>>(mut self, v: T) -> Self {
688 self.0.request.predefined_acl = v.into();
689 self
690 }
691
692 pub fn set_predefined_default_object_acl<T: Into<std::string::String>>(
694 mut self,
695 v: T,
696 ) -> Self {
697 self.0.request.predefined_default_object_acl = v.into();
698 self
699 }
700
701 pub fn set_update_mask<T>(mut self, v: T) -> Self
705 where
706 T: std::convert::Into<wkt::FieldMask>,
707 {
708 self.0.request.update_mask = std::option::Option::Some(v.into());
709 self
710 }
711
712 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
716 where
717 T: std::convert::Into<wkt::FieldMask>,
718 {
719 self.0.request.update_mask = v.map(|x| x.into());
720 self
721 }
722 }
723
724 #[doc(hidden)]
725 impl gax::options::internal::RequestBuilder for UpdateBucket {
726 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
727 &mut self.0.options
728 }
729 }
730
731 #[derive(Clone, Debug)]
749 pub struct ComposeObject(RequestBuilder<crate::model::ComposeObjectRequest>);
750
751 impl ComposeObject {
752 pub(crate) fn new(
753 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
754 ) -> Self {
755 Self(RequestBuilder::new(stub))
756 }
757
758 pub fn with_request<V: Into<crate::model::ComposeObjectRequest>>(mut self, v: V) -> Self {
760 self.0.request = v.into();
761 self
762 }
763
764 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
766 self.0.options = v.into();
767 self
768 }
769
770 pub async fn send(self) -> Result<crate::model::Object> {
772 (*self.0.stub)
773 .compose_object(self.0.request, self.0.options)
774 .await
775 .map(gax::response::Response::into_body)
776 }
777
778 pub fn set_destination<T>(mut self, v: T) -> Self
782 where
783 T: std::convert::Into<crate::model::Object>,
784 {
785 self.0.request.destination = std::option::Option::Some(v.into());
786 self
787 }
788
789 pub fn set_or_clear_destination<T>(mut self, v: std::option::Option<T>) -> Self
793 where
794 T: std::convert::Into<crate::model::Object>,
795 {
796 self.0.request.destination = v.map(|x| x.into());
797 self
798 }
799
800 pub fn set_source_objects<T, V>(mut self, v: T) -> Self
802 where
803 T: std::iter::IntoIterator<Item = V>,
804 V: std::convert::Into<crate::model::compose_object_request::SourceObject>,
805 {
806 use std::iter::Iterator;
807 self.0.request.source_objects = v.into_iter().map(|i| i.into()).collect();
808 self
809 }
810
811 pub fn set_destination_predefined_acl<T: Into<std::string::String>>(
813 mut self,
814 v: T,
815 ) -> Self {
816 self.0.request.destination_predefined_acl = v.into();
817 self
818 }
819
820 pub fn set_if_generation_match<T>(mut self, v: T) -> Self
822 where
823 T: std::convert::Into<i64>,
824 {
825 self.0.request.if_generation_match = std::option::Option::Some(v.into());
826 self
827 }
828
829 pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
831 where
832 T: std::convert::Into<i64>,
833 {
834 self.0.request.if_generation_match = v.map(|x| x.into());
835 self
836 }
837
838 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
840 where
841 T: std::convert::Into<i64>,
842 {
843 self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
844 self
845 }
846
847 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
849 where
850 T: std::convert::Into<i64>,
851 {
852 self.0.request.if_metageneration_match = v.map(|x| x.into());
853 self
854 }
855
856 pub fn set_kms_key<T: Into<std::string::String>>(mut self, v: T) -> Self {
858 self.0.request.kms_key = v.into();
859 self
860 }
861
862 pub fn set_common_object_request_params<T>(mut self, v: T) -> Self
864 where
865 T: std::convert::Into<crate::model::CommonObjectRequestParams>,
866 {
867 self.0.request.common_object_request_params = std::option::Option::Some(v.into());
868 self
869 }
870
871 pub fn set_or_clear_common_object_request_params<T>(
873 mut self,
874 v: std::option::Option<T>,
875 ) -> Self
876 where
877 T: std::convert::Into<crate::model::CommonObjectRequestParams>,
878 {
879 self.0.request.common_object_request_params = v.map(|x| x.into());
880 self
881 }
882
883 pub fn set_object_checksums<T>(mut self, v: T) -> Self
885 where
886 T: std::convert::Into<crate::model::ObjectChecksums>,
887 {
888 self.0.request.object_checksums = std::option::Option::Some(v.into());
889 self
890 }
891
892 pub fn set_or_clear_object_checksums<T>(mut self, v: std::option::Option<T>) -> Self
894 where
895 T: std::convert::Into<crate::model::ObjectChecksums>,
896 {
897 self.0.request.object_checksums = v.map(|x| x.into());
898 self
899 }
900 }
901
902 #[doc(hidden)]
903 impl gax::options::internal::RequestBuilder for ComposeObject {
904 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
905 &mut self.0.options
906 }
907 }
908
909 #[derive(Clone, Debug)]
927 pub struct DeleteObject(RequestBuilder<crate::model::DeleteObjectRequest>);
928
929 impl DeleteObject {
930 pub(crate) fn new(
931 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
932 ) -> Self {
933 Self(RequestBuilder::new(stub))
934 }
935
936 pub fn with_request<V: Into<crate::model::DeleteObjectRequest>>(mut self, v: V) -> Self {
938 self.0.request = v.into();
939 self
940 }
941
942 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
944 self.0.options = v.into();
945 self
946 }
947
948 pub async fn send(self) -> Result<()> {
950 (*self.0.stub)
951 .delete_object(self.0.request, self.0.options)
952 .await
953 .map(gax::response::Response::into_body)
954 }
955
956 pub fn set_bucket<T: Into<std::string::String>>(mut self, v: T) -> Self {
960 self.0.request.bucket = v.into();
961 self
962 }
963
964 pub fn set_object<T: Into<std::string::String>>(mut self, v: T) -> Self {
968 self.0.request.object = v.into();
969 self
970 }
971
972 pub fn set_generation<T: Into<i64>>(mut self, v: T) -> Self {
974 self.0.request.generation = v.into();
975 self
976 }
977
978 pub fn set_if_generation_match<T>(mut self, v: T) -> Self
980 where
981 T: std::convert::Into<i64>,
982 {
983 self.0.request.if_generation_match = std::option::Option::Some(v.into());
984 self
985 }
986
987 pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
989 where
990 T: std::convert::Into<i64>,
991 {
992 self.0.request.if_generation_match = v.map(|x| x.into());
993 self
994 }
995
996 pub fn set_if_generation_not_match<T>(mut self, v: T) -> Self
998 where
999 T: std::convert::Into<i64>,
1000 {
1001 self.0.request.if_generation_not_match = std::option::Option::Some(v.into());
1002 self
1003 }
1004
1005 pub fn set_or_clear_if_generation_not_match<T>(mut self, v: std::option::Option<T>) -> Self
1007 where
1008 T: std::convert::Into<i64>,
1009 {
1010 self.0.request.if_generation_not_match = v.map(|x| x.into());
1011 self
1012 }
1013
1014 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
1016 where
1017 T: std::convert::Into<i64>,
1018 {
1019 self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
1020 self
1021 }
1022
1023 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
1025 where
1026 T: std::convert::Into<i64>,
1027 {
1028 self.0.request.if_metageneration_match = v.map(|x| x.into());
1029 self
1030 }
1031
1032 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
1034 where
1035 T: std::convert::Into<i64>,
1036 {
1037 self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
1038 self
1039 }
1040
1041 pub fn set_or_clear_if_metageneration_not_match<T>(
1043 mut self,
1044 v: std::option::Option<T>,
1045 ) -> Self
1046 where
1047 T: std::convert::Into<i64>,
1048 {
1049 self.0.request.if_metageneration_not_match = v.map(|x| x.into());
1050 self
1051 }
1052
1053 pub fn set_common_object_request_params<T>(mut self, v: T) -> Self
1055 where
1056 T: std::convert::Into<crate::model::CommonObjectRequestParams>,
1057 {
1058 self.0.request.common_object_request_params = std::option::Option::Some(v.into());
1059 self
1060 }
1061
1062 pub fn set_or_clear_common_object_request_params<T>(
1064 mut self,
1065 v: std::option::Option<T>,
1066 ) -> Self
1067 where
1068 T: std::convert::Into<crate::model::CommonObjectRequestParams>,
1069 {
1070 self.0.request.common_object_request_params = v.map(|x| x.into());
1071 self
1072 }
1073 }
1074
1075 #[doc(hidden)]
1076 impl gax::options::internal::RequestBuilder for DeleteObject {
1077 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1078 &mut self.0.options
1079 }
1080 }
1081
1082 #[derive(Clone, Debug)]
1100 pub struct RestoreObject(RequestBuilder<crate::model::RestoreObjectRequest>);
1101
1102 impl RestoreObject {
1103 pub(crate) fn new(
1104 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1105 ) -> Self {
1106 Self(RequestBuilder::new(stub))
1107 }
1108
1109 pub fn with_request<V: Into<crate::model::RestoreObjectRequest>>(mut self, v: V) -> Self {
1111 self.0.request = v.into();
1112 self
1113 }
1114
1115 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1117 self.0.options = v.into();
1118 self
1119 }
1120
1121 pub async fn send(self) -> Result<crate::model::Object> {
1123 (*self.0.stub)
1124 .restore_object(self.0.request, self.0.options)
1125 .await
1126 .map(gax::response::Response::into_body)
1127 }
1128
1129 pub fn set_bucket<T: Into<std::string::String>>(mut self, v: T) -> Self {
1133 self.0.request.bucket = v.into();
1134 self
1135 }
1136
1137 pub fn set_object<T: Into<std::string::String>>(mut self, v: T) -> Self {
1141 self.0.request.object = v.into();
1142 self
1143 }
1144
1145 pub fn set_generation<T: Into<i64>>(mut self, v: T) -> Self {
1149 self.0.request.generation = v.into();
1150 self
1151 }
1152
1153 pub fn set_restore_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1155 self.0.request.restore_token = v.into();
1156 self
1157 }
1158
1159 pub fn set_if_generation_match<T>(mut self, v: T) -> Self
1161 where
1162 T: std::convert::Into<i64>,
1163 {
1164 self.0.request.if_generation_match = std::option::Option::Some(v.into());
1165 self
1166 }
1167
1168 pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
1170 where
1171 T: std::convert::Into<i64>,
1172 {
1173 self.0.request.if_generation_match = v.map(|x| x.into());
1174 self
1175 }
1176
1177 pub fn set_if_generation_not_match<T>(mut self, v: T) -> Self
1179 where
1180 T: std::convert::Into<i64>,
1181 {
1182 self.0.request.if_generation_not_match = std::option::Option::Some(v.into());
1183 self
1184 }
1185
1186 pub fn set_or_clear_if_generation_not_match<T>(mut self, v: std::option::Option<T>) -> Self
1188 where
1189 T: std::convert::Into<i64>,
1190 {
1191 self.0.request.if_generation_not_match = v.map(|x| x.into());
1192 self
1193 }
1194
1195 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
1197 where
1198 T: std::convert::Into<i64>,
1199 {
1200 self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
1201 self
1202 }
1203
1204 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
1206 where
1207 T: std::convert::Into<i64>,
1208 {
1209 self.0.request.if_metageneration_match = v.map(|x| x.into());
1210 self
1211 }
1212
1213 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
1215 where
1216 T: std::convert::Into<i64>,
1217 {
1218 self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
1219 self
1220 }
1221
1222 pub fn set_or_clear_if_metageneration_not_match<T>(
1224 mut self,
1225 v: std::option::Option<T>,
1226 ) -> Self
1227 where
1228 T: std::convert::Into<i64>,
1229 {
1230 self.0.request.if_metageneration_not_match = v.map(|x| x.into());
1231 self
1232 }
1233
1234 pub fn set_copy_source_acl<T>(mut self, v: T) -> Self
1236 where
1237 T: std::convert::Into<bool>,
1238 {
1239 self.0.request.copy_source_acl = std::option::Option::Some(v.into());
1240 self
1241 }
1242
1243 pub fn set_or_clear_copy_source_acl<T>(mut self, v: std::option::Option<T>) -> Self
1245 where
1246 T: std::convert::Into<bool>,
1247 {
1248 self.0.request.copy_source_acl = v.map(|x| x.into());
1249 self
1250 }
1251
1252 pub fn set_common_object_request_params<T>(mut self, v: T) -> Self
1254 where
1255 T: std::convert::Into<crate::model::CommonObjectRequestParams>,
1256 {
1257 self.0.request.common_object_request_params = std::option::Option::Some(v.into());
1258 self
1259 }
1260
1261 pub fn set_or_clear_common_object_request_params<T>(
1263 mut self,
1264 v: std::option::Option<T>,
1265 ) -> Self
1266 where
1267 T: std::convert::Into<crate::model::CommonObjectRequestParams>,
1268 {
1269 self.0.request.common_object_request_params = v.map(|x| x.into());
1270 self
1271 }
1272 }
1273
1274 #[doc(hidden)]
1275 impl gax::options::internal::RequestBuilder for RestoreObject {
1276 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1277 &mut self.0.options
1278 }
1279 }
1280
1281 #[derive(Clone, Debug)]
1299 pub struct GetObject(RequestBuilder<crate::model::GetObjectRequest>);
1300
1301 impl GetObject {
1302 pub(crate) fn new(
1303 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1304 ) -> Self {
1305 Self(RequestBuilder::new(stub))
1306 }
1307
1308 pub fn with_request<V: Into<crate::model::GetObjectRequest>>(mut self, v: V) -> Self {
1310 self.0.request = v.into();
1311 self
1312 }
1313
1314 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1316 self.0.options = v.into();
1317 self
1318 }
1319
1320 pub async fn send(self) -> Result<crate::model::Object> {
1322 (*self.0.stub)
1323 .get_object(self.0.request, self.0.options)
1324 .await
1325 .map(gax::response::Response::into_body)
1326 }
1327
1328 pub fn set_bucket<T: Into<std::string::String>>(mut self, v: T) -> Self {
1332 self.0.request.bucket = v.into();
1333 self
1334 }
1335
1336 pub fn set_object<T: Into<std::string::String>>(mut self, v: T) -> Self {
1340 self.0.request.object = v.into();
1341 self
1342 }
1343
1344 pub fn set_generation<T: Into<i64>>(mut self, v: T) -> Self {
1346 self.0.request.generation = v.into();
1347 self
1348 }
1349
1350 pub fn set_soft_deleted<T>(mut self, v: T) -> Self
1352 where
1353 T: std::convert::Into<bool>,
1354 {
1355 self.0.request.soft_deleted = std::option::Option::Some(v.into());
1356 self
1357 }
1358
1359 pub fn set_or_clear_soft_deleted<T>(mut self, v: std::option::Option<T>) -> Self
1361 where
1362 T: std::convert::Into<bool>,
1363 {
1364 self.0.request.soft_deleted = v.map(|x| x.into());
1365 self
1366 }
1367
1368 pub fn set_if_generation_match<T>(mut self, v: T) -> Self
1370 where
1371 T: std::convert::Into<i64>,
1372 {
1373 self.0.request.if_generation_match = std::option::Option::Some(v.into());
1374 self
1375 }
1376
1377 pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
1379 where
1380 T: std::convert::Into<i64>,
1381 {
1382 self.0.request.if_generation_match = v.map(|x| x.into());
1383 self
1384 }
1385
1386 pub fn set_if_generation_not_match<T>(mut self, v: T) -> Self
1388 where
1389 T: std::convert::Into<i64>,
1390 {
1391 self.0.request.if_generation_not_match = std::option::Option::Some(v.into());
1392 self
1393 }
1394
1395 pub fn set_or_clear_if_generation_not_match<T>(mut self, v: std::option::Option<T>) -> Self
1397 where
1398 T: std::convert::Into<i64>,
1399 {
1400 self.0.request.if_generation_not_match = v.map(|x| x.into());
1401 self
1402 }
1403
1404 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
1406 where
1407 T: std::convert::Into<i64>,
1408 {
1409 self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
1410 self
1411 }
1412
1413 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
1415 where
1416 T: std::convert::Into<i64>,
1417 {
1418 self.0.request.if_metageneration_match = v.map(|x| x.into());
1419 self
1420 }
1421
1422 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
1424 where
1425 T: std::convert::Into<i64>,
1426 {
1427 self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
1428 self
1429 }
1430
1431 pub fn set_or_clear_if_metageneration_not_match<T>(
1433 mut self,
1434 v: std::option::Option<T>,
1435 ) -> Self
1436 where
1437 T: std::convert::Into<i64>,
1438 {
1439 self.0.request.if_metageneration_not_match = v.map(|x| x.into());
1440 self
1441 }
1442
1443 pub fn set_common_object_request_params<T>(mut self, v: T) -> Self
1445 where
1446 T: std::convert::Into<crate::model::CommonObjectRequestParams>,
1447 {
1448 self.0.request.common_object_request_params = std::option::Option::Some(v.into());
1449 self
1450 }
1451
1452 pub fn set_or_clear_common_object_request_params<T>(
1454 mut self,
1455 v: std::option::Option<T>,
1456 ) -> Self
1457 where
1458 T: std::convert::Into<crate::model::CommonObjectRequestParams>,
1459 {
1460 self.0.request.common_object_request_params = v.map(|x| x.into());
1461 self
1462 }
1463
1464 pub fn set_read_mask<T>(mut self, v: T) -> Self
1466 where
1467 T: std::convert::Into<wkt::FieldMask>,
1468 {
1469 self.0.request.read_mask = std::option::Option::Some(v.into());
1470 self
1471 }
1472
1473 pub fn set_or_clear_read_mask<T>(mut self, v: std::option::Option<T>) -> Self
1475 where
1476 T: std::convert::Into<wkt::FieldMask>,
1477 {
1478 self.0.request.read_mask = v.map(|x| x.into());
1479 self
1480 }
1481
1482 pub fn set_restore_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1484 self.0.request.restore_token = v.into();
1485 self
1486 }
1487 }
1488
1489 #[doc(hidden)]
1490 impl gax::options::internal::RequestBuilder for GetObject {
1491 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1492 &mut self.0.options
1493 }
1494 }
1495
1496 #[derive(Clone, Debug)]
1514 pub struct UpdateObject(RequestBuilder<crate::model::UpdateObjectRequest>);
1515
1516 impl UpdateObject {
1517 pub(crate) fn new(
1518 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1519 ) -> Self {
1520 Self(RequestBuilder::new(stub))
1521 }
1522
1523 pub fn with_request<V: Into<crate::model::UpdateObjectRequest>>(mut self, v: V) -> Self {
1525 self.0.request = v.into();
1526 self
1527 }
1528
1529 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1531 self.0.options = v.into();
1532 self
1533 }
1534
1535 pub async fn send(self) -> Result<crate::model::Object> {
1537 (*self.0.stub)
1538 .update_object(self.0.request, self.0.options)
1539 .await
1540 .map(gax::response::Response::into_body)
1541 }
1542
1543 pub fn set_object<T>(mut self, v: T) -> Self
1547 where
1548 T: std::convert::Into<crate::model::Object>,
1549 {
1550 self.0.request.object = std::option::Option::Some(v.into());
1551 self
1552 }
1553
1554 pub fn set_or_clear_object<T>(mut self, v: std::option::Option<T>) -> Self
1558 where
1559 T: std::convert::Into<crate::model::Object>,
1560 {
1561 self.0.request.object = v.map(|x| x.into());
1562 self
1563 }
1564
1565 pub fn set_if_generation_match<T>(mut self, v: T) -> Self
1567 where
1568 T: std::convert::Into<i64>,
1569 {
1570 self.0.request.if_generation_match = std::option::Option::Some(v.into());
1571 self
1572 }
1573
1574 pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
1576 where
1577 T: std::convert::Into<i64>,
1578 {
1579 self.0.request.if_generation_match = v.map(|x| x.into());
1580 self
1581 }
1582
1583 pub fn set_if_generation_not_match<T>(mut self, v: T) -> Self
1585 where
1586 T: std::convert::Into<i64>,
1587 {
1588 self.0.request.if_generation_not_match = std::option::Option::Some(v.into());
1589 self
1590 }
1591
1592 pub fn set_or_clear_if_generation_not_match<T>(mut self, v: std::option::Option<T>) -> Self
1594 where
1595 T: std::convert::Into<i64>,
1596 {
1597 self.0.request.if_generation_not_match = v.map(|x| x.into());
1598 self
1599 }
1600
1601 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
1603 where
1604 T: std::convert::Into<i64>,
1605 {
1606 self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
1607 self
1608 }
1609
1610 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
1612 where
1613 T: std::convert::Into<i64>,
1614 {
1615 self.0.request.if_metageneration_match = v.map(|x| x.into());
1616 self
1617 }
1618
1619 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
1621 where
1622 T: std::convert::Into<i64>,
1623 {
1624 self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
1625 self
1626 }
1627
1628 pub fn set_or_clear_if_metageneration_not_match<T>(
1630 mut self,
1631 v: std::option::Option<T>,
1632 ) -> Self
1633 where
1634 T: std::convert::Into<i64>,
1635 {
1636 self.0.request.if_metageneration_not_match = v.map(|x| x.into());
1637 self
1638 }
1639
1640 pub fn set_predefined_acl<T: Into<std::string::String>>(mut self, v: T) -> Self {
1642 self.0.request.predefined_acl = v.into();
1643 self
1644 }
1645
1646 pub fn set_update_mask<T>(mut self, v: T) -> Self
1650 where
1651 T: std::convert::Into<wkt::FieldMask>,
1652 {
1653 self.0.request.update_mask = std::option::Option::Some(v.into());
1654 self
1655 }
1656
1657 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1661 where
1662 T: std::convert::Into<wkt::FieldMask>,
1663 {
1664 self.0.request.update_mask = v.map(|x| x.into());
1665 self
1666 }
1667
1668 pub fn set_common_object_request_params<T>(mut self, v: T) -> Self
1670 where
1671 T: std::convert::Into<crate::model::CommonObjectRequestParams>,
1672 {
1673 self.0.request.common_object_request_params = std::option::Option::Some(v.into());
1674 self
1675 }
1676
1677 pub fn set_or_clear_common_object_request_params<T>(
1679 mut self,
1680 v: std::option::Option<T>,
1681 ) -> Self
1682 where
1683 T: std::convert::Into<crate::model::CommonObjectRequestParams>,
1684 {
1685 self.0.request.common_object_request_params = v.map(|x| x.into());
1686 self
1687 }
1688
1689 pub fn set_override_unlocked_retention<T: Into<bool>>(mut self, v: T) -> Self {
1691 self.0.request.override_unlocked_retention = v.into();
1692 self
1693 }
1694 }
1695
1696 #[doc(hidden)]
1697 impl gax::options::internal::RequestBuilder for UpdateObject {
1698 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1699 &mut self.0.options
1700 }
1701 }
1702
1703 #[derive(Clone, Debug)]
1725 pub struct ListObjects(RequestBuilder<crate::model::ListObjectsRequest>);
1726
1727 impl ListObjects {
1728 pub(crate) fn new(
1729 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1730 ) -> Self {
1731 Self(RequestBuilder::new(stub))
1732 }
1733
1734 pub fn with_request<V: Into<crate::model::ListObjectsRequest>>(mut self, v: V) -> Self {
1736 self.0.request = v.into();
1737 self
1738 }
1739
1740 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1742 self.0.options = v.into();
1743 self
1744 }
1745
1746 pub async fn send(self) -> Result<crate::model::ListObjectsResponse> {
1748 (*self.0.stub)
1749 .list_objects(self.0.request, self.0.options)
1750 .await
1751 .map(gax::response::Response::into_body)
1752 }
1753
1754 pub fn by_page(
1756 self,
1757 ) -> impl gax::paginator::Paginator<crate::model::ListObjectsResponse, gax::error::Error>
1758 {
1759 use std::clone::Clone;
1760 let token = self.0.request.page_token.clone();
1761 let execute = move |token: String| {
1762 let mut builder = self.clone();
1763 builder.0.request = builder.0.request.set_page_token(token);
1764 builder.send()
1765 };
1766 gax::paginator::internal::new_paginator(token, execute)
1767 }
1768
1769 pub fn by_item(
1771 self,
1772 ) -> impl gax::paginator::ItemPaginator<crate::model::ListObjectsResponse, gax::error::Error>
1773 {
1774 use gax::paginator::Paginator;
1775 self.by_page().items()
1776 }
1777
1778 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1782 self.0.request.parent = v.into();
1783 self
1784 }
1785
1786 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1788 self.0.request.page_size = v.into();
1789 self
1790 }
1791
1792 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1794 self.0.request.page_token = v.into();
1795 self
1796 }
1797
1798 pub fn set_delimiter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1800 self.0.request.delimiter = v.into();
1801 self
1802 }
1803
1804 pub fn set_include_trailing_delimiter<T: Into<bool>>(mut self, v: T) -> Self {
1806 self.0.request.include_trailing_delimiter = v.into();
1807 self
1808 }
1809
1810 pub fn set_prefix<T: Into<std::string::String>>(mut self, v: T) -> Self {
1812 self.0.request.prefix = v.into();
1813 self
1814 }
1815
1816 pub fn set_versions<T: Into<bool>>(mut self, v: T) -> Self {
1818 self.0.request.versions = v.into();
1819 self
1820 }
1821
1822 pub fn set_read_mask<T>(mut self, v: T) -> Self
1824 where
1825 T: std::convert::Into<wkt::FieldMask>,
1826 {
1827 self.0.request.read_mask = std::option::Option::Some(v.into());
1828 self
1829 }
1830
1831 pub fn set_or_clear_read_mask<T>(mut self, v: std::option::Option<T>) -> Self
1833 where
1834 T: std::convert::Into<wkt::FieldMask>,
1835 {
1836 self.0.request.read_mask = v.map(|x| x.into());
1837 self
1838 }
1839
1840 pub fn set_lexicographic_start<T: Into<std::string::String>>(mut self, v: T) -> Self {
1842 self.0.request.lexicographic_start = v.into();
1843 self
1844 }
1845
1846 pub fn set_lexicographic_end<T: Into<std::string::String>>(mut self, v: T) -> Self {
1848 self.0.request.lexicographic_end = v.into();
1849 self
1850 }
1851
1852 pub fn set_soft_deleted<T: Into<bool>>(mut self, v: T) -> Self {
1854 self.0.request.soft_deleted = v.into();
1855 self
1856 }
1857
1858 pub fn set_include_folders_as_prefixes<T: Into<bool>>(mut self, v: T) -> Self {
1860 self.0.request.include_folders_as_prefixes = v.into();
1861 self
1862 }
1863
1864 pub fn set_match_glob<T: Into<std::string::String>>(mut self, v: T) -> Self {
1866 self.0.request.match_glob = v.into();
1867 self
1868 }
1869
1870 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1872 self.0.request.filter = v.into();
1873 self
1874 }
1875 }
1876
1877 #[doc(hidden)]
1878 impl gax::options::internal::RequestBuilder for ListObjects {
1879 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1880 &mut self.0.options
1881 }
1882 }
1883
1884 #[derive(Clone, Debug)]
1902 pub struct RewriteObject(RequestBuilder<crate::model::RewriteObjectRequest>);
1903
1904 impl RewriteObject {
1905 pub(crate) fn new(
1906 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1907 ) -> Self {
1908 Self(RequestBuilder::new(stub))
1909 }
1910
1911 pub fn with_request<V: Into<crate::model::RewriteObjectRequest>>(mut self, v: V) -> Self {
1913 self.0.request = v.into();
1914 self
1915 }
1916
1917 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1919 self.0.options = v.into();
1920 self
1921 }
1922
1923 pub async fn send(self) -> Result<crate::model::RewriteResponse> {
1925 (*self.0.stub)
1926 .rewrite_object(self.0.request, self.0.options)
1927 .await
1928 .map(gax::response::Response::into_body)
1929 }
1930
1931 pub fn set_destination_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1935 self.0.request.destination_name = v.into();
1936 self
1937 }
1938
1939 pub fn set_destination_bucket<T: Into<std::string::String>>(mut self, v: T) -> Self {
1943 self.0.request.destination_bucket = v.into();
1944 self
1945 }
1946
1947 pub fn set_destination_kms_key<T: Into<std::string::String>>(mut self, v: T) -> Self {
1949 self.0.request.destination_kms_key = v.into();
1950 self
1951 }
1952
1953 pub fn set_destination<T>(mut self, v: T) -> Self
1955 where
1956 T: std::convert::Into<crate::model::Object>,
1957 {
1958 self.0.request.destination = std::option::Option::Some(v.into());
1959 self
1960 }
1961
1962 pub fn set_or_clear_destination<T>(mut self, v: std::option::Option<T>) -> Self
1964 where
1965 T: std::convert::Into<crate::model::Object>,
1966 {
1967 self.0.request.destination = v.map(|x| x.into());
1968 self
1969 }
1970
1971 pub fn set_source_bucket<T: Into<std::string::String>>(mut self, v: T) -> Self {
1975 self.0.request.source_bucket = v.into();
1976 self
1977 }
1978
1979 pub fn set_source_object<T: Into<std::string::String>>(mut self, v: T) -> Self {
1983 self.0.request.source_object = v.into();
1984 self
1985 }
1986
1987 pub fn set_source_generation<T: Into<i64>>(mut self, v: T) -> Self {
1989 self.0.request.source_generation = v.into();
1990 self
1991 }
1992
1993 pub fn set_rewrite_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1995 self.0.request.rewrite_token = v.into();
1996 self
1997 }
1998
1999 pub fn set_destination_predefined_acl<T: Into<std::string::String>>(
2001 mut self,
2002 v: T,
2003 ) -> Self {
2004 self.0.request.destination_predefined_acl = v.into();
2005 self
2006 }
2007
2008 pub fn set_if_generation_match<T>(mut self, v: T) -> Self
2010 where
2011 T: std::convert::Into<i64>,
2012 {
2013 self.0.request.if_generation_match = std::option::Option::Some(v.into());
2014 self
2015 }
2016
2017 pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
2019 where
2020 T: std::convert::Into<i64>,
2021 {
2022 self.0.request.if_generation_match = v.map(|x| x.into());
2023 self
2024 }
2025
2026 pub fn set_if_generation_not_match<T>(mut self, v: T) -> Self
2028 where
2029 T: std::convert::Into<i64>,
2030 {
2031 self.0.request.if_generation_not_match = std::option::Option::Some(v.into());
2032 self
2033 }
2034
2035 pub fn set_or_clear_if_generation_not_match<T>(mut self, v: std::option::Option<T>) -> Self
2037 where
2038 T: std::convert::Into<i64>,
2039 {
2040 self.0.request.if_generation_not_match = v.map(|x| x.into());
2041 self
2042 }
2043
2044 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
2046 where
2047 T: std::convert::Into<i64>,
2048 {
2049 self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
2050 self
2051 }
2052
2053 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
2055 where
2056 T: std::convert::Into<i64>,
2057 {
2058 self.0.request.if_metageneration_match = v.map(|x| x.into());
2059 self
2060 }
2061
2062 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
2064 where
2065 T: std::convert::Into<i64>,
2066 {
2067 self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
2068 self
2069 }
2070
2071 pub fn set_or_clear_if_metageneration_not_match<T>(
2073 mut self,
2074 v: std::option::Option<T>,
2075 ) -> Self
2076 where
2077 T: std::convert::Into<i64>,
2078 {
2079 self.0.request.if_metageneration_not_match = v.map(|x| x.into());
2080 self
2081 }
2082
2083 pub fn set_if_source_generation_match<T>(mut self, v: T) -> Self
2085 where
2086 T: std::convert::Into<i64>,
2087 {
2088 self.0.request.if_source_generation_match = std::option::Option::Some(v.into());
2089 self
2090 }
2091
2092 pub fn set_or_clear_if_source_generation_match<T>(
2094 mut self,
2095 v: std::option::Option<T>,
2096 ) -> Self
2097 where
2098 T: std::convert::Into<i64>,
2099 {
2100 self.0.request.if_source_generation_match = v.map(|x| x.into());
2101 self
2102 }
2103
2104 pub fn set_if_source_generation_not_match<T>(mut self, v: T) -> Self
2106 where
2107 T: std::convert::Into<i64>,
2108 {
2109 self.0.request.if_source_generation_not_match = std::option::Option::Some(v.into());
2110 self
2111 }
2112
2113 pub fn set_or_clear_if_source_generation_not_match<T>(
2115 mut self,
2116 v: std::option::Option<T>,
2117 ) -> Self
2118 where
2119 T: std::convert::Into<i64>,
2120 {
2121 self.0.request.if_source_generation_not_match = v.map(|x| x.into());
2122 self
2123 }
2124
2125 pub fn set_if_source_metageneration_match<T>(mut self, v: T) -> Self
2127 where
2128 T: std::convert::Into<i64>,
2129 {
2130 self.0.request.if_source_metageneration_match = std::option::Option::Some(v.into());
2131 self
2132 }
2133
2134 pub fn set_or_clear_if_source_metageneration_match<T>(
2136 mut self,
2137 v: std::option::Option<T>,
2138 ) -> Self
2139 where
2140 T: std::convert::Into<i64>,
2141 {
2142 self.0.request.if_source_metageneration_match = v.map(|x| x.into());
2143 self
2144 }
2145
2146 pub fn set_if_source_metageneration_not_match<T>(mut self, v: T) -> Self
2148 where
2149 T: std::convert::Into<i64>,
2150 {
2151 self.0.request.if_source_metageneration_not_match = std::option::Option::Some(v.into());
2152 self
2153 }
2154
2155 pub fn set_or_clear_if_source_metageneration_not_match<T>(
2157 mut self,
2158 v: std::option::Option<T>,
2159 ) -> Self
2160 where
2161 T: std::convert::Into<i64>,
2162 {
2163 self.0.request.if_source_metageneration_not_match = v.map(|x| x.into());
2164 self
2165 }
2166
2167 pub fn set_max_bytes_rewritten_per_call<T: Into<i64>>(mut self, v: T) -> Self {
2169 self.0.request.max_bytes_rewritten_per_call = v.into();
2170 self
2171 }
2172
2173 pub fn set_copy_source_encryption_algorithm<T: Into<std::string::String>>(
2175 mut self,
2176 v: T,
2177 ) -> Self {
2178 self.0.request.copy_source_encryption_algorithm = v.into();
2179 self
2180 }
2181
2182 pub fn set_copy_source_encryption_key_bytes<T: Into<::bytes::Bytes>>(
2184 mut self,
2185 v: T,
2186 ) -> Self {
2187 self.0.request.copy_source_encryption_key_bytes = v.into();
2188 self
2189 }
2190
2191 pub fn set_copy_source_encryption_key_sha256_bytes<T: Into<::bytes::Bytes>>(
2193 mut self,
2194 v: T,
2195 ) -> Self {
2196 self.0.request.copy_source_encryption_key_sha256_bytes = v.into();
2197 self
2198 }
2199
2200 pub fn set_common_object_request_params<T>(mut self, v: T) -> Self
2202 where
2203 T: std::convert::Into<crate::model::CommonObjectRequestParams>,
2204 {
2205 self.0.request.common_object_request_params = std::option::Option::Some(v.into());
2206 self
2207 }
2208
2209 pub fn set_or_clear_common_object_request_params<T>(
2211 mut self,
2212 v: std::option::Option<T>,
2213 ) -> Self
2214 where
2215 T: std::convert::Into<crate::model::CommonObjectRequestParams>,
2216 {
2217 self.0.request.common_object_request_params = v.map(|x| x.into());
2218 self
2219 }
2220
2221 pub fn set_object_checksums<T>(mut self, v: T) -> Self
2223 where
2224 T: std::convert::Into<crate::model::ObjectChecksums>,
2225 {
2226 self.0.request.object_checksums = std::option::Option::Some(v.into());
2227 self
2228 }
2229
2230 pub fn set_or_clear_object_checksums<T>(mut self, v: std::option::Option<T>) -> Self
2232 where
2233 T: std::convert::Into<crate::model::ObjectChecksums>,
2234 {
2235 self.0.request.object_checksums = v.map(|x| x.into());
2236 self
2237 }
2238 }
2239
2240 #[doc(hidden)]
2241 impl gax::options::internal::RequestBuilder for RewriteObject {
2242 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2243 &mut self.0.options
2244 }
2245 }
2246
2247 #[derive(Clone, Debug)]
2265 pub struct MoveObject(RequestBuilder<crate::model::MoveObjectRequest>);
2266
2267 impl MoveObject {
2268 pub(crate) fn new(
2269 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2270 ) -> Self {
2271 Self(RequestBuilder::new(stub))
2272 }
2273
2274 pub fn with_request<V: Into<crate::model::MoveObjectRequest>>(mut self, v: V) -> Self {
2276 self.0.request = v.into();
2277 self
2278 }
2279
2280 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2282 self.0.options = v.into();
2283 self
2284 }
2285
2286 pub async fn send(self) -> Result<crate::model::Object> {
2288 (*self.0.stub)
2289 .move_object(self.0.request, self.0.options)
2290 .await
2291 .map(gax::response::Response::into_body)
2292 }
2293
2294 pub fn set_bucket<T: Into<std::string::String>>(mut self, v: T) -> Self {
2298 self.0.request.bucket = v.into();
2299 self
2300 }
2301
2302 pub fn set_source_object<T: Into<std::string::String>>(mut self, v: T) -> Self {
2306 self.0.request.source_object = v.into();
2307 self
2308 }
2309
2310 pub fn set_destination_object<T: Into<std::string::String>>(mut self, v: T) -> Self {
2314 self.0.request.destination_object = v.into();
2315 self
2316 }
2317
2318 pub fn set_if_source_generation_match<T>(mut self, v: T) -> Self
2320 where
2321 T: std::convert::Into<i64>,
2322 {
2323 self.0.request.if_source_generation_match = std::option::Option::Some(v.into());
2324 self
2325 }
2326
2327 pub fn set_or_clear_if_source_generation_match<T>(
2329 mut self,
2330 v: std::option::Option<T>,
2331 ) -> Self
2332 where
2333 T: std::convert::Into<i64>,
2334 {
2335 self.0.request.if_source_generation_match = v.map(|x| x.into());
2336 self
2337 }
2338
2339 pub fn set_if_source_generation_not_match<T>(mut self, v: T) -> Self
2341 where
2342 T: std::convert::Into<i64>,
2343 {
2344 self.0.request.if_source_generation_not_match = std::option::Option::Some(v.into());
2345 self
2346 }
2347
2348 pub fn set_or_clear_if_source_generation_not_match<T>(
2350 mut self,
2351 v: std::option::Option<T>,
2352 ) -> Self
2353 where
2354 T: std::convert::Into<i64>,
2355 {
2356 self.0.request.if_source_generation_not_match = v.map(|x| x.into());
2357 self
2358 }
2359
2360 pub fn set_if_source_metageneration_match<T>(mut self, v: T) -> Self
2362 where
2363 T: std::convert::Into<i64>,
2364 {
2365 self.0.request.if_source_metageneration_match = std::option::Option::Some(v.into());
2366 self
2367 }
2368
2369 pub fn set_or_clear_if_source_metageneration_match<T>(
2371 mut self,
2372 v: std::option::Option<T>,
2373 ) -> Self
2374 where
2375 T: std::convert::Into<i64>,
2376 {
2377 self.0.request.if_source_metageneration_match = v.map(|x| x.into());
2378 self
2379 }
2380
2381 pub fn set_if_source_metageneration_not_match<T>(mut self, v: T) -> Self
2383 where
2384 T: std::convert::Into<i64>,
2385 {
2386 self.0.request.if_source_metageneration_not_match = std::option::Option::Some(v.into());
2387 self
2388 }
2389
2390 pub fn set_or_clear_if_source_metageneration_not_match<T>(
2392 mut self,
2393 v: std::option::Option<T>,
2394 ) -> Self
2395 where
2396 T: std::convert::Into<i64>,
2397 {
2398 self.0.request.if_source_metageneration_not_match = v.map(|x| x.into());
2399 self
2400 }
2401
2402 pub fn set_if_generation_match<T>(mut self, v: T) -> Self
2404 where
2405 T: std::convert::Into<i64>,
2406 {
2407 self.0.request.if_generation_match = std::option::Option::Some(v.into());
2408 self
2409 }
2410
2411 pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
2413 where
2414 T: std::convert::Into<i64>,
2415 {
2416 self.0.request.if_generation_match = v.map(|x| x.into());
2417 self
2418 }
2419
2420 pub fn set_if_generation_not_match<T>(mut self, v: T) -> Self
2422 where
2423 T: std::convert::Into<i64>,
2424 {
2425 self.0.request.if_generation_not_match = std::option::Option::Some(v.into());
2426 self
2427 }
2428
2429 pub fn set_or_clear_if_generation_not_match<T>(mut self, v: std::option::Option<T>) -> Self
2431 where
2432 T: std::convert::Into<i64>,
2433 {
2434 self.0.request.if_generation_not_match = v.map(|x| x.into());
2435 self
2436 }
2437
2438 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
2440 where
2441 T: std::convert::Into<i64>,
2442 {
2443 self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
2444 self
2445 }
2446
2447 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
2449 where
2450 T: std::convert::Into<i64>,
2451 {
2452 self.0.request.if_metageneration_match = v.map(|x| x.into());
2453 self
2454 }
2455
2456 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
2458 where
2459 T: std::convert::Into<i64>,
2460 {
2461 self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
2462 self
2463 }
2464
2465 pub fn set_or_clear_if_metageneration_not_match<T>(
2467 mut self,
2468 v: std::option::Option<T>,
2469 ) -> Self
2470 where
2471 T: std::convert::Into<i64>,
2472 {
2473 self.0.request.if_metageneration_not_match = v.map(|x| x.into());
2474 self
2475 }
2476 }
2477
2478 #[doc(hidden)]
2479 impl gax::options::internal::RequestBuilder for MoveObject {
2480 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2481 &mut self.0.options
2482 }
2483 }
2484}