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 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
496 self.0.request.return_partial_success = v.into();
497 self
498 }
499 }
500
501 #[doc(hidden)]
502 impl gax::options::internal::RequestBuilder for ListBuckets {
503 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
504 &mut self.0.options
505 }
506 }
507
508 #[derive(Clone, Debug)]
526 pub struct LockBucketRetentionPolicy(
527 RequestBuilder<crate::model::LockBucketRetentionPolicyRequest>,
528 );
529
530 impl LockBucketRetentionPolicy {
531 pub(crate) fn new(
532 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
533 ) -> Self {
534 Self(RequestBuilder::new(stub))
535 }
536
537 pub fn with_request<V: Into<crate::model::LockBucketRetentionPolicyRequest>>(
539 mut self,
540 v: V,
541 ) -> Self {
542 self.0.request = v.into();
543 self
544 }
545
546 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
548 self.0.options = v.into();
549 self
550 }
551
552 pub async fn send(self) -> Result<crate::model::Bucket> {
554 (*self.0.stub)
555 .lock_bucket_retention_policy(self.0.request, self.0.options)
556 .await
557 .map(gax::response::Response::into_body)
558 }
559
560 pub fn set_bucket<T: Into<std::string::String>>(mut self, v: T) -> Self {
564 self.0.request.bucket = v.into();
565 self
566 }
567
568 pub fn set_if_metageneration_match<T: Into<i64>>(mut self, v: T) -> Self {
572 self.0.request.if_metageneration_match = v.into();
573 self
574 }
575 }
576
577 #[doc(hidden)]
578 impl gax::options::internal::RequestBuilder for LockBucketRetentionPolicy {
579 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
580 &mut self.0.options
581 }
582 }
583
584 #[derive(Clone, Debug)]
602 pub struct UpdateBucket(RequestBuilder<crate::model::UpdateBucketRequest>);
603
604 impl UpdateBucket {
605 pub(crate) fn new(
606 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
607 ) -> Self {
608 Self(RequestBuilder::new(stub))
609 }
610
611 pub fn with_request<V: Into<crate::model::UpdateBucketRequest>>(mut self, v: V) -> Self {
613 self.0.request = v.into();
614 self
615 }
616
617 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
619 self.0.options = v.into();
620 self
621 }
622
623 pub async fn send(self) -> Result<crate::model::Bucket> {
625 (*self.0.stub)
626 .update_bucket(self.0.request, self.0.options)
627 .await
628 .map(gax::response::Response::into_body)
629 }
630
631 pub fn set_bucket<T>(mut self, v: T) -> Self
635 where
636 T: std::convert::Into<crate::model::Bucket>,
637 {
638 self.0.request.bucket = std::option::Option::Some(v.into());
639 self
640 }
641
642 pub fn set_or_clear_bucket<T>(mut self, v: std::option::Option<T>) -> Self
646 where
647 T: std::convert::Into<crate::model::Bucket>,
648 {
649 self.0.request.bucket = v.map(|x| x.into());
650 self
651 }
652
653 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
655 where
656 T: std::convert::Into<i64>,
657 {
658 self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
659 self
660 }
661
662 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
664 where
665 T: std::convert::Into<i64>,
666 {
667 self.0.request.if_metageneration_match = v.map(|x| x.into());
668 self
669 }
670
671 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
673 where
674 T: std::convert::Into<i64>,
675 {
676 self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
677 self
678 }
679
680 pub fn set_or_clear_if_metageneration_not_match<T>(
682 mut self,
683 v: std::option::Option<T>,
684 ) -> Self
685 where
686 T: std::convert::Into<i64>,
687 {
688 self.0.request.if_metageneration_not_match = v.map(|x| x.into());
689 self
690 }
691
692 pub fn set_predefined_acl<T: Into<std::string::String>>(mut self, v: T) -> Self {
694 self.0.request.predefined_acl = v.into();
695 self
696 }
697
698 pub fn set_predefined_default_object_acl<T: Into<std::string::String>>(
700 mut self,
701 v: T,
702 ) -> Self {
703 self.0.request.predefined_default_object_acl = v.into();
704 self
705 }
706
707 pub fn set_update_mask<T>(mut self, v: T) -> Self
711 where
712 T: std::convert::Into<wkt::FieldMask>,
713 {
714 self.0.request.update_mask = std::option::Option::Some(v.into());
715 self
716 }
717
718 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
722 where
723 T: std::convert::Into<wkt::FieldMask>,
724 {
725 self.0.request.update_mask = v.map(|x| x.into());
726 self
727 }
728 }
729
730 #[doc(hidden)]
731 impl gax::options::internal::RequestBuilder for UpdateBucket {
732 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
733 &mut self.0.options
734 }
735 }
736
737 #[derive(Clone, Debug)]
755 pub struct ComposeObject(RequestBuilder<crate::model::ComposeObjectRequest>);
756
757 impl ComposeObject {
758 pub(crate) fn new(
759 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
760 ) -> Self {
761 Self(RequestBuilder::new(stub))
762 }
763
764 pub fn with_request<V: Into<crate::model::ComposeObjectRequest>>(mut self, v: V) -> Self {
766 self.0.request = v.into();
767 self
768 }
769
770 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
772 self.0.options = v.into();
773 self
774 }
775
776 pub async fn send(self) -> Result<crate::model::Object> {
778 (*self.0.stub)
779 .compose_object(self.0.request, self.0.options)
780 .await
781 .map(gax::response::Response::into_body)
782 }
783
784 pub fn set_destination<T>(mut self, v: T) -> Self
788 where
789 T: std::convert::Into<crate::model::Object>,
790 {
791 self.0.request.destination = std::option::Option::Some(v.into());
792 self
793 }
794
795 pub fn set_or_clear_destination<T>(mut self, v: std::option::Option<T>) -> Self
799 where
800 T: std::convert::Into<crate::model::Object>,
801 {
802 self.0.request.destination = v.map(|x| x.into());
803 self
804 }
805
806 pub fn set_source_objects<T, V>(mut self, v: T) -> Self
808 where
809 T: std::iter::IntoIterator<Item = V>,
810 V: std::convert::Into<crate::model::compose_object_request::SourceObject>,
811 {
812 use std::iter::Iterator;
813 self.0.request.source_objects = v.into_iter().map(|i| i.into()).collect();
814 self
815 }
816
817 pub fn set_destination_predefined_acl<T: Into<std::string::String>>(
819 mut self,
820 v: T,
821 ) -> Self {
822 self.0.request.destination_predefined_acl = v.into();
823 self
824 }
825
826 pub fn set_if_generation_match<T>(mut self, v: T) -> Self
828 where
829 T: std::convert::Into<i64>,
830 {
831 self.0.request.if_generation_match = std::option::Option::Some(v.into());
832 self
833 }
834
835 pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
837 where
838 T: std::convert::Into<i64>,
839 {
840 self.0.request.if_generation_match = v.map(|x| x.into());
841 self
842 }
843
844 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
846 where
847 T: std::convert::Into<i64>,
848 {
849 self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
850 self
851 }
852
853 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
855 where
856 T: std::convert::Into<i64>,
857 {
858 self.0.request.if_metageneration_match = v.map(|x| x.into());
859 self
860 }
861
862 pub fn set_kms_key<T: Into<std::string::String>>(mut self, v: T) -> Self {
864 self.0.request.kms_key = v.into();
865 self
866 }
867
868 pub fn set_common_object_request_params<T>(mut self, v: T) -> Self
870 where
871 T: std::convert::Into<crate::model::CommonObjectRequestParams>,
872 {
873 self.0.request.common_object_request_params = std::option::Option::Some(v.into());
874 self
875 }
876
877 pub fn set_or_clear_common_object_request_params<T>(
879 mut self,
880 v: std::option::Option<T>,
881 ) -> Self
882 where
883 T: std::convert::Into<crate::model::CommonObjectRequestParams>,
884 {
885 self.0.request.common_object_request_params = v.map(|x| x.into());
886 self
887 }
888
889 pub fn set_object_checksums<T>(mut self, v: T) -> Self
891 where
892 T: std::convert::Into<crate::model::ObjectChecksums>,
893 {
894 self.0.request.object_checksums = std::option::Option::Some(v.into());
895 self
896 }
897
898 pub fn set_or_clear_object_checksums<T>(mut self, v: std::option::Option<T>) -> Self
900 where
901 T: std::convert::Into<crate::model::ObjectChecksums>,
902 {
903 self.0.request.object_checksums = v.map(|x| x.into());
904 self
905 }
906 }
907
908 #[doc(hidden)]
909 impl gax::options::internal::RequestBuilder for ComposeObject {
910 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
911 &mut self.0.options
912 }
913 }
914
915 #[derive(Clone, Debug)]
933 pub struct DeleteObject(RequestBuilder<crate::model::DeleteObjectRequest>);
934
935 impl DeleteObject {
936 pub(crate) fn new(
937 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
938 ) -> Self {
939 Self(RequestBuilder::new(stub))
940 }
941
942 pub fn with_request<V: Into<crate::model::DeleteObjectRequest>>(mut self, v: V) -> Self {
944 self.0.request = v.into();
945 self
946 }
947
948 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
950 self.0.options = v.into();
951 self
952 }
953
954 pub async fn send(self) -> Result<()> {
956 (*self.0.stub)
957 .delete_object(self.0.request, self.0.options)
958 .await
959 .map(gax::response::Response::into_body)
960 }
961
962 pub fn set_bucket<T: Into<std::string::String>>(mut self, v: T) -> Self {
966 self.0.request.bucket = v.into();
967 self
968 }
969
970 pub fn set_object<T: Into<std::string::String>>(mut self, v: T) -> Self {
974 self.0.request.object = v.into();
975 self
976 }
977
978 pub fn set_generation<T: Into<i64>>(mut self, v: T) -> Self {
980 self.0.request.generation = v.into();
981 self
982 }
983
984 pub fn set_if_generation_match<T>(mut self, v: T) -> Self
986 where
987 T: std::convert::Into<i64>,
988 {
989 self.0.request.if_generation_match = std::option::Option::Some(v.into());
990 self
991 }
992
993 pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
995 where
996 T: std::convert::Into<i64>,
997 {
998 self.0.request.if_generation_match = v.map(|x| x.into());
999 self
1000 }
1001
1002 pub fn set_if_generation_not_match<T>(mut self, v: T) -> Self
1004 where
1005 T: std::convert::Into<i64>,
1006 {
1007 self.0.request.if_generation_not_match = std::option::Option::Some(v.into());
1008 self
1009 }
1010
1011 pub fn set_or_clear_if_generation_not_match<T>(mut self, v: std::option::Option<T>) -> Self
1013 where
1014 T: std::convert::Into<i64>,
1015 {
1016 self.0.request.if_generation_not_match = v.map(|x| x.into());
1017 self
1018 }
1019
1020 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
1022 where
1023 T: std::convert::Into<i64>,
1024 {
1025 self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
1026 self
1027 }
1028
1029 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
1031 where
1032 T: std::convert::Into<i64>,
1033 {
1034 self.0.request.if_metageneration_match = v.map(|x| x.into());
1035 self
1036 }
1037
1038 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
1040 where
1041 T: std::convert::Into<i64>,
1042 {
1043 self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
1044 self
1045 }
1046
1047 pub fn set_or_clear_if_metageneration_not_match<T>(
1049 mut self,
1050 v: std::option::Option<T>,
1051 ) -> Self
1052 where
1053 T: std::convert::Into<i64>,
1054 {
1055 self.0.request.if_metageneration_not_match = v.map(|x| x.into());
1056 self
1057 }
1058
1059 pub fn set_common_object_request_params<T>(mut self, v: T) -> Self
1061 where
1062 T: std::convert::Into<crate::model::CommonObjectRequestParams>,
1063 {
1064 self.0.request.common_object_request_params = std::option::Option::Some(v.into());
1065 self
1066 }
1067
1068 pub fn set_or_clear_common_object_request_params<T>(
1070 mut self,
1071 v: std::option::Option<T>,
1072 ) -> Self
1073 where
1074 T: std::convert::Into<crate::model::CommonObjectRequestParams>,
1075 {
1076 self.0.request.common_object_request_params = v.map(|x| x.into());
1077 self
1078 }
1079 }
1080
1081 #[doc(hidden)]
1082 impl gax::options::internal::RequestBuilder for DeleteObject {
1083 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1084 &mut self.0.options
1085 }
1086 }
1087
1088 #[derive(Clone, Debug)]
1106 pub struct RestoreObject(RequestBuilder<crate::model::RestoreObjectRequest>);
1107
1108 impl RestoreObject {
1109 pub(crate) fn new(
1110 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1111 ) -> Self {
1112 Self(RequestBuilder::new(stub))
1113 }
1114
1115 pub fn with_request<V: Into<crate::model::RestoreObjectRequest>>(mut self, v: V) -> Self {
1117 self.0.request = v.into();
1118 self
1119 }
1120
1121 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1123 self.0.options = v.into();
1124 self
1125 }
1126
1127 pub async fn send(self) -> Result<crate::model::Object> {
1129 (*self.0.stub)
1130 .restore_object(self.0.request, self.0.options)
1131 .await
1132 .map(gax::response::Response::into_body)
1133 }
1134
1135 pub fn set_bucket<T: Into<std::string::String>>(mut self, v: T) -> Self {
1139 self.0.request.bucket = v.into();
1140 self
1141 }
1142
1143 pub fn set_object<T: Into<std::string::String>>(mut self, v: T) -> Self {
1147 self.0.request.object = v.into();
1148 self
1149 }
1150
1151 pub fn set_generation<T: Into<i64>>(mut self, v: T) -> Self {
1155 self.0.request.generation = v.into();
1156 self
1157 }
1158
1159 pub fn set_restore_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1161 self.0.request.restore_token = v.into();
1162 self
1163 }
1164
1165 pub fn set_if_generation_match<T>(mut self, v: T) -> Self
1167 where
1168 T: std::convert::Into<i64>,
1169 {
1170 self.0.request.if_generation_match = std::option::Option::Some(v.into());
1171 self
1172 }
1173
1174 pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
1176 where
1177 T: std::convert::Into<i64>,
1178 {
1179 self.0.request.if_generation_match = v.map(|x| x.into());
1180 self
1181 }
1182
1183 pub fn set_if_generation_not_match<T>(mut self, v: T) -> Self
1185 where
1186 T: std::convert::Into<i64>,
1187 {
1188 self.0.request.if_generation_not_match = std::option::Option::Some(v.into());
1189 self
1190 }
1191
1192 pub fn set_or_clear_if_generation_not_match<T>(mut self, v: std::option::Option<T>) -> Self
1194 where
1195 T: std::convert::Into<i64>,
1196 {
1197 self.0.request.if_generation_not_match = v.map(|x| x.into());
1198 self
1199 }
1200
1201 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
1203 where
1204 T: std::convert::Into<i64>,
1205 {
1206 self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
1207 self
1208 }
1209
1210 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
1212 where
1213 T: std::convert::Into<i64>,
1214 {
1215 self.0.request.if_metageneration_match = v.map(|x| x.into());
1216 self
1217 }
1218
1219 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
1221 where
1222 T: std::convert::Into<i64>,
1223 {
1224 self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
1225 self
1226 }
1227
1228 pub fn set_or_clear_if_metageneration_not_match<T>(
1230 mut self,
1231 v: std::option::Option<T>,
1232 ) -> Self
1233 where
1234 T: std::convert::Into<i64>,
1235 {
1236 self.0.request.if_metageneration_not_match = v.map(|x| x.into());
1237 self
1238 }
1239
1240 pub fn set_copy_source_acl<T>(mut self, v: T) -> Self
1242 where
1243 T: std::convert::Into<bool>,
1244 {
1245 self.0.request.copy_source_acl = std::option::Option::Some(v.into());
1246 self
1247 }
1248
1249 pub fn set_or_clear_copy_source_acl<T>(mut self, v: std::option::Option<T>) -> Self
1251 where
1252 T: std::convert::Into<bool>,
1253 {
1254 self.0.request.copy_source_acl = v.map(|x| x.into());
1255 self
1256 }
1257
1258 pub fn set_common_object_request_params<T>(mut self, v: T) -> Self
1260 where
1261 T: std::convert::Into<crate::model::CommonObjectRequestParams>,
1262 {
1263 self.0.request.common_object_request_params = std::option::Option::Some(v.into());
1264 self
1265 }
1266
1267 pub fn set_or_clear_common_object_request_params<T>(
1269 mut self,
1270 v: std::option::Option<T>,
1271 ) -> Self
1272 where
1273 T: std::convert::Into<crate::model::CommonObjectRequestParams>,
1274 {
1275 self.0.request.common_object_request_params = v.map(|x| x.into());
1276 self
1277 }
1278 }
1279
1280 #[doc(hidden)]
1281 impl gax::options::internal::RequestBuilder for RestoreObject {
1282 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1283 &mut self.0.options
1284 }
1285 }
1286
1287 #[derive(Clone, Debug)]
1305 pub struct GetObject(RequestBuilder<crate::model::GetObjectRequest>);
1306
1307 impl GetObject {
1308 pub(crate) fn new(
1309 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1310 ) -> Self {
1311 Self(RequestBuilder::new(stub))
1312 }
1313
1314 pub fn with_request<V: Into<crate::model::GetObjectRequest>>(mut self, v: V) -> Self {
1316 self.0.request = v.into();
1317 self
1318 }
1319
1320 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1322 self.0.options = v.into();
1323 self
1324 }
1325
1326 pub async fn send(self) -> Result<crate::model::Object> {
1328 (*self.0.stub)
1329 .get_object(self.0.request, self.0.options)
1330 .await
1331 .map(gax::response::Response::into_body)
1332 }
1333
1334 pub fn set_bucket<T: Into<std::string::String>>(mut self, v: T) -> Self {
1338 self.0.request.bucket = v.into();
1339 self
1340 }
1341
1342 pub fn set_object<T: Into<std::string::String>>(mut self, v: T) -> Self {
1346 self.0.request.object = v.into();
1347 self
1348 }
1349
1350 pub fn set_generation<T: Into<i64>>(mut self, v: T) -> Self {
1352 self.0.request.generation = v.into();
1353 self
1354 }
1355
1356 pub fn set_soft_deleted<T>(mut self, v: T) -> Self
1358 where
1359 T: std::convert::Into<bool>,
1360 {
1361 self.0.request.soft_deleted = std::option::Option::Some(v.into());
1362 self
1363 }
1364
1365 pub fn set_or_clear_soft_deleted<T>(mut self, v: std::option::Option<T>) -> Self
1367 where
1368 T: std::convert::Into<bool>,
1369 {
1370 self.0.request.soft_deleted = v.map(|x| x.into());
1371 self
1372 }
1373
1374 pub fn set_if_generation_match<T>(mut self, v: T) -> Self
1376 where
1377 T: std::convert::Into<i64>,
1378 {
1379 self.0.request.if_generation_match = std::option::Option::Some(v.into());
1380 self
1381 }
1382
1383 pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
1385 where
1386 T: std::convert::Into<i64>,
1387 {
1388 self.0.request.if_generation_match = v.map(|x| x.into());
1389 self
1390 }
1391
1392 pub fn set_if_generation_not_match<T>(mut self, v: T) -> Self
1394 where
1395 T: std::convert::Into<i64>,
1396 {
1397 self.0.request.if_generation_not_match = std::option::Option::Some(v.into());
1398 self
1399 }
1400
1401 pub fn set_or_clear_if_generation_not_match<T>(mut self, v: std::option::Option<T>) -> Self
1403 where
1404 T: std::convert::Into<i64>,
1405 {
1406 self.0.request.if_generation_not_match = v.map(|x| x.into());
1407 self
1408 }
1409
1410 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
1412 where
1413 T: std::convert::Into<i64>,
1414 {
1415 self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
1416 self
1417 }
1418
1419 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
1421 where
1422 T: std::convert::Into<i64>,
1423 {
1424 self.0.request.if_metageneration_match = v.map(|x| x.into());
1425 self
1426 }
1427
1428 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
1430 where
1431 T: std::convert::Into<i64>,
1432 {
1433 self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
1434 self
1435 }
1436
1437 pub fn set_or_clear_if_metageneration_not_match<T>(
1439 mut self,
1440 v: std::option::Option<T>,
1441 ) -> Self
1442 where
1443 T: std::convert::Into<i64>,
1444 {
1445 self.0.request.if_metageneration_not_match = v.map(|x| x.into());
1446 self
1447 }
1448
1449 pub fn set_common_object_request_params<T>(mut self, v: T) -> Self
1451 where
1452 T: std::convert::Into<crate::model::CommonObjectRequestParams>,
1453 {
1454 self.0.request.common_object_request_params = std::option::Option::Some(v.into());
1455 self
1456 }
1457
1458 pub fn set_or_clear_common_object_request_params<T>(
1460 mut self,
1461 v: std::option::Option<T>,
1462 ) -> Self
1463 where
1464 T: std::convert::Into<crate::model::CommonObjectRequestParams>,
1465 {
1466 self.0.request.common_object_request_params = v.map(|x| x.into());
1467 self
1468 }
1469
1470 pub fn set_read_mask<T>(mut self, v: T) -> Self
1472 where
1473 T: std::convert::Into<wkt::FieldMask>,
1474 {
1475 self.0.request.read_mask = std::option::Option::Some(v.into());
1476 self
1477 }
1478
1479 pub fn set_or_clear_read_mask<T>(mut self, v: std::option::Option<T>) -> Self
1481 where
1482 T: std::convert::Into<wkt::FieldMask>,
1483 {
1484 self.0.request.read_mask = v.map(|x| x.into());
1485 self
1486 }
1487
1488 pub fn set_restore_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1490 self.0.request.restore_token = v.into();
1491 self
1492 }
1493 }
1494
1495 #[doc(hidden)]
1496 impl gax::options::internal::RequestBuilder for GetObject {
1497 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1498 &mut self.0.options
1499 }
1500 }
1501
1502 #[derive(Clone, Debug)]
1520 pub struct UpdateObject(RequestBuilder<crate::model::UpdateObjectRequest>);
1521
1522 impl UpdateObject {
1523 pub(crate) fn new(
1524 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1525 ) -> Self {
1526 Self(RequestBuilder::new(stub))
1527 }
1528
1529 pub fn with_request<V: Into<crate::model::UpdateObjectRequest>>(mut self, v: V) -> Self {
1531 self.0.request = v.into();
1532 self
1533 }
1534
1535 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1537 self.0.options = v.into();
1538 self
1539 }
1540
1541 pub async fn send(self) -> Result<crate::model::Object> {
1543 (*self.0.stub)
1544 .update_object(self.0.request, self.0.options)
1545 .await
1546 .map(gax::response::Response::into_body)
1547 }
1548
1549 pub fn set_object<T>(mut self, v: T) -> Self
1553 where
1554 T: std::convert::Into<crate::model::Object>,
1555 {
1556 self.0.request.object = std::option::Option::Some(v.into());
1557 self
1558 }
1559
1560 pub fn set_or_clear_object<T>(mut self, v: std::option::Option<T>) -> Self
1564 where
1565 T: std::convert::Into<crate::model::Object>,
1566 {
1567 self.0.request.object = v.map(|x| x.into());
1568 self
1569 }
1570
1571 pub fn set_if_generation_match<T>(mut self, v: T) -> Self
1573 where
1574 T: std::convert::Into<i64>,
1575 {
1576 self.0.request.if_generation_match = std::option::Option::Some(v.into());
1577 self
1578 }
1579
1580 pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
1582 where
1583 T: std::convert::Into<i64>,
1584 {
1585 self.0.request.if_generation_match = v.map(|x| x.into());
1586 self
1587 }
1588
1589 pub fn set_if_generation_not_match<T>(mut self, v: T) -> Self
1591 where
1592 T: std::convert::Into<i64>,
1593 {
1594 self.0.request.if_generation_not_match = std::option::Option::Some(v.into());
1595 self
1596 }
1597
1598 pub fn set_or_clear_if_generation_not_match<T>(mut self, v: std::option::Option<T>) -> Self
1600 where
1601 T: std::convert::Into<i64>,
1602 {
1603 self.0.request.if_generation_not_match = v.map(|x| x.into());
1604 self
1605 }
1606
1607 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
1609 where
1610 T: std::convert::Into<i64>,
1611 {
1612 self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
1613 self
1614 }
1615
1616 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
1618 where
1619 T: std::convert::Into<i64>,
1620 {
1621 self.0.request.if_metageneration_match = v.map(|x| x.into());
1622 self
1623 }
1624
1625 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
1627 where
1628 T: std::convert::Into<i64>,
1629 {
1630 self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
1631 self
1632 }
1633
1634 pub fn set_or_clear_if_metageneration_not_match<T>(
1636 mut self,
1637 v: std::option::Option<T>,
1638 ) -> Self
1639 where
1640 T: std::convert::Into<i64>,
1641 {
1642 self.0.request.if_metageneration_not_match = v.map(|x| x.into());
1643 self
1644 }
1645
1646 pub fn set_predefined_acl<T: Into<std::string::String>>(mut self, v: T) -> Self {
1648 self.0.request.predefined_acl = v.into();
1649 self
1650 }
1651
1652 pub fn set_update_mask<T>(mut self, v: T) -> Self
1656 where
1657 T: std::convert::Into<wkt::FieldMask>,
1658 {
1659 self.0.request.update_mask = std::option::Option::Some(v.into());
1660 self
1661 }
1662
1663 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1667 where
1668 T: std::convert::Into<wkt::FieldMask>,
1669 {
1670 self.0.request.update_mask = v.map(|x| x.into());
1671 self
1672 }
1673
1674 pub fn set_common_object_request_params<T>(mut self, v: T) -> Self
1676 where
1677 T: std::convert::Into<crate::model::CommonObjectRequestParams>,
1678 {
1679 self.0.request.common_object_request_params = std::option::Option::Some(v.into());
1680 self
1681 }
1682
1683 pub fn set_or_clear_common_object_request_params<T>(
1685 mut self,
1686 v: std::option::Option<T>,
1687 ) -> Self
1688 where
1689 T: std::convert::Into<crate::model::CommonObjectRequestParams>,
1690 {
1691 self.0.request.common_object_request_params = v.map(|x| x.into());
1692 self
1693 }
1694
1695 pub fn set_override_unlocked_retention<T: Into<bool>>(mut self, v: T) -> Self {
1697 self.0.request.override_unlocked_retention = v.into();
1698 self
1699 }
1700 }
1701
1702 #[doc(hidden)]
1703 impl gax::options::internal::RequestBuilder for UpdateObject {
1704 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1705 &mut self.0.options
1706 }
1707 }
1708
1709 #[derive(Clone, Debug)]
1731 pub struct ListObjects(RequestBuilder<crate::model::ListObjectsRequest>);
1732
1733 impl ListObjects {
1734 pub(crate) fn new(
1735 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1736 ) -> Self {
1737 Self(RequestBuilder::new(stub))
1738 }
1739
1740 pub fn with_request<V: Into<crate::model::ListObjectsRequest>>(mut self, v: V) -> Self {
1742 self.0.request = v.into();
1743 self
1744 }
1745
1746 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1748 self.0.options = v.into();
1749 self
1750 }
1751
1752 pub async fn send(self) -> Result<crate::model::ListObjectsResponse> {
1754 (*self.0.stub)
1755 .list_objects(self.0.request, self.0.options)
1756 .await
1757 .map(gax::response::Response::into_body)
1758 }
1759
1760 pub fn by_page(
1762 self,
1763 ) -> impl gax::paginator::Paginator<crate::model::ListObjectsResponse, gax::error::Error>
1764 {
1765 use std::clone::Clone;
1766 let token = self.0.request.page_token.clone();
1767 let execute = move |token: String| {
1768 let mut builder = self.clone();
1769 builder.0.request = builder.0.request.set_page_token(token);
1770 builder.send()
1771 };
1772 gax::paginator::internal::new_paginator(token, execute)
1773 }
1774
1775 pub fn by_item(
1777 self,
1778 ) -> impl gax::paginator::ItemPaginator<crate::model::ListObjectsResponse, gax::error::Error>
1779 {
1780 use gax::paginator::Paginator;
1781 self.by_page().items()
1782 }
1783
1784 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1788 self.0.request.parent = v.into();
1789 self
1790 }
1791
1792 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1794 self.0.request.page_size = v.into();
1795 self
1796 }
1797
1798 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1800 self.0.request.page_token = v.into();
1801 self
1802 }
1803
1804 pub fn set_delimiter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1806 self.0.request.delimiter = v.into();
1807 self
1808 }
1809
1810 pub fn set_include_trailing_delimiter<T: Into<bool>>(mut self, v: T) -> Self {
1812 self.0.request.include_trailing_delimiter = v.into();
1813 self
1814 }
1815
1816 pub fn set_prefix<T: Into<std::string::String>>(mut self, v: T) -> Self {
1818 self.0.request.prefix = v.into();
1819 self
1820 }
1821
1822 pub fn set_versions<T: Into<bool>>(mut self, v: T) -> Self {
1824 self.0.request.versions = v.into();
1825 self
1826 }
1827
1828 pub fn set_read_mask<T>(mut self, v: T) -> Self
1830 where
1831 T: std::convert::Into<wkt::FieldMask>,
1832 {
1833 self.0.request.read_mask = std::option::Option::Some(v.into());
1834 self
1835 }
1836
1837 pub fn set_or_clear_read_mask<T>(mut self, v: std::option::Option<T>) -> Self
1839 where
1840 T: std::convert::Into<wkt::FieldMask>,
1841 {
1842 self.0.request.read_mask = v.map(|x| x.into());
1843 self
1844 }
1845
1846 pub fn set_lexicographic_start<T: Into<std::string::String>>(mut self, v: T) -> Self {
1848 self.0.request.lexicographic_start = v.into();
1849 self
1850 }
1851
1852 pub fn set_lexicographic_end<T: Into<std::string::String>>(mut self, v: T) -> Self {
1854 self.0.request.lexicographic_end = v.into();
1855 self
1856 }
1857
1858 pub fn set_soft_deleted<T: Into<bool>>(mut self, v: T) -> Self {
1860 self.0.request.soft_deleted = v.into();
1861 self
1862 }
1863
1864 pub fn set_include_folders_as_prefixes<T: Into<bool>>(mut self, v: T) -> Self {
1866 self.0.request.include_folders_as_prefixes = v.into();
1867 self
1868 }
1869
1870 pub fn set_match_glob<T: Into<std::string::String>>(mut self, v: T) -> Self {
1872 self.0.request.match_glob = v.into();
1873 self
1874 }
1875
1876 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1878 self.0.request.filter = v.into();
1879 self
1880 }
1881 }
1882
1883 #[doc(hidden)]
1884 impl gax::options::internal::RequestBuilder for ListObjects {
1885 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1886 &mut self.0.options
1887 }
1888 }
1889
1890 #[derive(Clone, Debug)]
1908 pub struct RewriteObject(RequestBuilder<crate::model::RewriteObjectRequest>);
1909
1910 impl RewriteObject {
1911 pub(crate) fn new(
1912 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1913 ) -> Self {
1914 Self(RequestBuilder::new(stub))
1915 }
1916
1917 pub fn with_request<V: Into<crate::model::RewriteObjectRequest>>(mut self, v: V) -> Self {
1919 self.0.request = v.into();
1920 self
1921 }
1922
1923 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1925 self.0.options = v.into();
1926 self
1927 }
1928
1929 pub async fn send(self) -> Result<crate::model::RewriteResponse> {
1931 (*self.0.stub)
1932 .rewrite_object(self.0.request, self.0.options)
1933 .await
1934 .map(gax::response::Response::into_body)
1935 }
1936
1937 pub fn set_destination_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1941 self.0.request.destination_name = v.into();
1942 self
1943 }
1944
1945 pub fn set_destination_bucket<T: Into<std::string::String>>(mut self, v: T) -> Self {
1949 self.0.request.destination_bucket = v.into();
1950 self
1951 }
1952
1953 pub fn set_destination_kms_key<T: Into<std::string::String>>(mut self, v: T) -> Self {
1955 self.0.request.destination_kms_key = v.into();
1956 self
1957 }
1958
1959 pub fn set_destination<T>(mut self, v: T) -> Self
1961 where
1962 T: std::convert::Into<crate::model::Object>,
1963 {
1964 self.0.request.destination = std::option::Option::Some(v.into());
1965 self
1966 }
1967
1968 pub fn set_or_clear_destination<T>(mut self, v: std::option::Option<T>) -> Self
1970 where
1971 T: std::convert::Into<crate::model::Object>,
1972 {
1973 self.0.request.destination = v.map(|x| x.into());
1974 self
1975 }
1976
1977 pub fn set_source_bucket<T: Into<std::string::String>>(mut self, v: T) -> Self {
1981 self.0.request.source_bucket = v.into();
1982 self
1983 }
1984
1985 pub fn set_source_object<T: Into<std::string::String>>(mut self, v: T) -> Self {
1989 self.0.request.source_object = v.into();
1990 self
1991 }
1992
1993 pub fn set_source_generation<T: Into<i64>>(mut self, v: T) -> Self {
1995 self.0.request.source_generation = v.into();
1996 self
1997 }
1998
1999 pub fn set_rewrite_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2001 self.0.request.rewrite_token = v.into();
2002 self
2003 }
2004
2005 pub fn set_destination_predefined_acl<T: Into<std::string::String>>(
2007 mut self,
2008 v: T,
2009 ) -> Self {
2010 self.0.request.destination_predefined_acl = v.into();
2011 self
2012 }
2013
2014 pub fn set_if_generation_match<T>(mut self, v: T) -> Self
2016 where
2017 T: std::convert::Into<i64>,
2018 {
2019 self.0.request.if_generation_match = std::option::Option::Some(v.into());
2020 self
2021 }
2022
2023 pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
2025 where
2026 T: std::convert::Into<i64>,
2027 {
2028 self.0.request.if_generation_match = v.map(|x| x.into());
2029 self
2030 }
2031
2032 pub fn set_if_generation_not_match<T>(mut self, v: T) -> Self
2034 where
2035 T: std::convert::Into<i64>,
2036 {
2037 self.0.request.if_generation_not_match = std::option::Option::Some(v.into());
2038 self
2039 }
2040
2041 pub fn set_or_clear_if_generation_not_match<T>(mut self, v: std::option::Option<T>) -> Self
2043 where
2044 T: std::convert::Into<i64>,
2045 {
2046 self.0.request.if_generation_not_match = v.map(|x| x.into());
2047 self
2048 }
2049
2050 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
2052 where
2053 T: std::convert::Into<i64>,
2054 {
2055 self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
2056 self
2057 }
2058
2059 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
2061 where
2062 T: std::convert::Into<i64>,
2063 {
2064 self.0.request.if_metageneration_match = v.map(|x| x.into());
2065 self
2066 }
2067
2068 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
2070 where
2071 T: std::convert::Into<i64>,
2072 {
2073 self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
2074 self
2075 }
2076
2077 pub fn set_or_clear_if_metageneration_not_match<T>(
2079 mut self,
2080 v: std::option::Option<T>,
2081 ) -> Self
2082 where
2083 T: std::convert::Into<i64>,
2084 {
2085 self.0.request.if_metageneration_not_match = v.map(|x| x.into());
2086 self
2087 }
2088
2089 pub fn set_if_source_generation_match<T>(mut self, v: T) -> Self
2091 where
2092 T: std::convert::Into<i64>,
2093 {
2094 self.0.request.if_source_generation_match = std::option::Option::Some(v.into());
2095 self
2096 }
2097
2098 pub fn set_or_clear_if_source_generation_match<T>(
2100 mut self,
2101 v: std::option::Option<T>,
2102 ) -> Self
2103 where
2104 T: std::convert::Into<i64>,
2105 {
2106 self.0.request.if_source_generation_match = v.map(|x| x.into());
2107 self
2108 }
2109
2110 pub fn set_if_source_generation_not_match<T>(mut self, v: T) -> Self
2112 where
2113 T: std::convert::Into<i64>,
2114 {
2115 self.0.request.if_source_generation_not_match = std::option::Option::Some(v.into());
2116 self
2117 }
2118
2119 pub fn set_or_clear_if_source_generation_not_match<T>(
2121 mut self,
2122 v: std::option::Option<T>,
2123 ) -> Self
2124 where
2125 T: std::convert::Into<i64>,
2126 {
2127 self.0.request.if_source_generation_not_match = v.map(|x| x.into());
2128 self
2129 }
2130
2131 pub fn set_if_source_metageneration_match<T>(mut self, v: T) -> Self
2133 where
2134 T: std::convert::Into<i64>,
2135 {
2136 self.0.request.if_source_metageneration_match = std::option::Option::Some(v.into());
2137 self
2138 }
2139
2140 pub fn set_or_clear_if_source_metageneration_match<T>(
2142 mut self,
2143 v: std::option::Option<T>,
2144 ) -> Self
2145 where
2146 T: std::convert::Into<i64>,
2147 {
2148 self.0.request.if_source_metageneration_match = v.map(|x| x.into());
2149 self
2150 }
2151
2152 pub fn set_if_source_metageneration_not_match<T>(mut self, v: T) -> Self
2154 where
2155 T: std::convert::Into<i64>,
2156 {
2157 self.0.request.if_source_metageneration_not_match = std::option::Option::Some(v.into());
2158 self
2159 }
2160
2161 pub fn set_or_clear_if_source_metageneration_not_match<T>(
2163 mut self,
2164 v: std::option::Option<T>,
2165 ) -> Self
2166 where
2167 T: std::convert::Into<i64>,
2168 {
2169 self.0.request.if_source_metageneration_not_match = v.map(|x| x.into());
2170 self
2171 }
2172
2173 pub fn set_max_bytes_rewritten_per_call<T: Into<i64>>(mut self, v: T) -> Self {
2175 self.0.request.max_bytes_rewritten_per_call = v.into();
2176 self
2177 }
2178
2179 pub fn set_copy_source_encryption_algorithm<T: Into<std::string::String>>(
2181 mut self,
2182 v: T,
2183 ) -> Self {
2184 self.0.request.copy_source_encryption_algorithm = v.into();
2185 self
2186 }
2187
2188 pub fn set_copy_source_encryption_key_bytes<T: Into<::bytes::Bytes>>(
2190 mut self,
2191 v: T,
2192 ) -> Self {
2193 self.0.request.copy_source_encryption_key_bytes = v.into();
2194 self
2195 }
2196
2197 pub fn set_copy_source_encryption_key_sha256_bytes<T: Into<::bytes::Bytes>>(
2199 mut self,
2200 v: T,
2201 ) -> Self {
2202 self.0.request.copy_source_encryption_key_sha256_bytes = v.into();
2203 self
2204 }
2205
2206 pub fn set_common_object_request_params<T>(mut self, v: T) -> Self
2208 where
2209 T: std::convert::Into<crate::model::CommonObjectRequestParams>,
2210 {
2211 self.0.request.common_object_request_params = std::option::Option::Some(v.into());
2212 self
2213 }
2214
2215 pub fn set_or_clear_common_object_request_params<T>(
2217 mut self,
2218 v: std::option::Option<T>,
2219 ) -> Self
2220 where
2221 T: std::convert::Into<crate::model::CommonObjectRequestParams>,
2222 {
2223 self.0.request.common_object_request_params = v.map(|x| x.into());
2224 self
2225 }
2226
2227 pub fn set_object_checksums<T>(mut self, v: T) -> Self
2229 where
2230 T: std::convert::Into<crate::model::ObjectChecksums>,
2231 {
2232 self.0.request.object_checksums = std::option::Option::Some(v.into());
2233 self
2234 }
2235
2236 pub fn set_or_clear_object_checksums<T>(mut self, v: std::option::Option<T>) -> Self
2238 where
2239 T: std::convert::Into<crate::model::ObjectChecksums>,
2240 {
2241 self.0.request.object_checksums = v.map(|x| x.into());
2242 self
2243 }
2244 }
2245
2246 #[doc(hidden)]
2247 impl gax::options::internal::RequestBuilder for RewriteObject {
2248 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2249 &mut self.0.options
2250 }
2251 }
2252
2253 #[derive(Clone, Debug)]
2271 pub struct MoveObject(RequestBuilder<crate::model::MoveObjectRequest>);
2272
2273 impl MoveObject {
2274 pub(crate) fn new(
2275 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2276 ) -> Self {
2277 Self(RequestBuilder::new(stub))
2278 }
2279
2280 pub fn with_request<V: Into<crate::model::MoveObjectRequest>>(mut self, v: V) -> Self {
2282 self.0.request = v.into();
2283 self
2284 }
2285
2286 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2288 self.0.options = v.into();
2289 self
2290 }
2291
2292 pub async fn send(self) -> Result<crate::model::Object> {
2294 (*self.0.stub)
2295 .move_object(self.0.request, self.0.options)
2296 .await
2297 .map(gax::response::Response::into_body)
2298 }
2299
2300 pub fn set_bucket<T: Into<std::string::String>>(mut self, v: T) -> Self {
2304 self.0.request.bucket = v.into();
2305 self
2306 }
2307
2308 pub fn set_source_object<T: Into<std::string::String>>(mut self, v: T) -> Self {
2312 self.0.request.source_object = v.into();
2313 self
2314 }
2315
2316 pub fn set_destination_object<T: Into<std::string::String>>(mut self, v: T) -> Self {
2320 self.0.request.destination_object = v.into();
2321 self
2322 }
2323
2324 pub fn set_if_source_generation_match<T>(mut self, v: T) -> Self
2326 where
2327 T: std::convert::Into<i64>,
2328 {
2329 self.0.request.if_source_generation_match = std::option::Option::Some(v.into());
2330 self
2331 }
2332
2333 pub fn set_or_clear_if_source_generation_match<T>(
2335 mut self,
2336 v: std::option::Option<T>,
2337 ) -> Self
2338 where
2339 T: std::convert::Into<i64>,
2340 {
2341 self.0.request.if_source_generation_match = v.map(|x| x.into());
2342 self
2343 }
2344
2345 pub fn set_if_source_generation_not_match<T>(mut self, v: T) -> Self
2347 where
2348 T: std::convert::Into<i64>,
2349 {
2350 self.0.request.if_source_generation_not_match = std::option::Option::Some(v.into());
2351 self
2352 }
2353
2354 pub fn set_or_clear_if_source_generation_not_match<T>(
2356 mut self,
2357 v: std::option::Option<T>,
2358 ) -> Self
2359 where
2360 T: std::convert::Into<i64>,
2361 {
2362 self.0.request.if_source_generation_not_match = v.map(|x| x.into());
2363 self
2364 }
2365
2366 pub fn set_if_source_metageneration_match<T>(mut self, v: T) -> Self
2368 where
2369 T: std::convert::Into<i64>,
2370 {
2371 self.0.request.if_source_metageneration_match = std::option::Option::Some(v.into());
2372 self
2373 }
2374
2375 pub fn set_or_clear_if_source_metageneration_match<T>(
2377 mut self,
2378 v: std::option::Option<T>,
2379 ) -> Self
2380 where
2381 T: std::convert::Into<i64>,
2382 {
2383 self.0.request.if_source_metageneration_match = v.map(|x| x.into());
2384 self
2385 }
2386
2387 pub fn set_if_source_metageneration_not_match<T>(mut self, v: T) -> Self
2389 where
2390 T: std::convert::Into<i64>,
2391 {
2392 self.0.request.if_source_metageneration_not_match = std::option::Option::Some(v.into());
2393 self
2394 }
2395
2396 pub fn set_or_clear_if_source_metageneration_not_match<T>(
2398 mut self,
2399 v: std::option::Option<T>,
2400 ) -> Self
2401 where
2402 T: std::convert::Into<i64>,
2403 {
2404 self.0.request.if_source_metageneration_not_match = v.map(|x| x.into());
2405 self
2406 }
2407
2408 pub fn set_if_generation_match<T>(mut self, v: T) -> Self
2410 where
2411 T: std::convert::Into<i64>,
2412 {
2413 self.0.request.if_generation_match = std::option::Option::Some(v.into());
2414 self
2415 }
2416
2417 pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
2419 where
2420 T: std::convert::Into<i64>,
2421 {
2422 self.0.request.if_generation_match = v.map(|x| x.into());
2423 self
2424 }
2425
2426 pub fn set_if_generation_not_match<T>(mut self, v: T) -> Self
2428 where
2429 T: std::convert::Into<i64>,
2430 {
2431 self.0.request.if_generation_not_match = std::option::Option::Some(v.into());
2432 self
2433 }
2434
2435 pub fn set_or_clear_if_generation_not_match<T>(mut self, v: std::option::Option<T>) -> Self
2437 where
2438 T: std::convert::Into<i64>,
2439 {
2440 self.0.request.if_generation_not_match = v.map(|x| x.into());
2441 self
2442 }
2443
2444 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
2446 where
2447 T: std::convert::Into<i64>,
2448 {
2449 self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
2450 self
2451 }
2452
2453 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
2455 where
2456 T: std::convert::Into<i64>,
2457 {
2458 self.0.request.if_metageneration_match = v.map(|x| x.into());
2459 self
2460 }
2461
2462 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
2464 where
2465 T: std::convert::Into<i64>,
2466 {
2467 self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
2468 self
2469 }
2470
2471 pub fn set_or_clear_if_metageneration_not_match<T>(
2473 mut self,
2474 v: std::option::Option<T>,
2475 ) -> Self
2476 where
2477 T: std::convert::Into<i64>,
2478 {
2479 self.0.request.if_metageneration_not_match = v.map(|x| x.into());
2480 self
2481 }
2482 }
2483
2484 #[doc(hidden)]
2485 impl gax::options::internal::RequestBuilder for MoveObject {
2486 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2487 &mut self.0.options
2488 }
2489 }
2490}