1pub mod storage_control {
18 use crate::Result;
19
20 #[derive(Clone, Debug)]
22 pub(crate) struct RequestBuilder<R: std::default::Default> {
23 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
24 request: R,
25 options: gax::options::RequestOptions,
26 }
27
28 impl<R> RequestBuilder<R>
29 where
30 R: std::default::Default,
31 {
32 pub(crate) fn new(
33 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
34 ) -> Self {
35 Self {
36 stub,
37 request: R::default(),
38 options: gax::options::RequestOptions::default(),
39 }
40 }
41 }
42
43 #[derive(Clone, Debug)]
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<gax::options::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(gax::response::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 gax::options::internal::RequestBuilder for DeleteBucket {
139 fn request_options(&mut self) -> &mut gax::options::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<gax::options::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(gax::response::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 gax::options::internal::RequestBuilder for GetBucket {
258 fn request_options(&mut self) -> &mut gax::options::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<gax::options::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(gax::response::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 gax::options::internal::RequestBuilder for CreateBucket {
367 fn request_options(&mut self) -> &mut gax::options::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<gax::options::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(gax::response::Response::into_body)
420 }
421
422 pub fn by_page(
424 self,
425 ) -> impl gax::paginator::Paginator<crate::model::ListBucketsResponse, gax::error::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 gax::paginator::internal::new_paginator(token, execute)
435 }
436
437 pub fn by_item(
439 self,
440 ) -> impl gax::paginator::ItemPaginator<crate::model::ListBucketsResponse, gax::error::Error>
441 {
442 use gax::paginator::Paginator;
443 self.by_page().items()
444 }
445
446 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
450 self.0.request.parent = v.into();
451 self
452 }
453
454 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
456 self.0.request.page_size = v.into();
457 self
458 }
459
460 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
462 self.0.request.page_token = v.into();
463 self
464 }
465
466 pub fn set_prefix<T: Into<std::string::String>>(mut self, v: T) -> Self {
468 self.0.request.prefix = v.into();
469 self
470 }
471
472 pub fn set_read_mask<T>(mut self, v: T) -> Self
474 where
475 T: std::convert::Into<wkt::FieldMask>,
476 {
477 self.0.request.read_mask = std::option::Option::Some(v.into());
478 self
479 }
480
481 pub fn set_or_clear_read_mask<T>(mut self, v: std::option::Option<T>) -> Self
483 where
484 T: std::convert::Into<wkt::FieldMask>,
485 {
486 self.0.request.read_mask = v.map(|x| x.into());
487 self
488 }
489
490 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
492 self.0.request.return_partial_success = v.into();
493 self
494 }
495 }
496
497 #[doc(hidden)]
498 impl gax::options::internal::RequestBuilder for ListBuckets {
499 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
500 &mut self.0.options
501 }
502 }
503
504 #[derive(Clone, Debug)]
521 pub struct LockBucketRetentionPolicy(
522 RequestBuilder<crate::model::LockBucketRetentionPolicyRequest>,
523 );
524
525 impl LockBucketRetentionPolicy {
526 pub(crate) fn new(
527 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
528 ) -> Self {
529 Self(RequestBuilder::new(stub))
530 }
531
532 pub fn with_request<V: Into<crate::model::LockBucketRetentionPolicyRequest>>(
534 mut self,
535 v: V,
536 ) -> Self {
537 self.0.request = v.into();
538 self
539 }
540
541 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
543 self.0.options = v.into();
544 self
545 }
546
547 pub async fn send(self) -> Result<crate::model::Bucket> {
549 (*self.0.stub)
550 .lock_bucket_retention_policy(self.0.request, self.0.options)
551 .await
552 .map(gax::response::Response::into_body)
553 }
554
555 pub fn set_bucket<T: Into<std::string::String>>(mut self, v: T) -> Self {
559 self.0.request.bucket = v.into();
560 self
561 }
562
563 pub fn set_if_metageneration_match<T: Into<i64>>(mut self, v: T) -> Self {
567 self.0.request.if_metageneration_match = v.into();
568 self
569 }
570 }
571
572 #[doc(hidden)]
573 impl gax::options::internal::RequestBuilder for LockBucketRetentionPolicy {
574 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
575 &mut self.0.options
576 }
577 }
578
579 #[derive(Clone, Debug)]
596 pub struct UpdateBucket(RequestBuilder<crate::model::UpdateBucketRequest>);
597
598 impl UpdateBucket {
599 pub(crate) fn new(
600 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
601 ) -> Self {
602 Self(RequestBuilder::new(stub))
603 }
604
605 pub fn with_request<V: Into<crate::model::UpdateBucketRequest>>(mut self, v: V) -> Self {
607 self.0.request = v.into();
608 self
609 }
610
611 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
613 self.0.options = v.into();
614 self
615 }
616
617 pub async fn send(self) -> Result<crate::model::Bucket> {
619 (*self.0.stub)
620 .update_bucket(self.0.request, self.0.options)
621 .await
622 .map(gax::response::Response::into_body)
623 }
624
625 pub fn set_bucket<T>(mut self, v: T) -> Self
629 where
630 T: std::convert::Into<crate::model::Bucket>,
631 {
632 self.0.request.bucket = std::option::Option::Some(v.into());
633 self
634 }
635
636 pub fn set_or_clear_bucket<T>(mut self, v: std::option::Option<T>) -> Self
640 where
641 T: std::convert::Into<crate::model::Bucket>,
642 {
643 self.0.request.bucket = v.map(|x| x.into());
644 self
645 }
646
647 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
649 where
650 T: std::convert::Into<i64>,
651 {
652 self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
653 self
654 }
655
656 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
658 where
659 T: std::convert::Into<i64>,
660 {
661 self.0.request.if_metageneration_match = v.map(|x| x.into());
662 self
663 }
664
665 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
667 where
668 T: std::convert::Into<i64>,
669 {
670 self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
671 self
672 }
673
674 pub fn set_or_clear_if_metageneration_not_match<T>(
676 mut self,
677 v: std::option::Option<T>,
678 ) -> Self
679 where
680 T: std::convert::Into<i64>,
681 {
682 self.0.request.if_metageneration_not_match = v.map(|x| x.into());
683 self
684 }
685
686 pub fn set_predefined_acl<T: Into<std::string::String>>(mut self, v: T) -> Self {
688 self.0.request.predefined_acl = v.into();
689 self
690 }
691
692 pub fn set_predefined_default_object_acl<T: Into<std::string::String>>(
694 mut self,
695 v: T,
696 ) -> Self {
697 self.0.request.predefined_default_object_acl = v.into();
698 self
699 }
700
701 pub fn set_update_mask<T>(mut self, v: T) -> Self
705 where
706 T: std::convert::Into<wkt::FieldMask>,
707 {
708 self.0.request.update_mask = std::option::Option::Some(v.into());
709 self
710 }
711
712 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
716 where
717 T: std::convert::Into<wkt::FieldMask>,
718 {
719 self.0.request.update_mask = v.map(|x| x.into());
720 self
721 }
722 }
723
724 #[doc(hidden)]
725 impl gax::options::internal::RequestBuilder for UpdateBucket {
726 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
727 &mut self.0.options
728 }
729 }
730
731 #[derive(Clone, Debug)]
748 pub struct ComposeObject(RequestBuilder<crate::model::ComposeObjectRequest>);
749
750 impl ComposeObject {
751 pub(crate) fn new(
752 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
753 ) -> Self {
754 Self(RequestBuilder::new(stub))
755 }
756
757 pub fn with_request<V: Into<crate::model::ComposeObjectRequest>>(mut self, v: V) -> Self {
759 self.0.request = v.into();
760 self
761 }
762
763 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
765 self.0.options = v.into();
766 self
767 }
768
769 pub async fn send(self) -> Result<crate::model::Object> {
771 (*self.0.stub)
772 .compose_object(self.0.request, self.0.options)
773 .await
774 .map(gax::response::Response::into_body)
775 }
776
777 pub fn set_destination<T>(mut self, v: T) -> Self
781 where
782 T: std::convert::Into<crate::model::Object>,
783 {
784 self.0.request.destination = std::option::Option::Some(v.into());
785 self
786 }
787
788 pub fn set_or_clear_destination<T>(mut self, v: std::option::Option<T>) -> Self
792 where
793 T: std::convert::Into<crate::model::Object>,
794 {
795 self.0.request.destination = v.map(|x| x.into());
796 self
797 }
798
799 pub fn set_source_objects<T, V>(mut self, v: T) -> Self
801 where
802 T: std::iter::IntoIterator<Item = V>,
803 V: std::convert::Into<crate::model::compose_object_request::SourceObject>,
804 {
805 use std::iter::Iterator;
806 self.0.request.source_objects = v.into_iter().map(|i| i.into()).collect();
807 self
808 }
809
810 pub fn set_destination_predefined_acl<T: Into<std::string::String>>(
812 mut self,
813 v: T,
814 ) -> Self {
815 self.0.request.destination_predefined_acl = v.into();
816 self
817 }
818
819 pub fn set_if_generation_match<T>(mut self, v: T) -> Self
821 where
822 T: std::convert::Into<i64>,
823 {
824 self.0.request.if_generation_match = std::option::Option::Some(v.into());
825 self
826 }
827
828 pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
830 where
831 T: std::convert::Into<i64>,
832 {
833 self.0.request.if_generation_match = v.map(|x| x.into());
834 self
835 }
836
837 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
839 where
840 T: std::convert::Into<i64>,
841 {
842 self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
843 self
844 }
845
846 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
848 where
849 T: std::convert::Into<i64>,
850 {
851 self.0.request.if_metageneration_match = v.map(|x| x.into());
852 self
853 }
854
855 pub fn set_kms_key<T: Into<std::string::String>>(mut self, v: T) -> Self {
857 self.0.request.kms_key = v.into();
858 self
859 }
860
861 pub fn set_common_object_request_params<T>(mut self, v: T) -> Self
863 where
864 T: std::convert::Into<crate::model::CommonObjectRequestParams>,
865 {
866 self.0.request.common_object_request_params = std::option::Option::Some(v.into());
867 self
868 }
869
870 pub fn set_or_clear_common_object_request_params<T>(
872 mut self,
873 v: std::option::Option<T>,
874 ) -> Self
875 where
876 T: std::convert::Into<crate::model::CommonObjectRequestParams>,
877 {
878 self.0.request.common_object_request_params = v.map(|x| x.into());
879 self
880 }
881
882 pub fn set_object_checksums<T>(mut self, v: T) -> Self
884 where
885 T: std::convert::Into<crate::model::ObjectChecksums>,
886 {
887 self.0.request.object_checksums = std::option::Option::Some(v.into());
888 self
889 }
890
891 pub fn set_or_clear_object_checksums<T>(mut self, v: std::option::Option<T>) -> Self
893 where
894 T: std::convert::Into<crate::model::ObjectChecksums>,
895 {
896 self.0.request.object_checksums = v.map(|x| x.into());
897 self
898 }
899 }
900
901 #[doc(hidden)]
902 impl gax::options::internal::RequestBuilder for ComposeObject {
903 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
904 &mut self.0.options
905 }
906 }
907
908 #[derive(Clone, Debug)]
925 pub struct DeleteObject(RequestBuilder<crate::model::DeleteObjectRequest>);
926
927 impl DeleteObject {
928 pub(crate) fn new(
929 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
930 ) -> Self {
931 Self(RequestBuilder::new(stub))
932 }
933
934 pub fn with_request<V: Into<crate::model::DeleteObjectRequest>>(mut self, v: V) -> Self {
936 self.0.request = v.into();
937 self
938 }
939
940 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
942 self.0.options = v.into();
943 self
944 }
945
946 pub async fn send(self) -> Result<()> {
948 (*self.0.stub)
949 .delete_object(self.0.request, self.0.options)
950 .await
951 .map(gax::response::Response::into_body)
952 }
953
954 pub fn set_bucket<T: Into<std::string::String>>(mut self, v: T) -> Self {
958 self.0.request.bucket = v.into();
959 self
960 }
961
962 pub fn set_object<T: Into<std::string::String>>(mut self, v: T) -> Self {
966 self.0.request.object = v.into();
967 self
968 }
969
970 pub fn set_generation<T: Into<i64>>(mut self, v: T) -> Self {
972 self.0.request.generation = v.into();
973 self
974 }
975
976 pub fn set_if_generation_match<T>(mut self, v: T) -> Self
978 where
979 T: std::convert::Into<i64>,
980 {
981 self.0.request.if_generation_match = std::option::Option::Some(v.into());
982 self
983 }
984
985 pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
987 where
988 T: std::convert::Into<i64>,
989 {
990 self.0.request.if_generation_match = v.map(|x| x.into());
991 self
992 }
993
994 pub fn set_if_generation_not_match<T>(mut self, v: T) -> Self
996 where
997 T: std::convert::Into<i64>,
998 {
999 self.0.request.if_generation_not_match = std::option::Option::Some(v.into());
1000 self
1001 }
1002
1003 pub fn set_or_clear_if_generation_not_match<T>(mut self, v: std::option::Option<T>) -> Self
1005 where
1006 T: std::convert::Into<i64>,
1007 {
1008 self.0.request.if_generation_not_match = v.map(|x| x.into());
1009 self
1010 }
1011
1012 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
1014 where
1015 T: std::convert::Into<i64>,
1016 {
1017 self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
1018 self
1019 }
1020
1021 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
1023 where
1024 T: std::convert::Into<i64>,
1025 {
1026 self.0.request.if_metageneration_match = v.map(|x| x.into());
1027 self
1028 }
1029
1030 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
1032 where
1033 T: std::convert::Into<i64>,
1034 {
1035 self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
1036 self
1037 }
1038
1039 pub fn set_or_clear_if_metageneration_not_match<T>(
1041 mut self,
1042 v: std::option::Option<T>,
1043 ) -> Self
1044 where
1045 T: std::convert::Into<i64>,
1046 {
1047 self.0.request.if_metageneration_not_match = v.map(|x| x.into());
1048 self
1049 }
1050
1051 pub fn set_common_object_request_params<T>(mut self, v: T) -> Self
1053 where
1054 T: std::convert::Into<crate::model::CommonObjectRequestParams>,
1055 {
1056 self.0.request.common_object_request_params = std::option::Option::Some(v.into());
1057 self
1058 }
1059
1060 pub fn set_or_clear_common_object_request_params<T>(
1062 mut self,
1063 v: std::option::Option<T>,
1064 ) -> Self
1065 where
1066 T: std::convert::Into<crate::model::CommonObjectRequestParams>,
1067 {
1068 self.0.request.common_object_request_params = v.map(|x| x.into());
1069 self
1070 }
1071 }
1072
1073 #[doc(hidden)]
1074 impl gax::options::internal::RequestBuilder for DeleteObject {
1075 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1076 &mut self.0.options
1077 }
1078 }
1079
1080 #[derive(Clone, Debug)]
1097 pub struct RestoreObject(RequestBuilder<crate::model::RestoreObjectRequest>);
1098
1099 impl RestoreObject {
1100 pub(crate) fn new(
1101 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1102 ) -> Self {
1103 Self(RequestBuilder::new(stub))
1104 }
1105
1106 pub fn with_request<V: Into<crate::model::RestoreObjectRequest>>(mut self, v: V) -> Self {
1108 self.0.request = v.into();
1109 self
1110 }
1111
1112 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1114 self.0.options = v.into();
1115 self
1116 }
1117
1118 pub async fn send(self) -> Result<crate::model::Object> {
1120 (*self.0.stub)
1121 .restore_object(self.0.request, self.0.options)
1122 .await
1123 .map(gax::response::Response::into_body)
1124 }
1125
1126 pub fn set_bucket<T: Into<std::string::String>>(mut self, v: T) -> Self {
1130 self.0.request.bucket = v.into();
1131 self
1132 }
1133
1134 pub fn set_object<T: Into<std::string::String>>(mut self, v: T) -> Self {
1138 self.0.request.object = v.into();
1139 self
1140 }
1141
1142 pub fn set_generation<T: Into<i64>>(mut self, v: T) -> Self {
1146 self.0.request.generation = v.into();
1147 self
1148 }
1149
1150 pub fn set_restore_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1152 self.0.request.restore_token = v.into();
1153 self
1154 }
1155
1156 pub fn set_if_generation_match<T>(mut self, v: T) -> Self
1158 where
1159 T: std::convert::Into<i64>,
1160 {
1161 self.0.request.if_generation_match = std::option::Option::Some(v.into());
1162 self
1163 }
1164
1165 pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
1167 where
1168 T: std::convert::Into<i64>,
1169 {
1170 self.0.request.if_generation_match = v.map(|x| x.into());
1171 self
1172 }
1173
1174 pub fn set_if_generation_not_match<T>(mut self, v: T) -> Self
1176 where
1177 T: std::convert::Into<i64>,
1178 {
1179 self.0.request.if_generation_not_match = std::option::Option::Some(v.into());
1180 self
1181 }
1182
1183 pub fn set_or_clear_if_generation_not_match<T>(mut self, v: std::option::Option<T>) -> Self
1185 where
1186 T: std::convert::Into<i64>,
1187 {
1188 self.0.request.if_generation_not_match = v.map(|x| x.into());
1189 self
1190 }
1191
1192 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
1194 where
1195 T: std::convert::Into<i64>,
1196 {
1197 self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
1198 self
1199 }
1200
1201 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
1203 where
1204 T: std::convert::Into<i64>,
1205 {
1206 self.0.request.if_metageneration_match = v.map(|x| x.into());
1207 self
1208 }
1209
1210 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
1212 where
1213 T: std::convert::Into<i64>,
1214 {
1215 self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
1216 self
1217 }
1218
1219 pub fn set_or_clear_if_metageneration_not_match<T>(
1221 mut self,
1222 v: std::option::Option<T>,
1223 ) -> Self
1224 where
1225 T: std::convert::Into<i64>,
1226 {
1227 self.0.request.if_metageneration_not_match = v.map(|x| x.into());
1228 self
1229 }
1230
1231 pub fn set_copy_source_acl<T>(mut self, v: T) -> Self
1233 where
1234 T: std::convert::Into<bool>,
1235 {
1236 self.0.request.copy_source_acl = std::option::Option::Some(v.into());
1237 self
1238 }
1239
1240 pub fn set_or_clear_copy_source_acl<T>(mut self, v: std::option::Option<T>) -> Self
1242 where
1243 T: std::convert::Into<bool>,
1244 {
1245 self.0.request.copy_source_acl = v.map(|x| x.into());
1246 self
1247 }
1248
1249 pub fn set_common_object_request_params<T>(mut self, v: T) -> Self
1251 where
1252 T: std::convert::Into<crate::model::CommonObjectRequestParams>,
1253 {
1254 self.0.request.common_object_request_params = std::option::Option::Some(v.into());
1255 self
1256 }
1257
1258 pub fn set_or_clear_common_object_request_params<T>(
1260 mut self,
1261 v: std::option::Option<T>,
1262 ) -> Self
1263 where
1264 T: std::convert::Into<crate::model::CommonObjectRequestParams>,
1265 {
1266 self.0.request.common_object_request_params = v.map(|x| x.into());
1267 self
1268 }
1269 }
1270
1271 #[doc(hidden)]
1272 impl gax::options::internal::RequestBuilder for RestoreObject {
1273 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1274 &mut self.0.options
1275 }
1276 }
1277
1278 #[derive(Clone, Debug)]
1295 pub struct GetObject(RequestBuilder<crate::model::GetObjectRequest>);
1296
1297 impl GetObject {
1298 pub(crate) fn new(
1299 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1300 ) -> Self {
1301 Self(RequestBuilder::new(stub))
1302 }
1303
1304 pub fn with_request<V: Into<crate::model::GetObjectRequest>>(mut self, v: V) -> Self {
1306 self.0.request = v.into();
1307 self
1308 }
1309
1310 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1312 self.0.options = v.into();
1313 self
1314 }
1315
1316 pub async fn send(self) -> Result<crate::model::Object> {
1318 (*self.0.stub)
1319 .get_object(self.0.request, self.0.options)
1320 .await
1321 .map(gax::response::Response::into_body)
1322 }
1323
1324 pub fn set_bucket<T: Into<std::string::String>>(mut self, v: T) -> Self {
1328 self.0.request.bucket = v.into();
1329 self
1330 }
1331
1332 pub fn set_object<T: Into<std::string::String>>(mut self, v: T) -> Self {
1336 self.0.request.object = v.into();
1337 self
1338 }
1339
1340 pub fn set_generation<T: Into<i64>>(mut self, v: T) -> Self {
1342 self.0.request.generation = v.into();
1343 self
1344 }
1345
1346 pub fn set_soft_deleted<T>(mut self, v: T) -> Self
1348 where
1349 T: std::convert::Into<bool>,
1350 {
1351 self.0.request.soft_deleted = std::option::Option::Some(v.into());
1352 self
1353 }
1354
1355 pub fn set_or_clear_soft_deleted<T>(mut self, v: std::option::Option<T>) -> Self
1357 where
1358 T: std::convert::Into<bool>,
1359 {
1360 self.0.request.soft_deleted = v.map(|x| x.into());
1361 self
1362 }
1363
1364 pub fn set_if_generation_match<T>(mut self, v: T) -> Self
1366 where
1367 T: std::convert::Into<i64>,
1368 {
1369 self.0.request.if_generation_match = std::option::Option::Some(v.into());
1370 self
1371 }
1372
1373 pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
1375 where
1376 T: std::convert::Into<i64>,
1377 {
1378 self.0.request.if_generation_match = v.map(|x| x.into());
1379 self
1380 }
1381
1382 pub fn set_if_generation_not_match<T>(mut self, v: T) -> Self
1384 where
1385 T: std::convert::Into<i64>,
1386 {
1387 self.0.request.if_generation_not_match = std::option::Option::Some(v.into());
1388 self
1389 }
1390
1391 pub fn set_or_clear_if_generation_not_match<T>(mut self, v: std::option::Option<T>) -> Self
1393 where
1394 T: std::convert::Into<i64>,
1395 {
1396 self.0.request.if_generation_not_match = v.map(|x| x.into());
1397 self
1398 }
1399
1400 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
1402 where
1403 T: std::convert::Into<i64>,
1404 {
1405 self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
1406 self
1407 }
1408
1409 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
1411 where
1412 T: std::convert::Into<i64>,
1413 {
1414 self.0.request.if_metageneration_match = v.map(|x| x.into());
1415 self
1416 }
1417
1418 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
1420 where
1421 T: std::convert::Into<i64>,
1422 {
1423 self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
1424 self
1425 }
1426
1427 pub fn set_or_clear_if_metageneration_not_match<T>(
1429 mut self,
1430 v: std::option::Option<T>,
1431 ) -> Self
1432 where
1433 T: std::convert::Into<i64>,
1434 {
1435 self.0.request.if_metageneration_not_match = v.map(|x| x.into());
1436 self
1437 }
1438
1439 pub fn set_common_object_request_params<T>(mut self, v: T) -> Self
1441 where
1442 T: std::convert::Into<crate::model::CommonObjectRequestParams>,
1443 {
1444 self.0.request.common_object_request_params = std::option::Option::Some(v.into());
1445 self
1446 }
1447
1448 pub fn set_or_clear_common_object_request_params<T>(
1450 mut self,
1451 v: std::option::Option<T>,
1452 ) -> Self
1453 where
1454 T: std::convert::Into<crate::model::CommonObjectRequestParams>,
1455 {
1456 self.0.request.common_object_request_params = v.map(|x| x.into());
1457 self
1458 }
1459
1460 pub fn set_read_mask<T>(mut self, v: T) -> Self
1462 where
1463 T: std::convert::Into<wkt::FieldMask>,
1464 {
1465 self.0.request.read_mask = std::option::Option::Some(v.into());
1466 self
1467 }
1468
1469 pub fn set_or_clear_read_mask<T>(mut self, v: std::option::Option<T>) -> Self
1471 where
1472 T: std::convert::Into<wkt::FieldMask>,
1473 {
1474 self.0.request.read_mask = v.map(|x| x.into());
1475 self
1476 }
1477
1478 pub fn set_restore_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1480 self.0.request.restore_token = v.into();
1481 self
1482 }
1483 }
1484
1485 #[doc(hidden)]
1486 impl gax::options::internal::RequestBuilder for GetObject {
1487 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1488 &mut self.0.options
1489 }
1490 }
1491
1492 #[derive(Clone, Debug)]
1509 pub struct UpdateObject(RequestBuilder<crate::model::UpdateObjectRequest>);
1510
1511 impl UpdateObject {
1512 pub(crate) fn new(
1513 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1514 ) -> Self {
1515 Self(RequestBuilder::new(stub))
1516 }
1517
1518 pub fn with_request<V: Into<crate::model::UpdateObjectRequest>>(mut self, v: V) -> Self {
1520 self.0.request = v.into();
1521 self
1522 }
1523
1524 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1526 self.0.options = v.into();
1527 self
1528 }
1529
1530 pub async fn send(self) -> Result<crate::model::Object> {
1532 (*self.0.stub)
1533 .update_object(self.0.request, self.0.options)
1534 .await
1535 .map(gax::response::Response::into_body)
1536 }
1537
1538 pub fn set_object<T>(mut self, v: T) -> Self
1542 where
1543 T: std::convert::Into<crate::model::Object>,
1544 {
1545 self.0.request.object = std::option::Option::Some(v.into());
1546 self
1547 }
1548
1549 pub fn set_or_clear_object<T>(mut self, v: std::option::Option<T>) -> Self
1553 where
1554 T: std::convert::Into<crate::model::Object>,
1555 {
1556 self.0.request.object = v.map(|x| x.into());
1557 self
1558 }
1559
1560 pub fn set_if_generation_match<T>(mut self, v: T) -> Self
1562 where
1563 T: std::convert::Into<i64>,
1564 {
1565 self.0.request.if_generation_match = std::option::Option::Some(v.into());
1566 self
1567 }
1568
1569 pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
1571 where
1572 T: std::convert::Into<i64>,
1573 {
1574 self.0.request.if_generation_match = v.map(|x| x.into());
1575 self
1576 }
1577
1578 pub fn set_if_generation_not_match<T>(mut self, v: T) -> Self
1580 where
1581 T: std::convert::Into<i64>,
1582 {
1583 self.0.request.if_generation_not_match = std::option::Option::Some(v.into());
1584 self
1585 }
1586
1587 pub fn set_or_clear_if_generation_not_match<T>(mut self, v: std::option::Option<T>) -> Self
1589 where
1590 T: std::convert::Into<i64>,
1591 {
1592 self.0.request.if_generation_not_match = v.map(|x| x.into());
1593 self
1594 }
1595
1596 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
1598 where
1599 T: std::convert::Into<i64>,
1600 {
1601 self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
1602 self
1603 }
1604
1605 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
1607 where
1608 T: std::convert::Into<i64>,
1609 {
1610 self.0.request.if_metageneration_match = v.map(|x| x.into());
1611 self
1612 }
1613
1614 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
1616 where
1617 T: std::convert::Into<i64>,
1618 {
1619 self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
1620 self
1621 }
1622
1623 pub fn set_or_clear_if_metageneration_not_match<T>(
1625 mut self,
1626 v: std::option::Option<T>,
1627 ) -> Self
1628 where
1629 T: std::convert::Into<i64>,
1630 {
1631 self.0.request.if_metageneration_not_match = v.map(|x| x.into());
1632 self
1633 }
1634
1635 pub fn set_predefined_acl<T: Into<std::string::String>>(mut self, v: T) -> Self {
1637 self.0.request.predefined_acl = v.into();
1638 self
1639 }
1640
1641 pub fn set_update_mask<T>(mut self, v: T) -> Self
1645 where
1646 T: std::convert::Into<wkt::FieldMask>,
1647 {
1648 self.0.request.update_mask = std::option::Option::Some(v.into());
1649 self
1650 }
1651
1652 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1656 where
1657 T: std::convert::Into<wkt::FieldMask>,
1658 {
1659 self.0.request.update_mask = v.map(|x| x.into());
1660 self
1661 }
1662
1663 pub fn set_common_object_request_params<T>(mut self, v: T) -> Self
1665 where
1666 T: std::convert::Into<crate::model::CommonObjectRequestParams>,
1667 {
1668 self.0.request.common_object_request_params = std::option::Option::Some(v.into());
1669 self
1670 }
1671
1672 pub fn set_or_clear_common_object_request_params<T>(
1674 mut self,
1675 v: std::option::Option<T>,
1676 ) -> Self
1677 where
1678 T: std::convert::Into<crate::model::CommonObjectRequestParams>,
1679 {
1680 self.0.request.common_object_request_params = v.map(|x| x.into());
1681 self
1682 }
1683
1684 pub fn set_override_unlocked_retention<T: Into<bool>>(mut self, v: T) -> Self {
1686 self.0.request.override_unlocked_retention = v.into();
1687 self
1688 }
1689 }
1690
1691 #[doc(hidden)]
1692 impl gax::options::internal::RequestBuilder for UpdateObject {
1693 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1694 &mut self.0.options
1695 }
1696 }
1697
1698 #[derive(Clone, Debug)]
1719 pub struct ListObjects(RequestBuilder<crate::model::ListObjectsRequest>);
1720
1721 impl ListObjects {
1722 pub(crate) fn new(
1723 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1724 ) -> Self {
1725 Self(RequestBuilder::new(stub))
1726 }
1727
1728 pub fn with_request<V: Into<crate::model::ListObjectsRequest>>(mut self, v: V) -> Self {
1730 self.0.request = v.into();
1731 self
1732 }
1733
1734 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1736 self.0.options = v.into();
1737 self
1738 }
1739
1740 pub async fn send(self) -> Result<crate::model::ListObjectsResponse> {
1742 (*self.0.stub)
1743 .list_objects(self.0.request, self.0.options)
1744 .await
1745 .map(gax::response::Response::into_body)
1746 }
1747
1748 pub fn by_page(
1750 self,
1751 ) -> impl gax::paginator::Paginator<crate::model::ListObjectsResponse, gax::error::Error>
1752 {
1753 use std::clone::Clone;
1754 let token = self.0.request.page_token.clone();
1755 let execute = move |token: String| {
1756 let mut builder = self.clone();
1757 builder.0.request = builder.0.request.set_page_token(token);
1758 builder.send()
1759 };
1760 gax::paginator::internal::new_paginator(token, execute)
1761 }
1762
1763 pub fn by_item(
1765 self,
1766 ) -> impl gax::paginator::ItemPaginator<crate::model::ListObjectsResponse, gax::error::Error>
1767 {
1768 use gax::paginator::Paginator;
1769 self.by_page().items()
1770 }
1771
1772 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1776 self.0.request.parent = v.into();
1777 self
1778 }
1779
1780 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1782 self.0.request.page_size = v.into();
1783 self
1784 }
1785
1786 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1788 self.0.request.page_token = v.into();
1789 self
1790 }
1791
1792 pub fn set_delimiter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1794 self.0.request.delimiter = v.into();
1795 self
1796 }
1797
1798 pub fn set_include_trailing_delimiter<T: Into<bool>>(mut self, v: T) -> Self {
1800 self.0.request.include_trailing_delimiter = v.into();
1801 self
1802 }
1803
1804 pub fn set_prefix<T: Into<std::string::String>>(mut self, v: T) -> Self {
1806 self.0.request.prefix = v.into();
1807 self
1808 }
1809
1810 pub fn set_versions<T: Into<bool>>(mut self, v: T) -> Self {
1812 self.0.request.versions = v.into();
1813 self
1814 }
1815
1816 pub fn set_read_mask<T>(mut self, v: T) -> Self
1818 where
1819 T: std::convert::Into<wkt::FieldMask>,
1820 {
1821 self.0.request.read_mask = std::option::Option::Some(v.into());
1822 self
1823 }
1824
1825 pub fn set_or_clear_read_mask<T>(mut self, v: std::option::Option<T>) -> Self
1827 where
1828 T: std::convert::Into<wkt::FieldMask>,
1829 {
1830 self.0.request.read_mask = v.map(|x| x.into());
1831 self
1832 }
1833
1834 pub fn set_lexicographic_start<T: Into<std::string::String>>(mut self, v: T) -> Self {
1836 self.0.request.lexicographic_start = v.into();
1837 self
1838 }
1839
1840 pub fn set_lexicographic_end<T: Into<std::string::String>>(mut self, v: T) -> Self {
1842 self.0.request.lexicographic_end = v.into();
1843 self
1844 }
1845
1846 pub fn set_soft_deleted<T: Into<bool>>(mut self, v: T) -> Self {
1848 self.0.request.soft_deleted = v.into();
1849 self
1850 }
1851
1852 pub fn set_include_folders_as_prefixes<T: Into<bool>>(mut self, v: T) -> Self {
1854 self.0.request.include_folders_as_prefixes = v.into();
1855 self
1856 }
1857
1858 pub fn set_match_glob<T: Into<std::string::String>>(mut self, v: T) -> Self {
1860 self.0.request.match_glob = v.into();
1861 self
1862 }
1863
1864 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1866 self.0.request.filter = v.into();
1867 self
1868 }
1869 }
1870
1871 #[doc(hidden)]
1872 impl gax::options::internal::RequestBuilder for ListObjects {
1873 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1874 &mut self.0.options
1875 }
1876 }
1877
1878 #[derive(Clone, Debug)]
1895 pub struct RewriteObject(RequestBuilder<crate::model::RewriteObjectRequest>);
1896
1897 impl RewriteObject {
1898 pub(crate) fn new(
1899 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1900 ) -> Self {
1901 Self(RequestBuilder::new(stub))
1902 }
1903
1904 pub fn with_request<V: Into<crate::model::RewriteObjectRequest>>(mut self, v: V) -> Self {
1906 self.0.request = v.into();
1907 self
1908 }
1909
1910 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1912 self.0.options = v.into();
1913 self
1914 }
1915
1916 pub async fn send(self) -> Result<crate::model::RewriteResponse> {
1918 (*self.0.stub)
1919 .rewrite_object(self.0.request, self.0.options)
1920 .await
1921 .map(gax::response::Response::into_body)
1922 }
1923
1924 pub fn set_destination_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1928 self.0.request.destination_name = v.into();
1929 self
1930 }
1931
1932 pub fn set_destination_bucket<T: Into<std::string::String>>(mut self, v: T) -> Self {
1936 self.0.request.destination_bucket = v.into();
1937 self
1938 }
1939
1940 pub fn set_destination_kms_key<T: Into<std::string::String>>(mut self, v: T) -> Self {
1942 self.0.request.destination_kms_key = v.into();
1943 self
1944 }
1945
1946 pub fn set_destination<T>(mut self, v: T) -> Self
1948 where
1949 T: std::convert::Into<crate::model::Object>,
1950 {
1951 self.0.request.destination = std::option::Option::Some(v.into());
1952 self
1953 }
1954
1955 pub fn set_or_clear_destination<T>(mut self, v: std::option::Option<T>) -> Self
1957 where
1958 T: std::convert::Into<crate::model::Object>,
1959 {
1960 self.0.request.destination = v.map(|x| x.into());
1961 self
1962 }
1963
1964 pub fn set_source_bucket<T: Into<std::string::String>>(mut self, v: T) -> Self {
1968 self.0.request.source_bucket = v.into();
1969 self
1970 }
1971
1972 pub fn set_source_object<T: Into<std::string::String>>(mut self, v: T) -> Self {
1976 self.0.request.source_object = v.into();
1977 self
1978 }
1979
1980 pub fn set_source_generation<T: Into<i64>>(mut self, v: T) -> Self {
1982 self.0.request.source_generation = v.into();
1983 self
1984 }
1985
1986 pub fn set_rewrite_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1988 self.0.request.rewrite_token = v.into();
1989 self
1990 }
1991
1992 pub fn set_destination_predefined_acl<T: Into<std::string::String>>(
1994 mut self,
1995 v: T,
1996 ) -> Self {
1997 self.0.request.destination_predefined_acl = v.into();
1998 self
1999 }
2000
2001 pub fn set_if_generation_match<T>(mut self, v: T) -> Self
2003 where
2004 T: std::convert::Into<i64>,
2005 {
2006 self.0.request.if_generation_match = std::option::Option::Some(v.into());
2007 self
2008 }
2009
2010 pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
2012 where
2013 T: std::convert::Into<i64>,
2014 {
2015 self.0.request.if_generation_match = v.map(|x| x.into());
2016 self
2017 }
2018
2019 pub fn set_if_generation_not_match<T>(mut self, v: T) -> Self
2021 where
2022 T: std::convert::Into<i64>,
2023 {
2024 self.0.request.if_generation_not_match = std::option::Option::Some(v.into());
2025 self
2026 }
2027
2028 pub fn set_or_clear_if_generation_not_match<T>(mut self, v: std::option::Option<T>) -> Self
2030 where
2031 T: std::convert::Into<i64>,
2032 {
2033 self.0.request.if_generation_not_match = v.map(|x| x.into());
2034 self
2035 }
2036
2037 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
2039 where
2040 T: std::convert::Into<i64>,
2041 {
2042 self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
2043 self
2044 }
2045
2046 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
2048 where
2049 T: std::convert::Into<i64>,
2050 {
2051 self.0.request.if_metageneration_match = v.map(|x| x.into());
2052 self
2053 }
2054
2055 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
2057 where
2058 T: std::convert::Into<i64>,
2059 {
2060 self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
2061 self
2062 }
2063
2064 pub fn set_or_clear_if_metageneration_not_match<T>(
2066 mut self,
2067 v: std::option::Option<T>,
2068 ) -> Self
2069 where
2070 T: std::convert::Into<i64>,
2071 {
2072 self.0.request.if_metageneration_not_match = v.map(|x| x.into());
2073 self
2074 }
2075
2076 pub fn set_if_source_generation_match<T>(mut self, v: T) -> Self
2078 where
2079 T: std::convert::Into<i64>,
2080 {
2081 self.0.request.if_source_generation_match = std::option::Option::Some(v.into());
2082 self
2083 }
2084
2085 pub fn set_or_clear_if_source_generation_match<T>(
2087 mut self,
2088 v: std::option::Option<T>,
2089 ) -> Self
2090 where
2091 T: std::convert::Into<i64>,
2092 {
2093 self.0.request.if_source_generation_match = v.map(|x| x.into());
2094 self
2095 }
2096
2097 pub fn set_if_source_generation_not_match<T>(mut self, v: T) -> Self
2099 where
2100 T: std::convert::Into<i64>,
2101 {
2102 self.0.request.if_source_generation_not_match = std::option::Option::Some(v.into());
2103 self
2104 }
2105
2106 pub fn set_or_clear_if_source_generation_not_match<T>(
2108 mut self,
2109 v: std::option::Option<T>,
2110 ) -> Self
2111 where
2112 T: std::convert::Into<i64>,
2113 {
2114 self.0.request.if_source_generation_not_match = v.map(|x| x.into());
2115 self
2116 }
2117
2118 pub fn set_if_source_metageneration_match<T>(mut self, v: T) -> Self
2120 where
2121 T: std::convert::Into<i64>,
2122 {
2123 self.0.request.if_source_metageneration_match = std::option::Option::Some(v.into());
2124 self
2125 }
2126
2127 pub fn set_or_clear_if_source_metageneration_match<T>(
2129 mut self,
2130 v: std::option::Option<T>,
2131 ) -> Self
2132 where
2133 T: std::convert::Into<i64>,
2134 {
2135 self.0.request.if_source_metageneration_match = v.map(|x| x.into());
2136 self
2137 }
2138
2139 pub fn set_if_source_metageneration_not_match<T>(mut self, v: T) -> Self
2141 where
2142 T: std::convert::Into<i64>,
2143 {
2144 self.0.request.if_source_metageneration_not_match = std::option::Option::Some(v.into());
2145 self
2146 }
2147
2148 pub fn set_or_clear_if_source_metageneration_not_match<T>(
2150 mut self,
2151 v: std::option::Option<T>,
2152 ) -> Self
2153 where
2154 T: std::convert::Into<i64>,
2155 {
2156 self.0.request.if_source_metageneration_not_match = v.map(|x| x.into());
2157 self
2158 }
2159
2160 pub fn set_max_bytes_rewritten_per_call<T: Into<i64>>(mut self, v: T) -> Self {
2162 self.0.request.max_bytes_rewritten_per_call = v.into();
2163 self
2164 }
2165
2166 pub fn set_copy_source_encryption_algorithm<T: Into<std::string::String>>(
2168 mut self,
2169 v: T,
2170 ) -> Self {
2171 self.0.request.copy_source_encryption_algorithm = v.into();
2172 self
2173 }
2174
2175 pub fn set_copy_source_encryption_key_bytes<T: Into<::bytes::Bytes>>(
2177 mut self,
2178 v: T,
2179 ) -> Self {
2180 self.0.request.copy_source_encryption_key_bytes = v.into();
2181 self
2182 }
2183
2184 pub fn set_copy_source_encryption_key_sha256_bytes<T: Into<::bytes::Bytes>>(
2186 mut self,
2187 v: T,
2188 ) -> Self {
2189 self.0.request.copy_source_encryption_key_sha256_bytes = v.into();
2190 self
2191 }
2192
2193 pub fn set_common_object_request_params<T>(mut self, v: T) -> Self
2195 where
2196 T: std::convert::Into<crate::model::CommonObjectRequestParams>,
2197 {
2198 self.0.request.common_object_request_params = std::option::Option::Some(v.into());
2199 self
2200 }
2201
2202 pub fn set_or_clear_common_object_request_params<T>(
2204 mut self,
2205 v: std::option::Option<T>,
2206 ) -> Self
2207 where
2208 T: std::convert::Into<crate::model::CommonObjectRequestParams>,
2209 {
2210 self.0.request.common_object_request_params = v.map(|x| x.into());
2211 self
2212 }
2213
2214 pub fn set_object_checksums<T>(mut self, v: T) -> Self
2216 where
2217 T: std::convert::Into<crate::model::ObjectChecksums>,
2218 {
2219 self.0.request.object_checksums = std::option::Option::Some(v.into());
2220 self
2221 }
2222
2223 pub fn set_or_clear_object_checksums<T>(mut self, v: std::option::Option<T>) -> Self
2225 where
2226 T: std::convert::Into<crate::model::ObjectChecksums>,
2227 {
2228 self.0.request.object_checksums = v.map(|x| x.into());
2229 self
2230 }
2231 }
2232
2233 #[doc(hidden)]
2234 impl gax::options::internal::RequestBuilder for RewriteObject {
2235 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2236 &mut self.0.options
2237 }
2238 }
2239
2240 #[derive(Clone, Debug)]
2257 pub struct MoveObject(RequestBuilder<crate::model::MoveObjectRequest>);
2258
2259 impl MoveObject {
2260 pub(crate) fn new(
2261 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2262 ) -> Self {
2263 Self(RequestBuilder::new(stub))
2264 }
2265
2266 pub fn with_request<V: Into<crate::model::MoveObjectRequest>>(mut self, v: V) -> Self {
2268 self.0.request = v.into();
2269 self
2270 }
2271
2272 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2274 self.0.options = v.into();
2275 self
2276 }
2277
2278 pub async fn send(self) -> Result<crate::model::Object> {
2280 (*self.0.stub)
2281 .move_object(self.0.request, self.0.options)
2282 .await
2283 .map(gax::response::Response::into_body)
2284 }
2285
2286 pub fn set_bucket<T: Into<std::string::String>>(mut self, v: T) -> Self {
2290 self.0.request.bucket = v.into();
2291 self
2292 }
2293
2294 pub fn set_source_object<T: Into<std::string::String>>(mut self, v: T) -> Self {
2298 self.0.request.source_object = v.into();
2299 self
2300 }
2301
2302 pub fn set_destination_object<T: Into<std::string::String>>(mut self, v: T) -> Self {
2306 self.0.request.destination_object = v.into();
2307 self
2308 }
2309
2310 pub fn set_if_source_generation_match<T>(mut self, v: T) -> Self
2312 where
2313 T: std::convert::Into<i64>,
2314 {
2315 self.0.request.if_source_generation_match = std::option::Option::Some(v.into());
2316 self
2317 }
2318
2319 pub fn set_or_clear_if_source_generation_match<T>(
2321 mut self,
2322 v: std::option::Option<T>,
2323 ) -> Self
2324 where
2325 T: std::convert::Into<i64>,
2326 {
2327 self.0.request.if_source_generation_match = v.map(|x| x.into());
2328 self
2329 }
2330
2331 pub fn set_if_source_generation_not_match<T>(mut self, v: T) -> Self
2333 where
2334 T: std::convert::Into<i64>,
2335 {
2336 self.0.request.if_source_generation_not_match = std::option::Option::Some(v.into());
2337 self
2338 }
2339
2340 pub fn set_or_clear_if_source_generation_not_match<T>(
2342 mut self,
2343 v: std::option::Option<T>,
2344 ) -> Self
2345 where
2346 T: std::convert::Into<i64>,
2347 {
2348 self.0.request.if_source_generation_not_match = v.map(|x| x.into());
2349 self
2350 }
2351
2352 pub fn set_if_source_metageneration_match<T>(mut self, v: T) -> Self
2354 where
2355 T: std::convert::Into<i64>,
2356 {
2357 self.0.request.if_source_metageneration_match = std::option::Option::Some(v.into());
2358 self
2359 }
2360
2361 pub fn set_or_clear_if_source_metageneration_match<T>(
2363 mut self,
2364 v: std::option::Option<T>,
2365 ) -> Self
2366 where
2367 T: std::convert::Into<i64>,
2368 {
2369 self.0.request.if_source_metageneration_match = v.map(|x| x.into());
2370 self
2371 }
2372
2373 pub fn set_if_source_metageneration_not_match<T>(mut self, v: T) -> Self
2375 where
2376 T: std::convert::Into<i64>,
2377 {
2378 self.0.request.if_source_metageneration_not_match = std::option::Option::Some(v.into());
2379 self
2380 }
2381
2382 pub fn set_or_clear_if_source_metageneration_not_match<T>(
2384 mut self,
2385 v: std::option::Option<T>,
2386 ) -> Self
2387 where
2388 T: std::convert::Into<i64>,
2389 {
2390 self.0.request.if_source_metageneration_not_match = v.map(|x| x.into());
2391 self
2392 }
2393
2394 pub fn set_if_generation_match<T>(mut self, v: T) -> Self
2396 where
2397 T: std::convert::Into<i64>,
2398 {
2399 self.0.request.if_generation_match = std::option::Option::Some(v.into());
2400 self
2401 }
2402
2403 pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
2405 where
2406 T: std::convert::Into<i64>,
2407 {
2408 self.0.request.if_generation_match = v.map(|x| x.into());
2409 self
2410 }
2411
2412 pub fn set_if_generation_not_match<T>(mut self, v: T) -> Self
2414 where
2415 T: std::convert::Into<i64>,
2416 {
2417 self.0.request.if_generation_not_match = std::option::Option::Some(v.into());
2418 self
2419 }
2420
2421 pub fn set_or_clear_if_generation_not_match<T>(mut self, v: std::option::Option<T>) -> Self
2423 where
2424 T: std::convert::Into<i64>,
2425 {
2426 self.0.request.if_generation_not_match = v.map(|x| x.into());
2427 self
2428 }
2429
2430 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
2432 where
2433 T: std::convert::Into<i64>,
2434 {
2435 self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
2436 self
2437 }
2438
2439 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
2441 where
2442 T: std::convert::Into<i64>,
2443 {
2444 self.0.request.if_metageneration_match = v.map(|x| x.into());
2445 self
2446 }
2447
2448 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
2450 where
2451 T: std::convert::Into<i64>,
2452 {
2453 self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
2454 self
2455 }
2456
2457 pub fn set_or_clear_if_metageneration_not_match<T>(
2459 mut self,
2460 v: std::option::Option<T>,
2461 ) -> Self
2462 where
2463 T: std::convert::Into<i64>,
2464 {
2465 self.0.request.if_metageneration_not_match = v.map(|x| x.into());
2466 self
2467 }
2468 }
2469
2470 #[doc(hidden)]
2471 impl gax::options::internal::RequestBuilder for MoveObject {
2472 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2473 &mut self.0.options
2474 }
2475 }
2476}