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: crate::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: crate::RequestOptions::default(),
39 }
40 }
41 }
42
43 #[derive(Clone, Debug)]
60 pub struct DeleteBucket(RequestBuilder<crate::model::DeleteBucketRequest>);
61
62 impl DeleteBucket {
63 pub(crate) fn new(
64 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
65 ) -> Self {
66 Self(RequestBuilder::new(stub))
67 }
68
69 pub fn with_request<V: Into<crate::model::DeleteBucketRequest>>(mut self, v: V) -> Self {
71 self.0.request = v.into();
72 self
73 }
74
75 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
77 self.0.options = v.into();
78 self
79 }
80
81 pub async fn send(self) -> Result<()> {
83 (*self.0.stub)
84 .delete_bucket(self.0.request, self.0.options)
85 .await
86 .map(crate::Response::into_body)
87 }
88
89 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
93 self.0.request.name = v.into();
94 self
95 }
96
97 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
99 where
100 T: std::convert::Into<i64>,
101 {
102 self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
103 self
104 }
105
106 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
108 where
109 T: std::convert::Into<i64>,
110 {
111 self.0.request.if_metageneration_match = v.map(|x| x.into());
112 self
113 }
114
115 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
117 where
118 T: std::convert::Into<i64>,
119 {
120 self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
121 self
122 }
123
124 pub fn set_or_clear_if_metageneration_not_match<T>(
126 mut self,
127 v: std::option::Option<T>,
128 ) -> Self
129 where
130 T: std::convert::Into<i64>,
131 {
132 self.0.request.if_metageneration_not_match = v.map(|x| x.into());
133 self
134 }
135 }
136
137 #[doc(hidden)]
138 impl crate::RequestBuilder for DeleteBucket {
139 fn request_options(&mut self) -> &mut crate::RequestOptions {
140 &mut self.0.options
141 }
142 }
143
144 #[derive(Clone, Debug)]
161 pub struct GetBucket(RequestBuilder<crate::model::GetBucketRequest>);
162
163 impl GetBucket {
164 pub(crate) fn new(
165 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
166 ) -> Self {
167 Self(RequestBuilder::new(stub))
168 }
169
170 pub fn with_request<V: Into<crate::model::GetBucketRequest>>(mut self, v: V) -> Self {
172 self.0.request = v.into();
173 self
174 }
175
176 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
178 self.0.options = v.into();
179 self
180 }
181
182 pub async fn send(self) -> Result<crate::model::Bucket> {
184 (*self.0.stub)
185 .get_bucket(self.0.request, self.0.options)
186 .await
187 .map(crate::Response::into_body)
188 }
189
190 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
194 self.0.request.name = v.into();
195 self
196 }
197
198 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
200 where
201 T: std::convert::Into<i64>,
202 {
203 self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
204 self
205 }
206
207 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
209 where
210 T: std::convert::Into<i64>,
211 {
212 self.0.request.if_metageneration_match = v.map(|x| x.into());
213 self
214 }
215
216 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
218 where
219 T: std::convert::Into<i64>,
220 {
221 self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
222 self
223 }
224
225 pub fn set_or_clear_if_metageneration_not_match<T>(
227 mut self,
228 v: std::option::Option<T>,
229 ) -> Self
230 where
231 T: std::convert::Into<i64>,
232 {
233 self.0.request.if_metageneration_not_match = v.map(|x| x.into());
234 self
235 }
236
237 pub fn set_read_mask<T>(mut self, v: T) -> Self
239 where
240 T: std::convert::Into<wkt::FieldMask>,
241 {
242 self.0.request.read_mask = std::option::Option::Some(v.into());
243 self
244 }
245
246 pub fn set_or_clear_read_mask<T>(mut self, v: std::option::Option<T>) -> Self
248 where
249 T: std::convert::Into<wkt::FieldMask>,
250 {
251 self.0.request.read_mask = v.map(|x| x.into());
252 self
253 }
254 }
255
256 #[doc(hidden)]
257 impl crate::RequestBuilder for GetBucket {
258 fn request_options(&mut self) -> &mut crate::RequestOptions {
259 &mut self.0.options
260 }
261 }
262
263 #[derive(Clone, Debug)]
280 pub struct CreateBucket(RequestBuilder<crate::model::CreateBucketRequest>);
281
282 impl CreateBucket {
283 pub(crate) fn new(
284 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
285 ) -> Self {
286 Self(RequestBuilder::new(stub))
287 }
288
289 pub fn with_request<V: Into<crate::model::CreateBucketRequest>>(mut self, v: V) -> Self {
291 self.0.request = v.into();
292 self
293 }
294
295 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
297 self.0.options = v.into();
298 self
299 }
300
301 pub async fn send(self) -> Result<crate::model::Bucket> {
303 (*self.0.stub)
304 .create_bucket(self.0.request, self.0.options)
305 .await
306 .map(crate::Response::into_body)
307 }
308
309 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
313 self.0.request.parent = v.into();
314 self
315 }
316
317 pub fn set_bucket<T>(mut self, v: T) -> Self
319 where
320 T: std::convert::Into<crate::model::Bucket>,
321 {
322 self.0.request.bucket = std::option::Option::Some(v.into());
323 self
324 }
325
326 pub fn set_or_clear_bucket<T>(mut self, v: std::option::Option<T>) -> Self
328 where
329 T: std::convert::Into<crate::model::Bucket>,
330 {
331 self.0.request.bucket = v.map(|x| x.into());
332 self
333 }
334
335 pub fn set_bucket_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
339 self.0.request.bucket_id = v.into();
340 self
341 }
342
343 pub fn set_predefined_acl<T: Into<std::string::String>>(mut self, v: T) -> Self {
345 self.0.request.predefined_acl = v.into();
346 self
347 }
348
349 pub fn set_predefined_default_object_acl<T: Into<std::string::String>>(
351 mut self,
352 v: T,
353 ) -> Self {
354 self.0.request.predefined_default_object_acl = v.into();
355 self
356 }
357
358 pub fn set_enable_object_retention<T: Into<bool>>(mut self, v: T) -> Self {
360 self.0.request.enable_object_retention = v.into();
361 self
362 }
363 }
364
365 #[doc(hidden)]
366 impl crate::RequestBuilder for CreateBucket {
367 fn request_options(&mut self) -> &mut crate::RequestOptions {
368 &mut self.0.options
369 }
370 }
371
372 #[derive(Clone, Debug)]
393 pub struct ListBuckets(RequestBuilder<crate::model::ListBucketsRequest>);
394
395 impl ListBuckets {
396 pub(crate) fn new(
397 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
398 ) -> Self {
399 Self(RequestBuilder::new(stub))
400 }
401
402 pub fn with_request<V: Into<crate::model::ListBucketsRequest>>(mut self, v: V) -> Self {
404 self.0.request = v.into();
405 self
406 }
407
408 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
410 self.0.options = v.into();
411 self
412 }
413
414 pub async fn send(self) -> Result<crate::model::ListBucketsResponse> {
416 (*self.0.stub)
417 .list_buckets(self.0.request, self.0.options)
418 .await
419 .map(crate::Response::into_body)
420 }
421
422 pub fn by_page(
424 self,
425 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListBucketsResponse, crate::Error>
426 {
427 use std::clone::Clone;
428 let token = self.0.request.page_token.clone();
429 let execute = move |token: String| {
430 let mut builder = self.clone();
431 builder.0.request = builder.0.request.set_page_token(token);
432 builder.send()
433 };
434 google_cloud_gax::paginator::internal::new_paginator(token, execute)
435 }
436
437 pub fn by_item(
439 self,
440 ) -> impl google_cloud_gax::paginator::ItemPaginator<
441 crate::model::ListBucketsResponse,
442 crate::Error,
443 > {
444 use google_cloud_gax::paginator::Paginator;
445 self.by_page().items()
446 }
447
448 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
452 self.0.request.parent = v.into();
453 self
454 }
455
456 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
458 self.0.request.page_size = v.into();
459 self
460 }
461
462 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
464 self.0.request.page_token = v.into();
465 self
466 }
467
468 pub fn set_prefix<T: Into<std::string::String>>(mut self, v: T) -> Self {
470 self.0.request.prefix = v.into();
471 self
472 }
473
474 pub fn set_read_mask<T>(mut self, v: T) -> Self
476 where
477 T: std::convert::Into<wkt::FieldMask>,
478 {
479 self.0.request.read_mask = std::option::Option::Some(v.into());
480 self
481 }
482
483 pub fn set_or_clear_read_mask<T>(mut self, v: std::option::Option<T>) -> Self
485 where
486 T: std::convert::Into<wkt::FieldMask>,
487 {
488 self.0.request.read_mask = v.map(|x| x.into());
489 self
490 }
491
492 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
494 self.0.request.return_partial_success = v.into();
495 self
496 }
497 }
498
499 #[doc(hidden)]
500 impl crate::RequestBuilder for ListBuckets {
501 fn request_options(&mut self) -> &mut crate::RequestOptions {
502 &mut self.0.options
503 }
504 }
505
506 #[derive(Clone, Debug)]
523 pub struct LockBucketRetentionPolicy(
524 RequestBuilder<crate::model::LockBucketRetentionPolicyRequest>,
525 );
526
527 impl LockBucketRetentionPolicy {
528 pub(crate) fn new(
529 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
530 ) -> Self {
531 Self(RequestBuilder::new(stub))
532 }
533
534 pub fn with_request<V: Into<crate::model::LockBucketRetentionPolicyRequest>>(
536 mut self,
537 v: V,
538 ) -> Self {
539 self.0.request = v.into();
540 self
541 }
542
543 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
545 self.0.options = v.into();
546 self
547 }
548
549 pub async fn send(self) -> Result<crate::model::Bucket> {
551 (*self.0.stub)
552 .lock_bucket_retention_policy(self.0.request, self.0.options)
553 .await
554 .map(crate::Response::into_body)
555 }
556
557 pub fn set_bucket<T: Into<std::string::String>>(mut self, v: T) -> Self {
561 self.0.request.bucket = v.into();
562 self
563 }
564
565 pub fn set_if_metageneration_match<T: Into<i64>>(mut self, v: T) -> Self {
569 self.0.request.if_metageneration_match = v.into();
570 self
571 }
572 }
573
574 #[doc(hidden)]
575 impl crate::RequestBuilder for LockBucketRetentionPolicy {
576 fn request_options(&mut self) -> &mut crate::RequestOptions {
577 &mut self.0.options
578 }
579 }
580
581 #[derive(Clone, Debug)]
598 pub struct UpdateBucket(RequestBuilder<crate::model::UpdateBucketRequest>);
599
600 impl UpdateBucket {
601 pub(crate) fn new(
602 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
603 ) -> Self {
604 Self(RequestBuilder::new(stub))
605 }
606
607 pub fn with_request<V: Into<crate::model::UpdateBucketRequest>>(mut self, v: V) -> Self {
609 self.0.request = v.into();
610 self
611 }
612
613 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
615 self.0.options = v.into();
616 self
617 }
618
619 pub async fn send(self) -> Result<crate::model::Bucket> {
621 (*self.0.stub)
622 .update_bucket(self.0.request, self.0.options)
623 .await
624 .map(crate::Response::into_body)
625 }
626
627 pub fn set_bucket<T>(mut self, v: T) -> Self
631 where
632 T: std::convert::Into<crate::model::Bucket>,
633 {
634 self.0.request.bucket = std::option::Option::Some(v.into());
635 self
636 }
637
638 pub fn set_or_clear_bucket<T>(mut self, v: std::option::Option<T>) -> Self
642 where
643 T: std::convert::Into<crate::model::Bucket>,
644 {
645 self.0.request.bucket = v.map(|x| x.into());
646 self
647 }
648
649 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
651 where
652 T: std::convert::Into<i64>,
653 {
654 self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
655 self
656 }
657
658 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
660 where
661 T: std::convert::Into<i64>,
662 {
663 self.0.request.if_metageneration_match = v.map(|x| x.into());
664 self
665 }
666
667 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
669 where
670 T: std::convert::Into<i64>,
671 {
672 self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
673 self
674 }
675
676 pub fn set_or_clear_if_metageneration_not_match<T>(
678 mut self,
679 v: std::option::Option<T>,
680 ) -> Self
681 where
682 T: std::convert::Into<i64>,
683 {
684 self.0.request.if_metageneration_not_match = v.map(|x| x.into());
685 self
686 }
687
688 pub fn set_predefined_acl<T: Into<std::string::String>>(mut self, v: T) -> Self {
690 self.0.request.predefined_acl = v.into();
691 self
692 }
693
694 pub fn set_predefined_default_object_acl<T: Into<std::string::String>>(
696 mut self,
697 v: T,
698 ) -> Self {
699 self.0.request.predefined_default_object_acl = v.into();
700 self
701 }
702
703 pub fn set_update_mask<T>(mut self, v: T) -> Self
707 where
708 T: std::convert::Into<wkt::FieldMask>,
709 {
710 self.0.request.update_mask = std::option::Option::Some(v.into());
711 self
712 }
713
714 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
718 where
719 T: std::convert::Into<wkt::FieldMask>,
720 {
721 self.0.request.update_mask = v.map(|x| x.into());
722 self
723 }
724 }
725
726 #[doc(hidden)]
727 impl crate::RequestBuilder for UpdateBucket {
728 fn request_options(&mut self) -> &mut crate::RequestOptions {
729 &mut self.0.options
730 }
731 }
732
733 #[derive(Clone, Debug)]
750 pub struct ComposeObject(RequestBuilder<crate::model::ComposeObjectRequest>);
751
752 impl ComposeObject {
753 pub(crate) fn new(
754 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
755 ) -> Self {
756 Self(RequestBuilder::new(stub))
757 }
758
759 pub fn with_request<V: Into<crate::model::ComposeObjectRequest>>(mut self, v: V) -> Self {
761 self.0.request = v.into();
762 self
763 }
764
765 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
767 self.0.options = v.into();
768 self
769 }
770
771 pub async fn send(self) -> Result<crate::model::Object> {
773 (*self.0.stub)
774 .compose_object(self.0.request, self.0.options)
775 .await
776 .map(crate::Response::into_body)
777 }
778
779 pub fn set_destination<T>(mut self, v: T) -> Self
783 where
784 T: std::convert::Into<crate::model::Object>,
785 {
786 self.0.request.destination = std::option::Option::Some(v.into());
787 self
788 }
789
790 pub fn set_or_clear_destination<T>(mut self, v: std::option::Option<T>) -> Self
794 where
795 T: std::convert::Into<crate::model::Object>,
796 {
797 self.0.request.destination = v.map(|x| x.into());
798 self
799 }
800
801 pub fn set_source_objects<T, V>(mut self, v: T) -> Self
803 where
804 T: std::iter::IntoIterator<Item = V>,
805 V: std::convert::Into<crate::model::compose_object_request::SourceObject>,
806 {
807 use std::iter::Iterator;
808 self.0.request.source_objects = v.into_iter().map(|i| i.into()).collect();
809 self
810 }
811
812 pub fn set_destination_predefined_acl<T: Into<std::string::String>>(
814 mut self,
815 v: T,
816 ) -> Self {
817 self.0.request.destination_predefined_acl = v.into();
818 self
819 }
820
821 pub fn set_if_generation_match<T>(mut self, v: T) -> Self
823 where
824 T: std::convert::Into<i64>,
825 {
826 self.0.request.if_generation_match = std::option::Option::Some(v.into());
827 self
828 }
829
830 pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
832 where
833 T: std::convert::Into<i64>,
834 {
835 self.0.request.if_generation_match = v.map(|x| x.into());
836 self
837 }
838
839 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
841 where
842 T: std::convert::Into<i64>,
843 {
844 self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
845 self
846 }
847
848 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
850 where
851 T: std::convert::Into<i64>,
852 {
853 self.0.request.if_metageneration_match = v.map(|x| x.into());
854 self
855 }
856
857 pub fn set_kms_key<T: Into<std::string::String>>(mut self, v: T) -> Self {
859 self.0.request.kms_key = v.into();
860 self
861 }
862
863 pub fn set_common_object_request_params<T>(mut self, v: T) -> Self
865 where
866 T: std::convert::Into<crate::model::CommonObjectRequestParams>,
867 {
868 self.0.request.common_object_request_params = std::option::Option::Some(v.into());
869 self
870 }
871
872 pub fn set_or_clear_common_object_request_params<T>(
874 mut self,
875 v: std::option::Option<T>,
876 ) -> Self
877 where
878 T: std::convert::Into<crate::model::CommonObjectRequestParams>,
879 {
880 self.0.request.common_object_request_params = v.map(|x| x.into());
881 self
882 }
883
884 pub fn set_object_checksums<T>(mut self, v: T) -> Self
886 where
887 T: std::convert::Into<crate::model::ObjectChecksums>,
888 {
889 self.0.request.object_checksums = std::option::Option::Some(v.into());
890 self
891 }
892
893 pub fn set_or_clear_object_checksums<T>(mut self, v: std::option::Option<T>) -> Self
895 where
896 T: std::convert::Into<crate::model::ObjectChecksums>,
897 {
898 self.0.request.object_checksums = v.map(|x| x.into());
899 self
900 }
901
902 pub fn set_delete_source_objects<T>(mut self, v: T) -> Self
904 where
905 T: std::convert::Into<bool>,
906 {
907 self.0.request.delete_source_objects = std::option::Option::Some(v.into());
908 self
909 }
910
911 pub fn set_or_clear_delete_source_objects<T>(mut self, v: std::option::Option<T>) -> Self
913 where
914 T: std::convert::Into<bool>,
915 {
916 self.0.request.delete_source_objects = v.map(|x| x.into());
917 self
918 }
919 }
920
921 #[doc(hidden)]
922 impl crate::RequestBuilder for ComposeObject {
923 fn request_options(&mut self) -> &mut crate::RequestOptions {
924 &mut self.0.options
925 }
926 }
927
928 #[derive(Clone, Debug)]
945 pub struct DeleteObject(RequestBuilder<crate::model::DeleteObjectRequest>);
946
947 impl DeleteObject {
948 pub(crate) fn new(
949 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
950 ) -> Self {
951 Self(RequestBuilder::new(stub))
952 }
953
954 pub fn with_request<V: Into<crate::model::DeleteObjectRequest>>(mut self, v: V) -> Self {
956 self.0.request = v.into();
957 self
958 }
959
960 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
962 self.0.options = v.into();
963 self
964 }
965
966 pub async fn send(self) -> Result<()> {
968 (*self.0.stub)
969 .delete_object(self.0.request, self.0.options)
970 .await
971 .map(crate::Response::into_body)
972 }
973
974 pub fn set_bucket<T: Into<std::string::String>>(mut self, v: T) -> Self {
978 self.0.request.bucket = v.into();
979 self
980 }
981
982 pub fn set_object<T: Into<std::string::String>>(mut self, v: T) -> Self {
986 self.0.request.object = v.into();
987 self
988 }
989
990 pub fn set_generation<T: Into<i64>>(mut self, v: T) -> Self {
992 self.0.request.generation = v.into();
993 self
994 }
995
996 pub fn set_if_generation_match<T>(mut self, v: T) -> Self
998 where
999 T: std::convert::Into<i64>,
1000 {
1001 self.0.request.if_generation_match = std::option::Option::Some(v.into());
1002 self
1003 }
1004
1005 pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
1007 where
1008 T: std::convert::Into<i64>,
1009 {
1010 self.0.request.if_generation_match = v.map(|x| x.into());
1011 self
1012 }
1013
1014 pub fn set_if_generation_not_match<T>(mut self, v: T) -> Self
1016 where
1017 T: std::convert::Into<i64>,
1018 {
1019 self.0.request.if_generation_not_match = std::option::Option::Some(v.into());
1020 self
1021 }
1022
1023 pub fn set_or_clear_if_generation_not_match<T>(mut self, v: std::option::Option<T>) -> Self
1025 where
1026 T: std::convert::Into<i64>,
1027 {
1028 self.0.request.if_generation_not_match = v.map(|x| x.into());
1029 self
1030 }
1031
1032 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
1034 where
1035 T: std::convert::Into<i64>,
1036 {
1037 self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
1038 self
1039 }
1040
1041 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
1043 where
1044 T: std::convert::Into<i64>,
1045 {
1046 self.0.request.if_metageneration_match = v.map(|x| x.into());
1047 self
1048 }
1049
1050 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
1052 where
1053 T: std::convert::Into<i64>,
1054 {
1055 self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
1056 self
1057 }
1058
1059 pub fn set_or_clear_if_metageneration_not_match<T>(
1061 mut self,
1062 v: std::option::Option<T>,
1063 ) -> Self
1064 where
1065 T: std::convert::Into<i64>,
1066 {
1067 self.0.request.if_metageneration_not_match = v.map(|x| x.into());
1068 self
1069 }
1070
1071 pub fn set_common_object_request_params<T>(mut self, v: T) -> Self
1073 where
1074 T: std::convert::Into<crate::model::CommonObjectRequestParams>,
1075 {
1076 self.0.request.common_object_request_params = std::option::Option::Some(v.into());
1077 self
1078 }
1079
1080 pub fn set_or_clear_common_object_request_params<T>(
1082 mut self,
1083 v: std::option::Option<T>,
1084 ) -> Self
1085 where
1086 T: std::convert::Into<crate::model::CommonObjectRequestParams>,
1087 {
1088 self.0.request.common_object_request_params = v.map(|x| x.into());
1089 self
1090 }
1091 }
1092
1093 #[doc(hidden)]
1094 impl crate::RequestBuilder for DeleteObject {
1095 fn request_options(&mut self) -> &mut crate::RequestOptions {
1096 &mut self.0.options
1097 }
1098 }
1099
1100 #[derive(Clone, Debug)]
1117 pub struct RestoreObject(RequestBuilder<crate::model::RestoreObjectRequest>);
1118
1119 impl RestoreObject {
1120 pub(crate) fn new(
1121 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1122 ) -> Self {
1123 Self(RequestBuilder::new(stub))
1124 }
1125
1126 pub fn with_request<V: Into<crate::model::RestoreObjectRequest>>(mut self, v: V) -> Self {
1128 self.0.request = v.into();
1129 self
1130 }
1131
1132 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1134 self.0.options = v.into();
1135 self
1136 }
1137
1138 pub async fn send(self) -> Result<crate::model::Object> {
1140 (*self.0.stub)
1141 .restore_object(self.0.request, self.0.options)
1142 .await
1143 .map(crate::Response::into_body)
1144 }
1145
1146 pub fn set_bucket<T: Into<std::string::String>>(mut self, v: T) -> Self {
1150 self.0.request.bucket = v.into();
1151 self
1152 }
1153
1154 pub fn set_object<T: Into<std::string::String>>(mut self, v: T) -> Self {
1158 self.0.request.object = v.into();
1159 self
1160 }
1161
1162 pub fn set_generation<T: Into<i64>>(mut self, v: T) -> Self {
1166 self.0.request.generation = v.into();
1167 self
1168 }
1169
1170 pub fn set_restore_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1172 self.0.request.restore_token = v.into();
1173 self
1174 }
1175
1176 pub fn set_if_generation_match<T>(mut self, v: T) -> Self
1178 where
1179 T: std::convert::Into<i64>,
1180 {
1181 self.0.request.if_generation_match = std::option::Option::Some(v.into());
1182 self
1183 }
1184
1185 pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
1187 where
1188 T: std::convert::Into<i64>,
1189 {
1190 self.0.request.if_generation_match = v.map(|x| x.into());
1191 self
1192 }
1193
1194 pub fn set_if_generation_not_match<T>(mut self, v: T) -> Self
1196 where
1197 T: std::convert::Into<i64>,
1198 {
1199 self.0.request.if_generation_not_match = std::option::Option::Some(v.into());
1200 self
1201 }
1202
1203 pub fn set_or_clear_if_generation_not_match<T>(mut self, v: std::option::Option<T>) -> Self
1205 where
1206 T: std::convert::Into<i64>,
1207 {
1208 self.0.request.if_generation_not_match = v.map(|x| x.into());
1209 self
1210 }
1211
1212 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
1214 where
1215 T: std::convert::Into<i64>,
1216 {
1217 self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
1218 self
1219 }
1220
1221 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
1223 where
1224 T: std::convert::Into<i64>,
1225 {
1226 self.0.request.if_metageneration_match = v.map(|x| x.into());
1227 self
1228 }
1229
1230 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
1232 where
1233 T: std::convert::Into<i64>,
1234 {
1235 self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
1236 self
1237 }
1238
1239 pub fn set_or_clear_if_metageneration_not_match<T>(
1241 mut self,
1242 v: std::option::Option<T>,
1243 ) -> Self
1244 where
1245 T: std::convert::Into<i64>,
1246 {
1247 self.0.request.if_metageneration_not_match = v.map(|x| x.into());
1248 self
1249 }
1250
1251 pub fn set_copy_source_acl<T>(mut self, v: T) -> Self
1253 where
1254 T: std::convert::Into<bool>,
1255 {
1256 self.0.request.copy_source_acl = std::option::Option::Some(v.into());
1257 self
1258 }
1259
1260 pub fn set_or_clear_copy_source_acl<T>(mut self, v: std::option::Option<T>) -> Self
1262 where
1263 T: std::convert::Into<bool>,
1264 {
1265 self.0.request.copy_source_acl = v.map(|x| x.into());
1266 self
1267 }
1268
1269 pub fn set_common_object_request_params<T>(mut self, v: T) -> Self
1271 where
1272 T: std::convert::Into<crate::model::CommonObjectRequestParams>,
1273 {
1274 self.0.request.common_object_request_params = std::option::Option::Some(v.into());
1275 self
1276 }
1277
1278 pub fn set_or_clear_common_object_request_params<T>(
1280 mut self,
1281 v: std::option::Option<T>,
1282 ) -> Self
1283 where
1284 T: std::convert::Into<crate::model::CommonObjectRequestParams>,
1285 {
1286 self.0.request.common_object_request_params = v.map(|x| x.into());
1287 self
1288 }
1289 }
1290
1291 #[doc(hidden)]
1292 impl crate::RequestBuilder for RestoreObject {
1293 fn request_options(&mut self) -> &mut crate::RequestOptions {
1294 &mut self.0.options
1295 }
1296 }
1297
1298 #[derive(Clone, Debug)]
1315 pub struct GetObject(RequestBuilder<crate::model::GetObjectRequest>);
1316
1317 impl GetObject {
1318 pub(crate) fn new(
1319 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1320 ) -> Self {
1321 Self(RequestBuilder::new(stub))
1322 }
1323
1324 pub fn with_request<V: Into<crate::model::GetObjectRequest>>(mut self, v: V) -> Self {
1326 self.0.request = v.into();
1327 self
1328 }
1329
1330 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1332 self.0.options = v.into();
1333 self
1334 }
1335
1336 pub async fn send(self) -> Result<crate::model::Object> {
1338 (*self.0.stub)
1339 .get_object(self.0.request, self.0.options)
1340 .await
1341 .map(crate::Response::into_body)
1342 }
1343
1344 pub fn set_bucket<T: Into<std::string::String>>(mut self, v: T) -> Self {
1348 self.0.request.bucket = v.into();
1349 self
1350 }
1351
1352 pub fn set_object<T: Into<std::string::String>>(mut self, v: T) -> Self {
1356 self.0.request.object = v.into();
1357 self
1358 }
1359
1360 pub fn set_generation<T: Into<i64>>(mut self, v: T) -> Self {
1362 self.0.request.generation = v.into();
1363 self
1364 }
1365
1366 pub fn set_soft_deleted<T>(mut self, v: T) -> Self
1368 where
1369 T: std::convert::Into<bool>,
1370 {
1371 self.0.request.soft_deleted = std::option::Option::Some(v.into());
1372 self
1373 }
1374
1375 pub fn set_or_clear_soft_deleted<T>(mut self, v: std::option::Option<T>) -> Self
1377 where
1378 T: std::convert::Into<bool>,
1379 {
1380 self.0.request.soft_deleted = v.map(|x| x.into());
1381 self
1382 }
1383
1384 pub fn set_if_generation_match<T>(mut self, v: T) -> Self
1386 where
1387 T: std::convert::Into<i64>,
1388 {
1389 self.0.request.if_generation_match = std::option::Option::Some(v.into());
1390 self
1391 }
1392
1393 pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
1395 where
1396 T: std::convert::Into<i64>,
1397 {
1398 self.0.request.if_generation_match = v.map(|x| x.into());
1399 self
1400 }
1401
1402 pub fn set_if_generation_not_match<T>(mut self, v: T) -> Self
1404 where
1405 T: std::convert::Into<i64>,
1406 {
1407 self.0.request.if_generation_not_match = std::option::Option::Some(v.into());
1408 self
1409 }
1410
1411 pub fn set_or_clear_if_generation_not_match<T>(mut self, v: std::option::Option<T>) -> Self
1413 where
1414 T: std::convert::Into<i64>,
1415 {
1416 self.0.request.if_generation_not_match = v.map(|x| x.into());
1417 self
1418 }
1419
1420 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
1422 where
1423 T: std::convert::Into<i64>,
1424 {
1425 self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
1426 self
1427 }
1428
1429 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
1431 where
1432 T: std::convert::Into<i64>,
1433 {
1434 self.0.request.if_metageneration_match = v.map(|x| x.into());
1435 self
1436 }
1437
1438 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
1440 where
1441 T: std::convert::Into<i64>,
1442 {
1443 self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
1444 self
1445 }
1446
1447 pub fn set_or_clear_if_metageneration_not_match<T>(
1449 mut self,
1450 v: std::option::Option<T>,
1451 ) -> Self
1452 where
1453 T: std::convert::Into<i64>,
1454 {
1455 self.0.request.if_metageneration_not_match = v.map(|x| x.into());
1456 self
1457 }
1458
1459 pub fn set_common_object_request_params<T>(mut self, v: T) -> Self
1461 where
1462 T: std::convert::Into<crate::model::CommonObjectRequestParams>,
1463 {
1464 self.0.request.common_object_request_params = std::option::Option::Some(v.into());
1465 self
1466 }
1467
1468 pub fn set_or_clear_common_object_request_params<T>(
1470 mut self,
1471 v: std::option::Option<T>,
1472 ) -> Self
1473 where
1474 T: std::convert::Into<crate::model::CommonObjectRequestParams>,
1475 {
1476 self.0.request.common_object_request_params = v.map(|x| x.into());
1477 self
1478 }
1479
1480 pub fn set_read_mask<T>(mut self, v: T) -> Self
1482 where
1483 T: std::convert::Into<wkt::FieldMask>,
1484 {
1485 self.0.request.read_mask = std::option::Option::Some(v.into());
1486 self
1487 }
1488
1489 pub fn set_or_clear_read_mask<T>(mut self, v: std::option::Option<T>) -> Self
1491 where
1492 T: std::convert::Into<wkt::FieldMask>,
1493 {
1494 self.0.request.read_mask = v.map(|x| x.into());
1495 self
1496 }
1497
1498 pub fn set_restore_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1500 self.0.request.restore_token = v.into();
1501 self
1502 }
1503 }
1504
1505 #[doc(hidden)]
1506 impl crate::RequestBuilder for GetObject {
1507 fn request_options(&mut self) -> &mut crate::RequestOptions {
1508 &mut self.0.options
1509 }
1510 }
1511
1512 #[derive(Clone, Debug)]
1529 pub struct UpdateObject(RequestBuilder<crate::model::UpdateObjectRequest>);
1530
1531 impl UpdateObject {
1532 pub(crate) fn new(
1533 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1534 ) -> Self {
1535 Self(RequestBuilder::new(stub))
1536 }
1537
1538 pub fn with_request<V: Into<crate::model::UpdateObjectRequest>>(mut self, v: V) -> Self {
1540 self.0.request = v.into();
1541 self
1542 }
1543
1544 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1546 self.0.options = v.into();
1547 self
1548 }
1549
1550 pub async fn send(self) -> Result<crate::model::Object> {
1552 (*self.0.stub)
1553 .update_object(self.0.request, self.0.options)
1554 .await
1555 .map(crate::Response::into_body)
1556 }
1557
1558 pub fn set_object<T>(mut self, v: T) -> Self
1562 where
1563 T: std::convert::Into<crate::model::Object>,
1564 {
1565 self.0.request.object = std::option::Option::Some(v.into());
1566 self
1567 }
1568
1569 pub fn set_or_clear_object<T>(mut self, v: std::option::Option<T>) -> Self
1573 where
1574 T: std::convert::Into<crate::model::Object>,
1575 {
1576 self.0.request.object = v.map(|x| x.into());
1577 self
1578 }
1579
1580 pub fn set_if_generation_match<T>(mut self, v: T) -> Self
1582 where
1583 T: std::convert::Into<i64>,
1584 {
1585 self.0.request.if_generation_match = std::option::Option::Some(v.into());
1586 self
1587 }
1588
1589 pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
1591 where
1592 T: std::convert::Into<i64>,
1593 {
1594 self.0.request.if_generation_match = v.map(|x| x.into());
1595 self
1596 }
1597
1598 pub fn set_if_generation_not_match<T>(mut self, v: T) -> Self
1600 where
1601 T: std::convert::Into<i64>,
1602 {
1603 self.0.request.if_generation_not_match = std::option::Option::Some(v.into());
1604 self
1605 }
1606
1607 pub fn set_or_clear_if_generation_not_match<T>(mut self, v: std::option::Option<T>) -> Self
1609 where
1610 T: std::convert::Into<i64>,
1611 {
1612 self.0.request.if_generation_not_match = v.map(|x| x.into());
1613 self
1614 }
1615
1616 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
1618 where
1619 T: std::convert::Into<i64>,
1620 {
1621 self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
1622 self
1623 }
1624
1625 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
1627 where
1628 T: std::convert::Into<i64>,
1629 {
1630 self.0.request.if_metageneration_match = v.map(|x| x.into());
1631 self
1632 }
1633
1634 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
1636 where
1637 T: std::convert::Into<i64>,
1638 {
1639 self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
1640 self
1641 }
1642
1643 pub fn set_or_clear_if_metageneration_not_match<T>(
1645 mut self,
1646 v: std::option::Option<T>,
1647 ) -> Self
1648 where
1649 T: std::convert::Into<i64>,
1650 {
1651 self.0.request.if_metageneration_not_match = v.map(|x| x.into());
1652 self
1653 }
1654
1655 pub fn set_predefined_acl<T: Into<std::string::String>>(mut self, v: T) -> Self {
1657 self.0.request.predefined_acl = v.into();
1658 self
1659 }
1660
1661 pub fn set_update_mask<T>(mut self, v: T) -> Self
1665 where
1666 T: std::convert::Into<wkt::FieldMask>,
1667 {
1668 self.0.request.update_mask = std::option::Option::Some(v.into());
1669 self
1670 }
1671
1672 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1676 where
1677 T: std::convert::Into<wkt::FieldMask>,
1678 {
1679 self.0.request.update_mask = v.map(|x| x.into());
1680 self
1681 }
1682
1683 pub fn set_common_object_request_params<T>(mut self, v: T) -> Self
1685 where
1686 T: std::convert::Into<crate::model::CommonObjectRequestParams>,
1687 {
1688 self.0.request.common_object_request_params = std::option::Option::Some(v.into());
1689 self
1690 }
1691
1692 pub fn set_or_clear_common_object_request_params<T>(
1694 mut self,
1695 v: std::option::Option<T>,
1696 ) -> Self
1697 where
1698 T: std::convert::Into<crate::model::CommonObjectRequestParams>,
1699 {
1700 self.0.request.common_object_request_params = v.map(|x| x.into());
1701 self
1702 }
1703
1704 pub fn set_override_unlocked_retention<T: Into<bool>>(mut self, v: T) -> Self {
1706 self.0.request.override_unlocked_retention = v.into();
1707 self
1708 }
1709 }
1710
1711 #[doc(hidden)]
1712 impl crate::RequestBuilder for UpdateObject {
1713 fn request_options(&mut self) -> &mut crate::RequestOptions {
1714 &mut self.0.options
1715 }
1716 }
1717
1718 #[derive(Clone, Debug)]
1739 pub struct ListObjects(RequestBuilder<crate::model::ListObjectsRequest>);
1740
1741 impl ListObjects {
1742 pub(crate) fn new(
1743 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1744 ) -> Self {
1745 Self(RequestBuilder::new(stub))
1746 }
1747
1748 pub fn with_request<V: Into<crate::model::ListObjectsRequest>>(mut self, v: V) -> Self {
1750 self.0.request = v.into();
1751 self
1752 }
1753
1754 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1756 self.0.options = v.into();
1757 self
1758 }
1759
1760 pub async fn send(self) -> Result<crate::model::ListObjectsResponse> {
1762 (*self.0.stub)
1763 .list_objects(self.0.request, self.0.options)
1764 .await
1765 .map(crate::Response::into_body)
1766 }
1767
1768 pub fn by_page(
1770 self,
1771 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListObjectsResponse, crate::Error>
1772 {
1773 use std::clone::Clone;
1774 let token = self.0.request.page_token.clone();
1775 let execute = move |token: String| {
1776 let mut builder = self.clone();
1777 builder.0.request = builder.0.request.set_page_token(token);
1778 builder.send()
1779 };
1780 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1781 }
1782
1783 pub fn by_item(
1785 self,
1786 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1787 crate::model::ListObjectsResponse,
1788 crate::Error,
1789 > {
1790 use google_cloud_gax::paginator::Paginator;
1791 self.by_page().items()
1792 }
1793
1794 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1798 self.0.request.parent = v.into();
1799 self
1800 }
1801
1802 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1804 self.0.request.page_size = v.into();
1805 self
1806 }
1807
1808 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1810 self.0.request.page_token = v.into();
1811 self
1812 }
1813
1814 pub fn set_delimiter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1816 self.0.request.delimiter = v.into();
1817 self
1818 }
1819
1820 pub fn set_include_trailing_delimiter<T: Into<bool>>(mut self, v: T) -> Self {
1822 self.0.request.include_trailing_delimiter = v.into();
1823 self
1824 }
1825
1826 pub fn set_prefix<T: Into<std::string::String>>(mut self, v: T) -> Self {
1828 self.0.request.prefix = v.into();
1829 self
1830 }
1831
1832 pub fn set_versions<T: Into<bool>>(mut self, v: T) -> Self {
1834 self.0.request.versions = v.into();
1835 self
1836 }
1837
1838 pub fn set_read_mask<T>(mut self, v: T) -> Self
1840 where
1841 T: std::convert::Into<wkt::FieldMask>,
1842 {
1843 self.0.request.read_mask = std::option::Option::Some(v.into());
1844 self
1845 }
1846
1847 pub fn set_or_clear_read_mask<T>(mut self, v: std::option::Option<T>) -> Self
1849 where
1850 T: std::convert::Into<wkt::FieldMask>,
1851 {
1852 self.0.request.read_mask = v.map(|x| x.into());
1853 self
1854 }
1855
1856 pub fn set_lexicographic_start<T: Into<std::string::String>>(mut self, v: T) -> Self {
1858 self.0.request.lexicographic_start = v.into();
1859 self
1860 }
1861
1862 pub fn set_lexicographic_end<T: Into<std::string::String>>(mut self, v: T) -> Self {
1864 self.0.request.lexicographic_end = v.into();
1865 self
1866 }
1867
1868 pub fn set_soft_deleted<T: Into<bool>>(mut self, v: T) -> Self {
1870 self.0.request.soft_deleted = v.into();
1871 self
1872 }
1873
1874 pub fn set_include_folders_as_prefixes<T: Into<bool>>(mut self, v: T) -> Self {
1876 self.0.request.include_folders_as_prefixes = v.into();
1877 self
1878 }
1879
1880 pub fn set_match_glob<T: Into<std::string::String>>(mut self, v: T) -> Self {
1882 self.0.request.match_glob = v.into();
1883 self
1884 }
1885
1886 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1888 self.0.request.filter = v.into();
1889 self
1890 }
1891 }
1892
1893 #[doc(hidden)]
1894 impl crate::RequestBuilder for ListObjects {
1895 fn request_options(&mut self) -> &mut crate::RequestOptions {
1896 &mut self.0.options
1897 }
1898 }
1899
1900 #[derive(Clone, Debug)]
1917 pub struct RewriteObject(RequestBuilder<crate::model::RewriteObjectRequest>);
1918
1919 impl RewriteObject {
1920 pub(crate) fn new(
1921 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1922 ) -> Self {
1923 Self(RequestBuilder::new(stub))
1924 }
1925
1926 pub fn with_request<V: Into<crate::model::RewriteObjectRequest>>(mut self, v: V) -> Self {
1928 self.0.request = v.into();
1929 self
1930 }
1931
1932 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1934 self.0.options = v.into();
1935 self
1936 }
1937
1938 pub async fn send(self) -> Result<crate::model::RewriteResponse> {
1940 (*self.0.stub)
1941 .rewrite_object(self.0.request, self.0.options)
1942 .await
1943 .map(crate::Response::into_body)
1944 }
1945
1946 pub fn set_destination_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1950 self.0.request.destination_name = v.into();
1951 self
1952 }
1953
1954 pub fn set_destination_bucket<T: Into<std::string::String>>(mut self, v: T) -> Self {
1958 self.0.request.destination_bucket = v.into();
1959 self
1960 }
1961
1962 pub fn set_destination_kms_key<T: Into<std::string::String>>(mut self, v: T) -> Self {
1964 self.0.request.destination_kms_key = v.into();
1965 self
1966 }
1967
1968 pub fn set_destination<T>(mut self, v: T) -> Self
1970 where
1971 T: std::convert::Into<crate::model::Object>,
1972 {
1973 self.0.request.destination = std::option::Option::Some(v.into());
1974 self
1975 }
1976
1977 pub fn set_or_clear_destination<T>(mut self, v: std::option::Option<T>) -> Self
1979 where
1980 T: std::convert::Into<crate::model::Object>,
1981 {
1982 self.0.request.destination = v.map(|x| x.into());
1983 self
1984 }
1985
1986 pub fn set_source_bucket<T: Into<std::string::String>>(mut self, v: T) -> Self {
1990 self.0.request.source_bucket = v.into();
1991 self
1992 }
1993
1994 pub fn set_source_object<T: Into<std::string::String>>(mut self, v: T) -> Self {
1998 self.0.request.source_object = v.into();
1999 self
2000 }
2001
2002 pub fn set_source_generation<T: Into<i64>>(mut self, v: T) -> Self {
2004 self.0.request.source_generation = v.into();
2005 self
2006 }
2007
2008 pub fn set_rewrite_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2010 self.0.request.rewrite_token = v.into();
2011 self
2012 }
2013
2014 pub fn set_destination_predefined_acl<T: Into<std::string::String>>(
2016 mut self,
2017 v: T,
2018 ) -> Self {
2019 self.0.request.destination_predefined_acl = v.into();
2020 self
2021 }
2022
2023 pub fn set_if_generation_match<T>(mut self, v: T) -> Self
2025 where
2026 T: std::convert::Into<i64>,
2027 {
2028 self.0.request.if_generation_match = std::option::Option::Some(v.into());
2029 self
2030 }
2031
2032 pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
2034 where
2035 T: std::convert::Into<i64>,
2036 {
2037 self.0.request.if_generation_match = v.map(|x| x.into());
2038 self
2039 }
2040
2041 pub fn set_if_generation_not_match<T>(mut self, v: T) -> Self
2043 where
2044 T: std::convert::Into<i64>,
2045 {
2046 self.0.request.if_generation_not_match = std::option::Option::Some(v.into());
2047 self
2048 }
2049
2050 pub fn set_or_clear_if_generation_not_match<T>(mut self, v: std::option::Option<T>) -> Self
2052 where
2053 T: std::convert::Into<i64>,
2054 {
2055 self.0.request.if_generation_not_match = v.map(|x| x.into());
2056 self
2057 }
2058
2059 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
2061 where
2062 T: std::convert::Into<i64>,
2063 {
2064 self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
2065 self
2066 }
2067
2068 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
2070 where
2071 T: std::convert::Into<i64>,
2072 {
2073 self.0.request.if_metageneration_match = v.map(|x| x.into());
2074 self
2075 }
2076
2077 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
2079 where
2080 T: std::convert::Into<i64>,
2081 {
2082 self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
2083 self
2084 }
2085
2086 pub fn set_or_clear_if_metageneration_not_match<T>(
2088 mut self,
2089 v: std::option::Option<T>,
2090 ) -> Self
2091 where
2092 T: std::convert::Into<i64>,
2093 {
2094 self.0.request.if_metageneration_not_match = v.map(|x| x.into());
2095 self
2096 }
2097
2098 pub fn set_if_source_generation_match<T>(mut self, v: T) -> Self
2100 where
2101 T: std::convert::Into<i64>,
2102 {
2103 self.0.request.if_source_generation_match = std::option::Option::Some(v.into());
2104 self
2105 }
2106
2107 pub fn set_or_clear_if_source_generation_match<T>(
2109 mut self,
2110 v: std::option::Option<T>,
2111 ) -> Self
2112 where
2113 T: std::convert::Into<i64>,
2114 {
2115 self.0.request.if_source_generation_match = v.map(|x| x.into());
2116 self
2117 }
2118
2119 pub fn set_if_source_generation_not_match<T>(mut self, v: T) -> Self
2121 where
2122 T: std::convert::Into<i64>,
2123 {
2124 self.0.request.if_source_generation_not_match = std::option::Option::Some(v.into());
2125 self
2126 }
2127
2128 pub fn set_or_clear_if_source_generation_not_match<T>(
2130 mut self,
2131 v: std::option::Option<T>,
2132 ) -> Self
2133 where
2134 T: std::convert::Into<i64>,
2135 {
2136 self.0.request.if_source_generation_not_match = v.map(|x| x.into());
2137 self
2138 }
2139
2140 pub fn set_if_source_metageneration_match<T>(mut self, v: T) -> Self
2142 where
2143 T: std::convert::Into<i64>,
2144 {
2145 self.0.request.if_source_metageneration_match = std::option::Option::Some(v.into());
2146 self
2147 }
2148
2149 pub fn set_or_clear_if_source_metageneration_match<T>(
2151 mut self,
2152 v: std::option::Option<T>,
2153 ) -> Self
2154 where
2155 T: std::convert::Into<i64>,
2156 {
2157 self.0.request.if_source_metageneration_match = v.map(|x| x.into());
2158 self
2159 }
2160
2161 pub fn set_if_source_metageneration_not_match<T>(mut self, v: T) -> Self
2163 where
2164 T: std::convert::Into<i64>,
2165 {
2166 self.0.request.if_source_metageneration_not_match = std::option::Option::Some(v.into());
2167 self
2168 }
2169
2170 pub fn set_or_clear_if_source_metageneration_not_match<T>(
2172 mut self,
2173 v: std::option::Option<T>,
2174 ) -> Self
2175 where
2176 T: std::convert::Into<i64>,
2177 {
2178 self.0.request.if_source_metageneration_not_match = v.map(|x| x.into());
2179 self
2180 }
2181
2182 pub fn set_max_bytes_rewritten_per_call<T: Into<i64>>(mut self, v: T) -> Self {
2184 self.0.request.max_bytes_rewritten_per_call = v.into();
2185 self
2186 }
2187
2188 pub fn set_copy_source_encryption_algorithm<T: Into<std::string::String>>(
2190 mut self,
2191 v: T,
2192 ) -> Self {
2193 self.0.request.copy_source_encryption_algorithm = v.into();
2194 self
2195 }
2196
2197 pub fn set_copy_source_encryption_key_bytes<T: Into<::bytes::Bytes>>(
2199 mut self,
2200 v: T,
2201 ) -> Self {
2202 self.0.request.copy_source_encryption_key_bytes = v.into();
2203 self
2204 }
2205
2206 pub fn set_copy_source_encryption_key_sha256_bytes<T: Into<::bytes::Bytes>>(
2208 mut self,
2209 v: T,
2210 ) -> Self {
2211 self.0.request.copy_source_encryption_key_sha256_bytes = v.into();
2212 self
2213 }
2214
2215 pub fn set_common_object_request_params<T>(mut self, v: T) -> Self
2217 where
2218 T: std::convert::Into<crate::model::CommonObjectRequestParams>,
2219 {
2220 self.0.request.common_object_request_params = std::option::Option::Some(v.into());
2221 self
2222 }
2223
2224 pub fn set_or_clear_common_object_request_params<T>(
2226 mut self,
2227 v: std::option::Option<T>,
2228 ) -> Self
2229 where
2230 T: std::convert::Into<crate::model::CommonObjectRequestParams>,
2231 {
2232 self.0.request.common_object_request_params = v.map(|x| x.into());
2233 self
2234 }
2235
2236 pub fn set_object_checksums<T>(mut self, v: T) -> Self
2238 where
2239 T: std::convert::Into<crate::model::ObjectChecksums>,
2240 {
2241 self.0.request.object_checksums = std::option::Option::Some(v.into());
2242 self
2243 }
2244
2245 pub fn set_or_clear_object_checksums<T>(mut self, v: std::option::Option<T>) -> Self
2247 where
2248 T: std::convert::Into<crate::model::ObjectChecksums>,
2249 {
2250 self.0.request.object_checksums = v.map(|x| x.into());
2251 self
2252 }
2253 }
2254
2255 #[doc(hidden)]
2256 impl crate::RequestBuilder for RewriteObject {
2257 fn request_options(&mut self) -> &mut crate::RequestOptions {
2258 &mut self.0.options
2259 }
2260 }
2261
2262 #[derive(Clone, Debug)]
2279 pub struct MoveObject(RequestBuilder<crate::model::MoveObjectRequest>);
2280
2281 impl MoveObject {
2282 pub(crate) fn new(
2283 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2284 ) -> Self {
2285 Self(RequestBuilder::new(stub))
2286 }
2287
2288 pub fn with_request<V: Into<crate::model::MoveObjectRequest>>(mut self, v: V) -> Self {
2290 self.0.request = v.into();
2291 self
2292 }
2293
2294 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2296 self.0.options = v.into();
2297 self
2298 }
2299
2300 pub async fn send(self) -> Result<crate::model::Object> {
2302 (*self.0.stub)
2303 .move_object(self.0.request, self.0.options)
2304 .await
2305 .map(crate::Response::into_body)
2306 }
2307
2308 pub fn set_bucket<T: Into<std::string::String>>(mut self, v: T) -> Self {
2312 self.0.request.bucket = v.into();
2313 self
2314 }
2315
2316 pub fn set_source_object<T: Into<std::string::String>>(mut self, v: T) -> Self {
2320 self.0.request.source_object = v.into();
2321 self
2322 }
2323
2324 pub fn set_destination_object<T: Into<std::string::String>>(mut self, v: T) -> Self {
2328 self.0.request.destination_object = v.into();
2329 self
2330 }
2331
2332 pub fn set_if_source_generation_match<T>(mut self, v: T) -> Self
2334 where
2335 T: std::convert::Into<i64>,
2336 {
2337 self.0.request.if_source_generation_match = std::option::Option::Some(v.into());
2338 self
2339 }
2340
2341 pub fn set_or_clear_if_source_generation_match<T>(
2343 mut self,
2344 v: std::option::Option<T>,
2345 ) -> Self
2346 where
2347 T: std::convert::Into<i64>,
2348 {
2349 self.0.request.if_source_generation_match = v.map(|x| x.into());
2350 self
2351 }
2352
2353 pub fn set_if_source_generation_not_match<T>(mut self, v: T) -> Self
2355 where
2356 T: std::convert::Into<i64>,
2357 {
2358 self.0.request.if_source_generation_not_match = std::option::Option::Some(v.into());
2359 self
2360 }
2361
2362 pub fn set_or_clear_if_source_generation_not_match<T>(
2364 mut self,
2365 v: std::option::Option<T>,
2366 ) -> Self
2367 where
2368 T: std::convert::Into<i64>,
2369 {
2370 self.0.request.if_source_generation_not_match = v.map(|x| x.into());
2371 self
2372 }
2373
2374 pub fn set_if_source_metageneration_match<T>(mut self, v: T) -> Self
2376 where
2377 T: std::convert::Into<i64>,
2378 {
2379 self.0.request.if_source_metageneration_match = std::option::Option::Some(v.into());
2380 self
2381 }
2382
2383 pub fn set_or_clear_if_source_metageneration_match<T>(
2385 mut self,
2386 v: std::option::Option<T>,
2387 ) -> Self
2388 where
2389 T: std::convert::Into<i64>,
2390 {
2391 self.0.request.if_source_metageneration_match = v.map(|x| x.into());
2392 self
2393 }
2394
2395 pub fn set_if_source_metageneration_not_match<T>(mut self, v: T) -> Self
2397 where
2398 T: std::convert::Into<i64>,
2399 {
2400 self.0.request.if_source_metageneration_not_match = std::option::Option::Some(v.into());
2401 self
2402 }
2403
2404 pub fn set_or_clear_if_source_metageneration_not_match<T>(
2406 mut self,
2407 v: std::option::Option<T>,
2408 ) -> Self
2409 where
2410 T: std::convert::Into<i64>,
2411 {
2412 self.0.request.if_source_metageneration_not_match = v.map(|x| x.into());
2413 self
2414 }
2415
2416 pub fn set_if_generation_match<T>(mut self, v: T) -> Self
2418 where
2419 T: std::convert::Into<i64>,
2420 {
2421 self.0.request.if_generation_match = std::option::Option::Some(v.into());
2422 self
2423 }
2424
2425 pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
2427 where
2428 T: std::convert::Into<i64>,
2429 {
2430 self.0.request.if_generation_match = v.map(|x| x.into());
2431 self
2432 }
2433
2434 pub fn set_if_generation_not_match<T>(mut self, v: T) -> Self
2436 where
2437 T: std::convert::Into<i64>,
2438 {
2439 self.0.request.if_generation_not_match = std::option::Option::Some(v.into());
2440 self
2441 }
2442
2443 pub fn set_or_clear_if_generation_not_match<T>(mut self, v: std::option::Option<T>) -> Self
2445 where
2446 T: std::convert::Into<i64>,
2447 {
2448 self.0.request.if_generation_not_match = v.map(|x| x.into());
2449 self
2450 }
2451
2452 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
2454 where
2455 T: std::convert::Into<i64>,
2456 {
2457 self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
2458 self
2459 }
2460
2461 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
2463 where
2464 T: std::convert::Into<i64>,
2465 {
2466 self.0.request.if_metageneration_match = v.map(|x| x.into());
2467 self
2468 }
2469
2470 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
2472 where
2473 T: std::convert::Into<i64>,
2474 {
2475 self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
2476 self
2477 }
2478
2479 pub fn set_or_clear_if_metageneration_not_match<T>(
2481 mut self,
2482 v: std::option::Option<T>,
2483 ) -> Self
2484 where
2485 T: std::convert::Into<i64>,
2486 {
2487 self.0.request.if_metageneration_not_match = v.map(|x| x.into());
2488 self
2489 }
2490 }
2491
2492 #[doc(hidden)]
2493 impl crate::RequestBuilder for MoveObject {
2494 fn request_options(&mut self) -> &mut crate::RequestOptions {
2495 &mut self.0.options
2496 }
2497 }
2498}