1pub mod storage_control {
19 use crate::Result;
20
21 #[derive(Clone, Debug)]
23 pub(crate) struct RequestBuilder<R: std::default::Default> {
24 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
25 request: R,
26 options: crate::RequestOptions,
27 }
28
29 impl<R> RequestBuilder<R>
30 where
31 R: std::default::Default,
32 {
33 pub(crate) fn new(
34 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
35 ) -> Self {
36 Self {
37 stub,
38 request: R::default(),
39 options: crate::RequestOptions::default(),
40 }
41 }
42 }
43
44 #[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<crate::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(crate::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 crate::RequestBuilder for DeleteBucket {
140 fn request_options(&mut self) -> &mut crate::RequestOptions {
141 &mut self.0.options
142 }
143 }
144
145 #[derive(Clone, Debug)]
162 pub struct GetBucket(RequestBuilder<crate::model::GetBucketRequest>);
163
164 impl GetBucket {
165 pub(crate) fn new(
166 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
167 ) -> Self {
168 Self(RequestBuilder::new(stub))
169 }
170
171 pub fn with_request<V: Into<crate::model::GetBucketRequest>>(mut self, v: V) -> Self {
173 self.0.request = v.into();
174 self
175 }
176
177 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
179 self.0.options = v.into();
180 self
181 }
182
183 pub async fn send(self) -> Result<crate::model::Bucket> {
185 (*self.0.stub)
186 .get_bucket(self.0.request, self.0.options)
187 .await
188 .map(crate::Response::into_body)
189 }
190
191 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
195 self.0.request.name = v.into();
196 self
197 }
198
199 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
201 where
202 T: std::convert::Into<i64>,
203 {
204 self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
205 self
206 }
207
208 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
210 where
211 T: std::convert::Into<i64>,
212 {
213 self.0.request.if_metageneration_match = v.map(|x| x.into());
214 self
215 }
216
217 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
219 where
220 T: std::convert::Into<i64>,
221 {
222 self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
223 self
224 }
225
226 pub fn set_or_clear_if_metageneration_not_match<T>(
228 mut self,
229 v: std::option::Option<T>,
230 ) -> Self
231 where
232 T: std::convert::Into<i64>,
233 {
234 self.0.request.if_metageneration_not_match = v.map(|x| x.into());
235 self
236 }
237
238 pub fn set_read_mask<T>(mut self, v: T) -> Self
240 where
241 T: std::convert::Into<wkt::FieldMask>,
242 {
243 self.0.request.read_mask = std::option::Option::Some(v.into());
244 self
245 }
246
247 pub fn set_or_clear_read_mask<T>(mut self, v: std::option::Option<T>) -> Self
249 where
250 T: std::convert::Into<wkt::FieldMask>,
251 {
252 self.0.request.read_mask = v.map(|x| x.into());
253 self
254 }
255 }
256
257 #[doc(hidden)]
258 impl crate::RequestBuilder for GetBucket {
259 fn request_options(&mut self) -> &mut crate::RequestOptions {
260 &mut self.0.options
261 }
262 }
263
264 #[derive(Clone, Debug)]
281 pub struct CreateBucket(RequestBuilder<crate::model::CreateBucketRequest>);
282
283 impl CreateBucket {
284 pub(crate) fn new(
285 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
286 ) -> Self {
287 Self(RequestBuilder::new(stub))
288 }
289
290 pub fn with_request<V: Into<crate::model::CreateBucketRequest>>(mut self, v: V) -> Self {
292 self.0.request = v.into();
293 self
294 }
295
296 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
298 self.0.options = v.into();
299 self
300 }
301
302 pub async fn send(self) -> Result<crate::model::Bucket> {
304 (*self.0.stub)
305 .create_bucket(self.0.request, self.0.options)
306 .await
307 .map(crate::Response::into_body)
308 }
309
310 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
314 self.0.request.parent = v.into();
315 self
316 }
317
318 pub fn set_bucket<T>(mut self, v: T) -> Self
320 where
321 T: std::convert::Into<crate::model::Bucket>,
322 {
323 self.0.request.bucket = std::option::Option::Some(v.into());
324 self
325 }
326
327 pub fn set_or_clear_bucket<T>(mut self, v: std::option::Option<T>) -> Self
329 where
330 T: std::convert::Into<crate::model::Bucket>,
331 {
332 self.0.request.bucket = v.map(|x| x.into());
333 self
334 }
335
336 pub fn set_bucket_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
340 self.0.request.bucket_id = v.into();
341 self
342 }
343
344 pub fn set_predefined_acl<T: Into<std::string::String>>(mut self, v: T) -> Self {
346 self.0.request.predefined_acl = v.into();
347 self
348 }
349
350 pub fn set_predefined_default_object_acl<T: Into<std::string::String>>(
352 mut self,
353 v: T,
354 ) -> Self {
355 self.0.request.predefined_default_object_acl = v.into();
356 self
357 }
358
359 pub fn set_enable_object_retention<T: Into<bool>>(mut self, v: T) -> Self {
361 self.0.request.enable_object_retention = v.into();
362 self
363 }
364 }
365
366 #[doc(hidden)]
367 impl crate::RequestBuilder for CreateBucket {
368 fn request_options(&mut self) -> &mut crate::RequestOptions {
369 &mut self.0.options
370 }
371 }
372
373 #[derive(Clone, Debug)]
394 pub struct ListBuckets(RequestBuilder<crate::model::ListBucketsRequest>);
395
396 impl ListBuckets {
397 pub(crate) fn new(
398 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
399 ) -> Self {
400 Self(RequestBuilder::new(stub))
401 }
402
403 pub fn with_request<V: Into<crate::model::ListBucketsRequest>>(mut self, v: V) -> Self {
405 self.0.request = v.into();
406 self
407 }
408
409 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
411 self.0.options = v.into();
412 self
413 }
414
415 pub async fn send(self) -> Result<crate::model::ListBucketsResponse> {
417 (*self.0.stub)
418 .list_buckets(self.0.request, self.0.options)
419 .await
420 .map(crate::Response::into_body)
421 }
422
423 pub fn by_page(
425 self,
426 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListBucketsResponse, crate::Error>
427 {
428 use std::clone::Clone;
429 let token = self.0.request.page_token.clone();
430 let execute = move |token: String| {
431 let mut builder = self.clone();
432 builder.0.request = builder.0.request.set_page_token(token);
433 builder.send()
434 };
435 google_cloud_gax::paginator::internal::new_paginator(token, execute)
436 }
437
438 pub fn by_item(
440 self,
441 ) -> impl google_cloud_gax::paginator::ItemPaginator<
442 crate::model::ListBucketsResponse,
443 crate::Error,
444 > {
445 use google_cloud_gax::paginator::Paginator;
446 self.by_page().items()
447 }
448
449 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
453 self.0.request.parent = v.into();
454 self
455 }
456
457 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
459 self.0.request.page_size = v.into();
460 self
461 }
462
463 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
465 self.0.request.page_token = v.into();
466 self
467 }
468
469 pub fn set_prefix<T: Into<std::string::String>>(mut self, v: T) -> Self {
471 self.0.request.prefix = v.into();
472 self
473 }
474
475 pub fn set_read_mask<T>(mut self, v: T) -> Self
477 where
478 T: std::convert::Into<wkt::FieldMask>,
479 {
480 self.0.request.read_mask = std::option::Option::Some(v.into());
481 self
482 }
483
484 pub fn set_or_clear_read_mask<T>(mut self, v: std::option::Option<T>) -> Self
486 where
487 T: std::convert::Into<wkt::FieldMask>,
488 {
489 self.0.request.read_mask = v.map(|x| x.into());
490 self
491 }
492
493 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
495 self.0.request.return_partial_success = v.into();
496 self
497 }
498 }
499
500 #[doc(hidden)]
501 impl crate::RequestBuilder for ListBuckets {
502 fn request_options(&mut self) -> &mut crate::RequestOptions {
503 &mut self.0.options
504 }
505 }
506
507 #[derive(Clone, Debug)]
524 pub struct LockBucketRetentionPolicy(
525 RequestBuilder<crate::model::LockBucketRetentionPolicyRequest>,
526 );
527
528 impl LockBucketRetentionPolicy {
529 pub(crate) fn new(
530 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
531 ) -> Self {
532 Self(RequestBuilder::new(stub))
533 }
534
535 pub fn with_request<V: Into<crate::model::LockBucketRetentionPolicyRequest>>(
537 mut self,
538 v: V,
539 ) -> Self {
540 self.0.request = v.into();
541 self
542 }
543
544 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
546 self.0.options = v.into();
547 self
548 }
549
550 pub async fn send(self) -> Result<crate::model::Bucket> {
552 (*self.0.stub)
553 .lock_bucket_retention_policy(self.0.request, self.0.options)
554 .await
555 .map(crate::Response::into_body)
556 }
557
558 pub fn set_bucket<T: Into<std::string::String>>(mut self, v: T) -> Self {
562 self.0.request.bucket = v.into();
563 self
564 }
565
566 pub fn set_if_metageneration_match<T: Into<i64>>(mut self, v: T) -> Self {
570 self.0.request.if_metageneration_match = v.into();
571 self
572 }
573 }
574
575 #[doc(hidden)]
576 impl crate::RequestBuilder for LockBucketRetentionPolicy {
577 fn request_options(&mut self) -> &mut crate::RequestOptions {
578 &mut self.0.options
579 }
580 }
581
582 #[derive(Clone, Debug)]
599 pub struct UpdateBucket(RequestBuilder<crate::model::UpdateBucketRequest>);
600
601 impl UpdateBucket {
602 pub(crate) fn new(
603 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
604 ) -> Self {
605 Self(RequestBuilder::new(stub))
606 }
607
608 pub fn with_request<V: Into<crate::model::UpdateBucketRequest>>(mut self, v: V) -> Self {
610 self.0.request = v.into();
611 self
612 }
613
614 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
616 self.0.options = v.into();
617 self
618 }
619
620 pub async fn send(self) -> Result<crate::model::Bucket> {
622 (*self.0.stub)
623 .update_bucket(self.0.request, self.0.options)
624 .await
625 .map(crate::Response::into_body)
626 }
627
628 pub fn set_bucket<T>(mut self, v: T) -> Self
632 where
633 T: std::convert::Into<crate::model::Bucket>,
634 {
635 self.0.request.bucket = std::option::Option::Some(v.into());
636 self
637 }
638
639 pub fn set_or_clear_bucket<T>(mut self, v: std::option::Option<T>) -> Self
643 where
644 T: std::convert::Into<crate::model::Bucket>,
645 {
646 self.0.request.bucket = v.map(|x| x.into());
647 self
648 }
649
650 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
652 where
653 T: std::convert::Into<i64>,
654 {
655 self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
656 self
657 }
658
659 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
661 where
662 T: std::convert::Into<i64>,
663 {
664 self.0.request.if_metageneration_match = v.map(|x| x.into());
665 self
666 }
667
668 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
670 where
671 T: std::convert::Into<i64>,
672 {
673 self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
674 self
675 }
676
677 pub fn set_or_clear_if_metageneration_not_match<T>(
679 mut self,
680 v: std::option::Option<T>,
681 ) -> Self
682 where
683 T: std::convert::Into<i64>,
684 {
685 self.0.request.if_metageneration_not_match = v.map(|x| x.into());
686 self
687 }
688
689 pub fn set_predefined_acl<T: Into<std::string::String>>(mut self, v: T) -> Self {
691 self.0.request.predefined_acl = v.into();
692 self
693 }
694
695 pub fn set_predefined_default_object_acl<T: Into<std::string::String>>(
697 mut self,
698 v: T,
699 ) -> Self {
700 self.0.request.predefined_default_object_acl = v.into();
701 self
702 }
703
704 pub fn set_update_mask<T>(mut self, v: T) -> Self
708 where
709 T: std::convert::Into<wkt::FieldMask>,
710 {
711 self.0.request.update_mask = std::option::Option::Some(v.into());
712 self
713 }
714
715 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
719 where
720 T: std::convert::Into<wkt::FieldMask>,
721 {
722 self.0.request.update_mask = v.map(|x| x.into());
723 self
724 }
725 }
726
727 #[doc(hidden)]
728 impl crate::RequestBuilder for UpdateBucket {
729 fn request_options(&mut self) -> &mut crate::RequestOptions {
730 &mut self.0.options
731 }
732 }
733
734 #[derive(Clone, Debug)]
751 pub struct ComposeObject(RequestBuilder<crate::model::ComposeObjectRequest>);
752
753 impl ComposeObject {
754 pub(crate) fn new(
755 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
756 ) -> Self {
757 Self(RequestBuilder::new(stub))
758 }
759
760 pub fn with_request<V: Into<crate::model::ComposeObjectRequest>>(mut self, v: V) -> Self {
762 self.0.request = v.into();
763 self
764 }
765
766 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
768 self.0.options = v.into();
769 self
770 }
771
772 pub async fn send(self) -> Result<crate::model::Object> {
774 (*self.0.stub)
775 .compose_object(self.0.request, self.0.options)
776 .await
777 .map(crate::Response::into_body)
778 }
779
780 pub fn set_destination<T>(mut self, v: T) -> Self
784 where
785 T: std::convert::Into<crate::model::Object>,
786 {
787 self.0.request.destination = std::option::Option::Some(v.into());
788 self
789 }
790
791 pub fn set_or_clear_destination<T>(mut self, v: std::option::Option<T>) -> Self
795 where
796 T: std::convert::Into<crate::model::Object>,
797 {
798 self.0.request.destination = v.map(|x| x.into());
799 self
800 }
801
802 pub fn set_source_objects<T, V>(mut self, v: T) -> Self
804 where
805 T: std::iter::IntoIterator<Item = V>,
806 V: std::convert::Into<crate::model::compose_object_request::SourceObject>,
807 {
808 use std::iter::Iterator;
809 self.0.request.source_objects = v.into_iter().map(|i| i.into()).collect();
810 self
811 }
812
813 pub fn set_destination_predefined_acl<T: Into<std::string::String>>(
815 mut self,
816 v: T,
817 ) -> Self {
818 self.0.request.destination_predefined_acl = v.into();
819 self
820 }
821
822 pub fn set_if_generation_match<T>(mut self, v: T) -> Self
824 where
825 T: std::convert::Into<i64>,
826 {
827 self.0.request.if_generation_match = std::option::Option::Some(v.into());
828 self
829 }
830
831 pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
833 where
834 T: std::convert::Into<i64>,
835 {
836 self.0.request.if_generation_match = v.map(|x| x.into());
837 self
838 }
839
840 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
842 where
843 T: std::convert::Into<i64>,
844 {
845 self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
846 self
847 }
848
849 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
851 where
852 T: std::convert::Into<i64>,
853 {
854 self.0.request.if_metageneration_match = v.map(|x| x.into());
855 self
856 }
857
858 pub fn set_kms_key<T: Into<std::string::String>>(mut self, v: T) -> Self {
860 self.0.request.kms_key = v.into();
861 self
862 }
863
864 pub fn set_common_object_request_params<T>(mut self, v: T) -> Self
866 where
867 T: std::convert::Into<crate::model::CommonObjectRequestParams>,
868 {
869 self.0.request.common_object_request_params = std::option::Option::Some(v.into());
870 self
871 }
872
873 pub fn set_or_clear_common_object_request_params<T>(
875 mut self,
876 v: std::option::Option<T>,
877 ) -> Self
878 where
879 T: std::convert::Into<crate::model::CommonObjectRequestParams>,
880 {
881 self.0.request.common_object_request_params = v.map(|x| x.into());
882 self
883 }
884
885 pub fn set_object_checksums<T>(mut self, v: T) -> Self
887 where
888 T: std::convert::Into<crate::model::ObjectChecksums>,
889 {
890 self.0.request.object_checksums = std::option::Option::Some(v.into());
891 self
892 }
893
894 pub fn set_or_clear_object_checksums<T>(mut self, v: std::option::Option<T>) -> Self
896 where
897 T: std::convert::Into<crate::model::ObjectChecksums>,
898 {
899 self.0.request.object_checksums = v.map(|x| x.into());
900 self
901 }
902
903 pub fn set_delete_source_objects<T>(mut self, v: T) -> Self
905 where
906 T: std::convert::Into<bool>,
907 {
908 self.0.request.delete_source_objects = std::option::Option::Some(v.into());
909 self
910 }
911
912 pub fn set_or_clear_delete_source_objects<T>(mut self, v: std::option::Option<T>) -> Self
914 where
915 T: std::convert::Into<bool>,
916 {
917 self.0.request.delete_source_objects = v.map(|x| x.into());
918 self
919 }
920 }
921
922 #[doc(hidden)]
923 impl crate::RequestBuilder for ComposeObject {
924 fn request_options(&mut self) -> &mut crate::RequestOptions {
925 &mut self.0.options
926 }
927 }
928
929 #[derive(Clone, Debug)]
946 pub struct DeleteObject(RequestBuilder<crate::model::DeleteObjectRequest>);
947
948 impl DeleteObject {
949 pub(crate) fn new(
950 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
951 ) -> Self {
952 Self(RequestBuilder::new(stub))
953 }
954
955 pub fn with_request<V: Into<crate::model::DeleteObjectRequest>>(mut self, v: V) -> Self {
957 self.0.request = v.into();
958 self
959 }
960
961 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
963 self.0.options = v.into();
964 self
965 }
966
967 pub async fn send(self) -> Result<()> {
969 (*self.0.stub)
970 .delete_object(self.0.request, self.0.options)
971 .await
972 .map(crate::Response::into_body)
973 }
974
975 pub fn set_bucket<T: Into<std::string::String>>(mut self, v: T) -> Self {
979 self.0.request.bucket = v.into();
980 self
981 }
982
983 pub fn set_object<T: Into<std::string::String>>(mut self, v: T) -> Self {
987 self.0.request.object = v.into();
988 self
989 }
990
991 pub fn set_generation<T: Into<i64>>(mut self, v: T) -> Self {
993 self.0.request.generation = v.into();
994 self
995 }
996
997 pub fn set_if_generation_match<T>(mut self, v: T) -> Self
999 where
1000 T: std::convert::Into<i64>,
1001 {
1002 self.0.request.if_generation_match = std::option::Option::Some(v.into());
1003 self
1004 }
1005
1006 pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
1008 where
1009 T: std::convert::Into<i64>,
1010 {
1011 self.0.request.if_generation_match = v.map(|x| x.into());
1012 self
1013 }
1014
1015 pub fn set_if_generation_not_match<T>(mut self, v: T) -> Self
1017 where
1018 T: std::convert::Into<i64>,
1019 {
1020 self.0.request.if_generation_not_match = std::option::Option::Some(v.into());
1021 self
1022 }
1023
1024 pub fn set_or_clear_if_generation_not_match<T>(mut self, v: std::option::Option<T>) -> Self
1026 where
1027 T: std::convert::Into<i64>,
1028 {
1029 self.0.request.if_generation_not_match = v.map(|x| x.into());
1030 self
1031 }
1032
1033 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
1035 where
1036 T: std::convert::Into<i64>,
1037 {
1038 self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
1039 self
1040 }
1041
1042 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
1044 where
1045 T: std::convert::Into<i64>,
1046 {
1047 self.0.request.if_metageneration_match = v.map(|x| x.into());
1048 self
1049 }
1050
1051 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
1053 where
1054 T: std::convert::Into<i64>,
1055 {
1056 self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
1057 self
1058 }
1059
1060 pub fn set_or_clear_if_metageneration_not_match<T>(
1062 mut self,
1063 v: std::option::Option<T>,
1064 ) -> Self
1065 where
1066 T: std::convert::Into<i64>,
1067 {
1068 self.0.request.if_metageneration_not_match = v.map(|x| x.into());
1069 self
1070 }
1071
1072 pub fn set_common_object_request_params<T>(mut self, v: T) -> Self
1074 where
1075 T: std::convert::Into<crate::model::CommonObjectRequestParams>,
1076 {
1077 self.0.request.common_object_request_params = std::option::Option::Some(v.into());
1078 self
1079 }
1080
1081 pub fn set_or_clear_common_object_request_params<T>(
1083 mut self,
1084 v: std::option::Option<T>,
1085 ) -> Self
1086 where
1087 T: std::convert::Into<crate::model::CommonObjectRequestParams>,
1088 {
1089 self.0.request.common_object_request_params = v.map(|x| x.into());
1090 self
1091 }
1092 }
1093
1094 #[doc(hidden)]
1095 impl crate::RequestBuilder for DeleteObject {
1096 fn request_options(&mut self) -> &mut crate::RequestOptions {
1097 &mut self.0.options
1098 }
1099 }
1100
1101 #[derive(Clone, Debug)]
1118 pub struct RestoreObject(RequestBuilder<crate::model::RestoreObjectRequest>);
1119
1120 impl RestoreObject {
1121 pub(crate) fn new(
1122 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1123 ) -> Self {
1124 Self(RequestBuilder::new(stub))
1125 }
1126
1127 pub fn with_request<V: Into<crate::model::RestoreObjectRequest>>(mut self, v: V) -> Self {
1129 self.0.request = v.into();
1130 self
1131 }
1132
1133 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1135 self.0.options = v.into();
1136 self
1137 }
1138
1139 pub async fn send(self) -> Result<crate::model::Object> {
1141 (*self.0.stub)
1142 .restore_object(self.0.request, self.0.options)
1143 .await
1144 .map(crate::Response::into_body)
1145 }
1146
1147 pub fn set_bucket<T: Into<std::string::String>>(mut self, v: T) -> Self {
1151 self.0.request.bucket = v.into();
1152 self
1153 }
1154
1155 pub fn set_object<T: Into<std::string::String>>(mut self, v: T) -> Self {
1159 self.0.request.object = v.into();
1160 self
1161 }
1162
1163 pub fn set_generation<T: Into<i64>>(mut self, v: T) -> Self {
1167 self.0.request.generation = v.into();
1168 self
1169 }
1170
1171 pub fn set_restore_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1173 self.0.request.restore_token = v.into();
1174 self
1175 }
1176
1177 pub fn set_if_generation_match<T>(mut self, v: T) -> Self
1179 where
1180 T: std::convert::Into<i64>,
1181 {
1182 self.0.request.if_generation_match = std::option::Option::Some(v.into());
1183 self
1184 }
1185
1186 pub fn set_or_clear_if_generation_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_match = v.map(|x| x.into());
1192 self
1193 }
1194
1195 pub fn set_if_generation_not_match<T>(mut self, v: T) -> Self
1197 where
1198 T: std::convert::Into<i64>,
1199 {
1200 self.0.request.if_generation_not_match = std::option::Option::Some(v.into());
1201 self
1202 }
1203
1204 pub fn set_or_clear_if_generation_not_match<T>(mut self, v: std::option::Option<T>) -> Self
1206 where
1207 T: std::convert::Into<i64>,
1208 {
1209 self.0.request.if_generation_not_match = v.map(|x| x.into());
1210 self
1211 }
1212
1213 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
1215 where
1216 T: std::convert::Into<i64>,
1217 {
1218 self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
1219 self
1220 }
1221
1222 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
1224 where
1225 T: std::convert::Into<i64>,
1226 {
1227 self.0.request.if_metageneration_match = v.map(|x| x.into());
1228 self
1229 }
1230
1231 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
1233 where
1234 T: std::convert::Into<i64>,
1235 {
1236 self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
1237 self
1238 }
1239
1240 pub fn set_or_clear_if_metageneration_not_match<T>(
1242 mut self,
1243 v: std::option::Option<T>,
1244 ) -> Self
1245 where
1246 T: std::convert::Into<i64>,
1247 {
1248 self.0.request.if_metageneration_not_match = v.map(|x| x.into());
1249 self
1250 }
1251
1252 pub fn set_copy_source_acl<T>(mut self, v: T) -> Self
1254 where
1255 T: std::convert::Into<bool>,
1256 {
1257 self.0.request.copy_source_acl = std::option::Option::Some(v.into());
1258 self
1259 }
1260
1261 pub fn set_or_clear_copy_source_acl<T>(mut self, v: std::option::Option<T>) -> Self
1263 where
1264 T: std::convert::Into<bool>,
1265 {
1266 self.0.request.copy_source_acl = v.map(|x| x.into());
1267 self
1268 }
1269
1270 pub fn set_common_object_request_params<T>(mut self, v: T) -> Self
1272 where
1273 T: std::convert::Into<crate::model::CommonObjectRequestParams>,
1274 {
1275 self.0.request.common_object_request_params = std::option::Option::Some(v.into());
1276 self
1277 }
1278
1279 pub fn set_or_clear_common_object_request_params<T>(
1281 mut self,
1282 v: std::option::Option<T>,
1283 ) -> Self
1284 where
1285 T: std::convert::Into<crate::model::CommonObjectRequestParams>,
1286 {
1287 self.0.request.common_object_request_params = v.map(|x| x.into());
1288 self
1289 }
1290 }
1291
1292 #[doc(hidden)]
1293 impl crate::RequestBuilder for RestoreObject {
1294 fn request_options(&mut self) -> &mut crate::RequestOptions {
1295 &mut self.0.options
1296 }
1297 }
1298
1299 #[derive(Clone, Debug)]
1316 pub struct GetObject(RequestBuilder<crate::model::GetObjectRequest>);
1317
1318 impl GetObject {
1319 pub(crate) fn new(
1320 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1321 ) -> Self {
1322 Self(RequestBuilder::new(stub))
1323 }
1324
1325 pub fn with_request<V: Into<crate::model::GetObjectRequest>>(mut self, v: V) -> Self {
1327 self.0.request = v.into();
1328 self
1329 }
1330
1331 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1333 self.0.options = v.into();
1334 self
1335 }
1336
1337 pub async fn send(self) -> Result<crate::model::Object> {
1339 (*self.0.stub)
1340 .get_object(self.0.request, self.0.options)
1341 .await
1342 .map(crate::Response::into_body)
1343 }
1344
1345 pub fn set_bucket<T: Into<std::string::String>>(mut self, v: T) -> Self {
1349 self.0.request.bucket = v.into();
1350 self
1351 }
1352
1353 pub fn set_object<T: Into<std::string::String>>(mut self, v: T) -> Self {
1357 self.0.request.object = v.into();
1358 self
1359 }
1360
1361 pub fn set_generation<T: Into<i64>>(mut self, v: T) -> Self {
1363 self.0.request.generation = v.into();
1364 self
1365 }
1366
1367 pub fn set_soft_deleted<T>(mut self, v: T) -> Self
1369 where
1370 T: std::convert::Into<bool>,
1371 {
1372 self.0.request.soft_deleted = std::option::Option::Some(v.into());
1373 self
1374 }
1375
1376 pub fn set_or_clear_soft_deleted<T>(mut self, v: std::option::Option<T>) -> Self
1378 where
1379 T: std::convert::Into<bool>,
1380 {
1381 self.0.request.soft_deleted = v.map(|x| x.into());
1382 self
1383 }
1384
1385 pub fn set_if_generation_match<T>(mut self, v: T) -> Self
1387 where
1388 T: std::convert::Into<i64>,
1389 {
1390 self.0.request.if_generation_match = std::option::Option::Some(v.into());
1391 self
1392 }
1393
1394 pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
1396 where
1397 T: std::convert::Into<i64>,
1398 {
1399 self.0.request.if_generation_match = v.map(|x| x.into());
1400 self
1401 }
1402
1403 pub fn set_if_generation_not_match<T>(mut self, v: T) -> Self
1405 where
1406 T: std::convert::Into<i64>,
1407 {
1408 self.0.request.if_generation_not_match = std::option::Option::Some(v.into());
1409 self
1410 }
1411
1412 pub fn set_or_clear_if_generation_not_match<T>(mut self, v: std::option::Option<T>) -> Self
1414 where
1415 T: std::convert::Into<i64>,
1416 {
1417 self.0.request.if_generation_not_match = v.map(|x| x.into());
1418 self
1419 }
1420
1421 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
1423 where
1424 T: std::convert::Into<i64>,
1425 {
1426 self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
1427 self
1428 }
1429
1430 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
1432 where
1433 T: std::convert::Into<i64>,
1434 {
1435 self.0.request.if_metageneration_match = v.map(|x| x.into());
1436 self
1437 }
1438
1439 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
1441 where
1442 T: std::convert::Into<i64>,
1443 {
1444 self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
1445 self
1446 }
1447
1448 pub fn set_or_clear_if_metageneration_not_match<T>(
1450 mut self,
1451 v: std::option::Option<T>,
1452 ) -> Self
1453 where
1454 T: std::convert::Into<i64>,
1455 {
1456 self.0.request.if_metageneration_not_match = v.map(|x| x.into());
1457 self
1458 }
1459
1460 pub fn set_common_object_request_params<T>(mut self, v: T) -> Self
1462 where
1463 T: std::convert::Into<crate::model::CommonObjectRequestParams>,
1464 {
1465 self.0.request.common_object_request_params = std::option::Option::Some(v.into());
1466 self
1467 }
1468
1469 pub fn set_or_clear_common_object_request_params<T>(
1471 mut self,
1472 v: std::option::Option<T>,
1473 ) -> Self
1474 where
1475 T: std::convert::Into<crate::model::CommonObjectRequestParams>,
1476 {
1477 self.0.request.common_object_request_params = v.map(|x| x.into());
1478 self
1479 }
1480
1481 pub fn set_read_mask<T>(mut self, v: T) -> Self
1483 where
1484 T: std::convert::Into<wkt::FieldMask>,
1485 {
1486 self.0.request.read_mask = std::option::Option::Some(v.into());
1487 self
1488 }
1489
1490 pub fn set_or_clear_read_mask<T>(mut self, v: std::option::Option<T>) -> Self
1492 where
1493 T: std::convert::Into<wkt::FieldMask>,
1494 {
1495 self.0.request.read_mask = v.map(|x| x.into());
1496 self
1497 }
1498
1499 pub fn set_restore_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1501 self.0.request.restore_token = v.into();
1502 self
1503 }
1504 }
1505
1506 #[doc(hidden)]
1507 impl crate::RequestBuilder for GetObject {
1508 fn request_options(&mut self) -> &mut crate::RequestOptions {
1509 &mut self.0.options
1510 }
1511 }
1512
1513 #[derive(Clone, Debug)]
1530 pub struct UpdateObject(RequestBuilder<crate::model::UpdateObjectRequest>);
1531
1532 impl UpdateObject {
1533 pub(crate) fn new(
1534 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1535 ) -> Self {
1536 Self(RequestBuilder::new(stub))
1537 }
1538
1539 pub fn with_request<V: Into<crate::model::UpdateObjectRequest>>(mut self, v: V) -> Self {
1541 self.0.request = v.into();
1542 self
1543 }
1544
1545 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1547 self.0.options = v.into();
1548 self
1549 }
1550
1551 pub async fn send(self) -> Result<crate::model::Object> {
1553 (*self.0.stub)
1554 .update_object(self.0.request, self.0.options)
1555 .await
1556 .map(crate::Response::into_body)
1557 }
1558
1559 pub fn set_object<T>(mut self, v: T) -> Self
1563 where
1564 T: std::convert::Into<crate::model::Object>,
1565 {
1566 self.0.request.object = std::option::Option::Some(v.into());
1567 self
1568 }
1569
1570 pub fn set_or_clear_object<T>(mut self, v: std::option::Option<T>) -> Self
1574 where
1575 T: std::convert::Into<crate::model::Object>,
1576 {
1577 self.0.request.object = v.map(|x| x.into());
1578 self
1579 }
1580
1581 pub fn set_if_generation_match<T>(mut self, v: T) -> Self
1583 where
1584 T: std::convert::Into<i64>,
1585 {
1586 self.0.request.if_generation_match = std::option::Option::Some(v.into());
1587 self
1588 }
1589
1590 pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
1592 where
1593 T: std::convert::Into<i64>,
1594 {
1595 self.0.request.if_generation_match = v.map(|x| x.into());
1596 self
1597 }
1598
1599 pub fn set_if_generation_not_match<T>(mut self, v: T) -> Self
1601 where
1602 T: std::convert::Into<i64>,
1603 {
1604 self.0.request.if_generation_not_match = std::option::Option::Some(v.into());
1605 self
1606 }
1607
1608 pub fn set_or_clear_if_generation_not_match<T>(mut self, v: std::option::Option<T>) -> Self
1610 where
1611 T: std::convert::Into<i64>,
1612 {
1613 self.0.request.if_generation_not_match = v.map(|x| x.into());
1614 self
1615 }
1616
1617 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
1619 where
1620 T: std::convert::Into<i64>,
1621 {
1622 self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
1623 self
1624 }
1625
1626 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
1628 where
1629 T: std::convert::Into<i64>,
1630 {
1631 self.0.request.if_metageneration_match = v.map(|x| x.into());
1632 self
1633 }
1634
1635 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
1637 where
1638 T: std::convert::Into<i64>,
1639 {
1640 self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
1641 self
1642 }
1643
1644 pub fn set_or_clear_if_metageneration_not_match<T>(
1646 mut self,
1647 v: std::option::Option<T>,
1648 ) -> Self
1649 where
1650 T: std::convert::Into<i64>,
1651 {
1652 self.0.request.if_metageneration_not_match = v.map(|x| x.into());
1653 self
1654 }
1655
1656 pub fn set_predefined_acl<T: Into<std::string::String>>(mut self, v: T) -> Self {
1658 self.0.request.predefined_acl = v.into();
1659 self
1660 }
1661
1662 pub fn set_update_mask<T>(mut self, v: T) -> Self
1666 where
1667 T: std::convert::Into<wkt::FieldMask>,
1668 {
1669 self.0.request.update_mask = std::option::Option::Some(v.into());
1670 self
1671 }
1672
1673 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1677 where
1678 T: std::convert::Into<wkt::FieldMask>,
1679 {
1680 self.0.request.update_mask = v.map(|x| x.into());
1681 self
1682 }
1683
1684 pub fn set_common_object_request_params<T>(mut self, v: T) -> Self
1686 where
1687 T: std::convert::Into<crate::model::CommonObjectRequestParams>,
1688 {
1689 self.0.request.common_object_request_params = std::option::Option::Some(v.into());
1690 self
1691 }
1692
1693 pub fn set_or_clear_common_object_request_params<T>(
1695 mut self,
1696 v: std::option::Option<T>,
1697 ) -> Self
1698 where
1699 T: std::convert::Into<crate::model::CommonObjectRequestParams>,
1700 {
1701 self.0.request.common_object_request_params = v.map(|x| x.into());
1702 self
1703 }
1704
1705 pub fn set_override_unlocked_retention<T: Into<bool>>(mut self, v: T) -> Self {
1707 self.0.request.override_unlocked_retention = v.into();
1708 self
1709 }
1710 }
1711
1712 #[doc(hidden)]
1713 impl crate::RequestBuilder for UpdateObject {
1714 fn request_options(&mut self) -> &mut crate::RequestOptions {
1715 &mut self.0.options
1716 }
1717 }
1718
1719 #[derive(Clone, Debug)]
1740 pub struct ListObjects(RequestBuilder<crate::model::ListObjectsRequest>);
1741
1742 impl ListObjects {
1743 pub(crate) fn new(
1744 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1745 ) -> Self {
1746 Self(RequestBuilder::new(stub))
1747 }
1748
1749 pub fn with_request<V: Into<crate::model::ListObjectsRequest>>(mut self, v: V) -> Self {
1751 self.0.request = v.into();
1752 self
1753 }
1754
1755 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1757 self.0.options = v.into();
1758 self
1759 }
1760
1761 pub async fn send(self) -> Result<crate::model::ListObjectsResponse> {
1763 (*self.0.stub)
1764 .list_objects(self.0.request, self.0.options)
1765 .await
1766 .map(crate::Response::into_body)
1767 }
1768
1769 pub fn by_page(
1771 self,
1772 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListObjectsResponse, crate::Error>
1773 {
1774 use std::clone::Clone;
1775 let token = self.0.request.page_token.clone();
1776 let execute = move |token: String| {
1777 let mut builder = self.clone();
1778 builder.0.request = builder.0.request.set_page_token(token);
1779 builder.send()
1780 };
1781 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1782 }
1783
1784 pub fn by_item(
1786 self,
1787 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1788 crate::model::ListObjectsResponse,
1789 crate::Error,
1790 > {
1791 use google_cloud_gax::paginator::Paginator;
1792 self.by_page().items()
1793 }
1794
1795 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1799 self.0.request.parent = v.into();
1800 self
1801 }
1802
1803 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1805 self.0.request.page_size = v.into();
1806 self
1807 }
1808
1809 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1811 self.0.request.page_token = v.into();
1812 self
1813 }
1814
1815 pub fn set_delimiter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1817 self.0.request.delimiter = v.into();
1818 self
1819 }
1820
1821 pub fn set_include_trailing_delimiter<T: Into<bool>>(mut self, v: T) -> Self {
1823 self.0.request.include_trailing_delimiter = v.into();
1824 self
1825 }
1826
1827 pub fn set_prefix<T: Into<std::string::String>>(mut self, v: T) -> Self {
1829 self.0.request.prefix = v.into();
1830 self
1831 }
1832
1833 pub fn set_versions<T: Into<bool>>(mut self, v: T) -> Self {
1835 self.0.request.versions = v.into();
1836 self
1837 }
1838
1839 pub fn set_read_mask<T>(mut self, v: T) -> Self
1841 where
1842 T: std::convert::Into<wkt::FieldMask>,
1843 {
1844 self.0.request.read_mask = std::option::Option::Some(v.into());
1845 self
1846 }
1847
1848 pub fn set_or_clear_read_mask<T>(mut self, v: std::option::Option<T>) -> Self
1850 where
1851 T: std::convert::Into<wkt::FieldMask>,
1852 {
1853 self.0.request.read_mask = v.map(|x| x.into());
1854 self
1855 }
1856
1857 pub fn set_lexicographic_start<T: Into<std::string::String>>(mut self, v: T) -> Self {
1859 self.0.request.lexicographic_start = v.into();
1860 self
1861 }
1862
1863 pub fn set_lexicographic_end<T: Into<std::string::String>>(mut self, v: T) -> Self {
1865 self.0.request.lexicographic_end = v.into();
1866 self
1867 }
1868
1869 pub fn set_soft_deleted<T: Into<bool>>(mut self, v: T) -> Self {
1871 self.0.request.soft_deleted = v.into();
1872 self
1873 }
1874
1875 pub fn set_include_folders_as_prefixes<T: Into<bool>>(mut self, v: T) -> Self {
1877 self.0.request.include_folders_as_prefixes = v.into();
1878 self
1879 }
1880
1881 pub fn set_match_glob<T: Into<std::string::String>>(mut self, v: T) -> Self {
1883 self.0.request.match_glob = v.into();
1884 self
1885 }
1886
1887 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1889 self.0.request.filter = v.into();
1890 self
1891 }
1892 }
1893
1894 #[doc(hidden)]
1895 impl crate::RequestBuilder for ListObjects {
1896 fn request_options(&mut self) -> &mut crate::RequestOptions {
1897 &mut self.0.options
1898 }
1899 }
1900
1901 #[derive(Clone, Debug)]
1918 pub struct RewriteObject(RequestBuilder<crate::model::RewriteObjectRequest>);
1919
1920 impl RewriteObject {
1921 pub(crate) fn new(
1922 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1923 ) -> Self {
1924 Self(RequestBuilder::new(stub))
1925 }
1926
1927 pub fn with_request<V: Into<crate::model::RewriteObjectRequest>>(mut self, v: V) -> Self {
1929 self.0.request = v.into();
1930 self
1931 }
1932
1933 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1935 self.0.options = v.into();
1936 self
1937 }
1938
1939 pub async fn send(self) -> Result<crate::model::RewriteResponse> {
1941 (*self.0.stub)
1942 .rewrite_object(self.0.request, self.0.options)
1943 .await
1944 .map(crate::Response::into_body)
1945 }
1946
1947 pub fn set_destination_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1951 self.0.request.destination_name = v.into();
1952 self
1953 }
1954
1955 pub fn set_destination_bucket<T: Into<std::string::String>>(mut self, v: T) -> Self {
1959 self.0.request.destination_bucket = v.into();
1960 self
1961 }
1962
1963 pub fn set_destination_kms_key<T: Into<std::string::String>>(mut self, v: T) -> Self {
1965 self.0.request.destination_kms_key = v.into();
1966 self
1967 }
1968
1969 pub fn set_destination<T>(mut self, v: T) -> Self
1971 where
1972 T: std::convert::Into<crate::model::Object>,
1973 {
1974 self.0.request.destination = std::option::Option::Some(v.into());
1975 self
1976 }
1977
1978 pub fn set_or_clear_destination<T>(mut self, v: std::option::Option<T>) -> Self
1980 where
1981 T: std::convert::Into<crate::model::Object>,
1982 {
1983 self.0.request.destination = v.map(|x| x.into());
1984 self
1985 }
1986
1987 pub fn set_source_bucket<T: Into<std::string::String>>(mut self, v: T) -> Self {
1991 self.0.request.source_bucket = v.into();
1992 self
1993 }
1994
1995 pub fn set_source_object<T: Into<std::string::String>>(mut self, v: T) -> Self {
1999 self.0.request.source_object = v.into();
2000 self
2001 }
2002
2003 pub fn set_source_generation<T: Into<i64>>(mut self, v: T) -> Self {
2005 self.0.request.source_generation = v.into();
2006 self
2007 }
2008
2009 pub fn set_rewrite_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2011 self.0.request.rewrite_token = v.into();
2012 self
2013 }
2014
2015 pub fn set_destination_predefined_acl<T: Into<std::string::String>>(
2017 mut self,
2018 v: T,
2019 ) -> Self {
2020 self.0.request.destination_predefined_acl = v.into();
2021 self
2022 }
2023
2024 pub fn set_if_generation_match<T>(mut self, v: T) -> Self
2026 where
2027 T: std::convert::Into<i64>,
2028 {
2029 self.0.request.if_generation_match = std::option::Option::Some(v.into());
2030 self
2031 }
2032
2033 pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
2035 where
2036 T: std::convert::Into<i64>,
2037 {
2038 self.0.request.if_generation_match = v.map(|x| x.into());
2039 self
2040 }
2041
2042 pub fn set_if_generation_not_match<T>(mut self, v: T) -> Self
2044 where
2045 T: std::convert::Into<i64>,
2046 {
2047 self.0.request.if_generation_not_match = std::option::Option::Some(v.into());
2048 self
2049 }
2050
2051 pub fn set_or_clear_if_generation_not_match<T>(mut self, v: std::option::Option<T>) -> Self
2053 where
2054 T: std::convert::Into<i64>,
2055 {
2056 self.0.request.if_generation_not_match = v.map(|x| x.into());
2057 self
2058 }
2059
2060 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
2062 where
2063 T: std::convert::Into<i64>,
2064 {
2065 self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
2066 self
2067 }
2068
2069 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
2071 where
2072 T: std::convert::Into<i64>,
2073 {
2074 self.0.request.if_metageneration_match = v.map(|x| x.into());
2075 self
2076 }
2077
2078 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
2080 where
2081 T: std::convert::Into<i64>,
2082 {
2083 self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
2084 self
2085 }
2086
2087 pub fn set_or_clear_if_metageneration_not_match<T>(
2089 mut self,
2090 v: std::option::Option<T>,
2091 ) -> Self
2092 where
2093 T: std::convert::Into<i64>,
2094 {
2095 self.0.request.if_metageneration_not_match = v.map(|x| x.into());
2096 self
2097 }
2098
2099 pub fn set_if_source_generation_match<T>(mut self, v: T) -> Self
2101 where
2102 T: std::convert::Into<i64>,
2103 {
2104 self.0.request.if_source_generation_match = std::option::Option::Some(v.into());
2105 self
2106 }
2107
2108 pub fn set_or_clear_if_source_generation_match<T>(
2110 mut self,
2111 v: std::option::Option<T>,
2112 ) -> Self
2113 where
2114 T: std::convert::Into<i64>,
2115 {
2116 self.0.request.if_source_generation_match = v.map(|x| x.into());
2117 self
2118 }
2119
2120 pub fn set_if_source_generation_not_match<T>(mut self, v: T) -> Self
2122 where
2123 T: std::convert::Into<i64>,
2124 {
2125 self.0.request.if_source_generation_not_match = std::option::Option::Some(v.into());
2126 self
2127 }
2128
2129 pub fn set_or_clear_if_source_generation_not_match<T>(
2131 mut self,
2132 v: std::option::Option<T>,
2133 ) -> Self
2134 where
2135 T: std::convert::Into<i64>,
2136 {
2137 self.0.request.if_source_generation_not_match = v.map(|x| x.into());
2138 self
2139 }
2140
2141 pub fn set_if_source_metageneration_match<T>(mut self, v: T) -> Self
2143 where
2144 T: std::convert::Into<i64>,
2145 {
2146 self.0.request.if_source_metageneration_match = std::option::Option::Some(v.into());
2147 self
2148 }
2149
2150 pub fn set_or_clear_if_source_metageneration_match<T>(
2152 mut self,
2153 v: std::option::Option<T>,
2154 ) -> Self
2155 where
2156 T: std::convert::Into<i64>,
2157 {
2158 self.0.request.if_source_metageneration_match = v.map(|x| x.into());
2159 self
2160 }
2161
2162 pub fn set_if_source_metageneration_not_match<T>(mut self, v: T) -> Self
2164 where
2165 T: std::convert::Into<i64>,
2166 {
2167 self.0.request.if_source_metageneration_not_match = std::option::Option::Some(v.into());
2168 self
2169 }
2170
2171 pub fn set_or_clear_if_source_metageneration_not_match<T>(
2173 mut self,
2174 v: std::option::Option<T>,
2175 ) -> Self
2176 where
2177 T: std::convert::Into<i64>,
2178 {
2179 self.0.request.if_source_metageneration_not_match = v.map(|x| x.into());
2180 self
2181 }
2182
2183 pub fn set_max_bytes_rewritten_per_call<T: Into<i64>>(mut self, v: T) -> Self {
2185 self.0.request.max_bytes_rewritten_per_call = v.into();
2186 self
2187 }
2188
2189 pub fn set_copy_source_encryption_algorithm<T: Into<std::string::String>>(
2191 mut self,
2192 v: T,
2193 ) -> Self {
2194 self.0.request.copy_source_encryption_algorithm = v.into();
2195 self
2196 }
2197
2198 pub fn set_copy_source_encryption_key_bytes<T: Into<::bytes::Bytes>>(
2200 mut self,
2201 v: T,
2202 ) -> Self {
2203 self.0.request.copy_source_encryption_key_bytes = v.into();
2204 self
2205 }
2206
2207 pub fn set_copy_source_encryption_key_sha256_bytes<T: Into<::bytes::Bytes>>(
2209 mut self,
2210 v: T,
2211 ) -> Self {
2212 self.0.request.copy_source_encryption_key_sha256_bytes = v.into();
2213 self
2214 }
2215
2216 pub fn set_common_object_request_params<T>(mut self, v: T) -> Self
2218 where
2219 T: std::convert::Into<crate::model::CommonObjectRequestParams>,
2220 {
2221 self.0.request.common_object_request_params = std::option::Option::Some(v.into());
2222 self
2223 }
2224
2225 pub fn set_or_clear_common_object_request_params<T>(
2227 mut self,
2228 v: std::option::Option<T>,
2229 ) -> Self
2230 where
2231 T: std::convert::Into<crate::model::CommonObjectRequestParams>,
2232 {
2233 self.0.request.common_object_request_params = v.map(|x| x.into());
2234 self
2235 }
2236
2237 pub fn set_object_checksums<T>(mut self, v: T) -> Self
2239 where
2240 T: std::convert::Into<crate::model::ObjectChecksums>,
2241 {
2242 self.0.request.object_checksums = std::option::Option::Some(v.into());
2243 self
2244 }
2245
2246 pub fn set_or_clear_object_checksums<T>(mut self, v: std::option::Option<T>) -> Self
2248 where
2249 T: std::convert::Into<crate::model::ObjectChecksums>,
2250 {
2251 self.0.request.object_checksums = v.map(|x| x.into());
2252 self
2253 }
2254 }
2255
2256 #[doc(hidden)]
2257 impl crate::RequestBuilder for RewriteObject {
2258 fn request_options(&mut self) -> &mut crate::RequestOptions {
2259 &mut self.0.options
2260 }
2261 }
2262
2263 #[derive(Clone, Debug)]
2280 pub struct MoveObject(RequestBuilder<crate::model::MoveObjectRequest>);
2281
2282 impl MoveObject {
2283 pub(crate) fn new(
2284 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2285 ) -> Self {
2286 Self(RequestBuilder::new(stub))
2287 }
2288
2289 pub fn with_request<V: Into<crate::model::MoveObjectRequest>>(mut self, v: V) -> Self {
2291 self.0.request = v.into();
2292 self
2293 }
2294
2295 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2297 self.0.options = v.into();
2298 self
2299 }
2300
2301 pub async fn send(self) -> Result<crate::model::Object> {
2303 (*self.0.stub)
2304 .move_object(self.0.request, self.0.options)
2305 .await
2306 .map(crate::Response::into_body)
2307 }
2308
2309 pub fn set_bucket<T: Into<std::string::String>>(mut self, v: T) -> Self {
2313 self.0.request.bucket = v.into();
2314 self
2315 }
2316
2317 pub fn set_source_object<T: Into<std::string::String>>(mut self, v: T) -> Self {
2321 self.0.request.source_object = v.into();
2322 self
2323 }
2324
2325 pub fn set_destination_object<T: Into<std::string::String>>(mut self, v: T) -> Self {
2329 self.0.request.destination_object = v.into();
2330 self
2331 }
2332
2333 pub fn set_if_source_generation_match<T>(mut self, v: T) -> Self
2335 where
2336 T: std::convert::Into<i64>,
2337 {
2338 self.0.request.if_source_generation_match = std::option::Option::Some(v.into());
2339 self
2340 }
2341
2342 pub fn set_or_clear_if_source_generation_match<T>(
2344 mut self,
2345 v: std::option::Option<T>,
2346 ) -> Self
2347 where
2348 T: std::convert::Into<i64>,
2349 {
2350 self.0.request.if_source_generation_match = v.map(|x| x.into());
2351 self
2352 }
2353
2354 pub fn set_if_source_generation_not_match<T>(mut self, v: T) -> Self
2356 where
2357 T: std::convert::Into<i64>,
2358 {
2359 self.0.request.if_source_generation_not_match = std::option::Option::Some(v.into());
2360 self
2361 }
2362
2363 pub fn set_or_clear_if_source_generation_not_match<T>(
2365 mut self,
2366 v: std::option::Option<T>,
2367 ) -> Self
2368 where
2369 T: std::convert::Into<i64>,
2370 {
2371 self.0.request.if_source_generation_not_match = v.map(|x| x.into());
2372 self
2373 }
2374
2375 pub fn set_if_source_metageneration_match<T>(mut self, v: T) -> Self
2377 where
2378 T: std::convert::Into<i64>,
2379 {
2380 self.0.request.if_source_metageneration_match = std::option::Option::Some(v.into());
2381 self
2382 }
2383
2384 pub fn set_or_clear_if_source_metageneration_match<T>(
2386 mut self,
2387 v: std::option::Option<T>,
2388 ) -> Self
2389 where
2390 T: std::convert::Into<i64>,
2391 {
2392 self.0.request.if_source_metageneration_match = v.map(|x| x.into());
2393 self
2394 }
2395
2396 pub fn set_if_source_metageneration_not_match<T>(mut self, v: T) -> Self
2398 where
2399 T: std::convert::Into<i64>,
2400 {
2401 self.0.request.if_source_metageneration_not_match = std::option::Option::Some(v.into());
2402 self
2403 }
2404
2405 pub fn set_or_clear_if_source_metageneration_not_match<T>(
2407 mut self,
2408 v: std::option::Option<T>,
2409 ) -> Self
2410 where
2411 T: std::convert::Into<i64>,
2412 {
2413 self.0.request.if_source_metageneration_not_match = v.map(|x| x.into());
2414 self
2415 }
2416
2417 pub fn set_if_generation_match<T>(mut self, v: T) -> Self
2419 where
2420 T: std::convert::Into<i64>,
2421 {
2422 self.0.request.if_generation_match = std::option::Option::Some(v.into());
2423 self
2424 }
2425
2426 pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
2428 where
2429 T: std::convert::Into<i64>,
2430 {
2431 self.0.request.if_generation_match = v.map(|x| x.into());
2432 self
2433 }
2434
2435 pub fn set_if_generation_not_match<T>(mut self, v: T) -> Self
2437 where
2438 T: std::convert::Into<i64>,
2439 {
2440 self.0.request.if_generation_not_match = std::option::Option::Some(v.into());
2441 self
2442 }
2443
2444 pub fn set_or_clear_if_generation_not_match<T>(mut self, v: std::option::Option<T>) -> Self
2446 where
2447 T: std::convert::Into<i64>,
2448 {
2449 self.0.request.if_generation_not_match = v.map(|x| x.into());
2450 self
2451 }
2452
2453 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
2455 where
2456 T: std::convert::Into<i64>,
2457 {
2458 self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
2459 self
2460 }
2461
2462 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
2464 where
2465 T: std::convert::Into<i64>,
2466 {
2467 self.0.request.if_metageneration_match = v.map(|x| x.into());
2468 self
2469 }
2470
2471 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
2473 where
2474 T: std::convert::Into<i64>,
2475 {
2476 self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
2477 self
2478 }
2479
2480 pub fn set_or_clear_if_metageneration_not_match<T>(
2482 mut self,
2483 v: std::option::Option<T>,
2484 ) -> Self
2485 where
2486 T: std::convert::Into<i64>,
2487 {
2488 self.0.request.if_metageneration_not_match = v.map(|x| x.into());
2489 self
2490 }
2491 }
2492
2493 #[doc(hidden)]
2494 impl crate::RequestBuilder for MoveObject {
2495 fn request_options(&mut self) -> &mut crate::RequestOptions {
2496 &mut self.0.options
2497 }
2498 }
2499}