Skip to main content

google_cloud_storage/generated/gapic/
builder.rs

1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17pub mod storage_control {
18    use crate::Result;
19
20    /// Common implementation for [crate::client::StorageControl] request builders.
21    #[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    /// The request builder for [StorageControl::delete_bucket][crate::client::StorageControl::delete_bucket] calls.
44    ///
45    /// # Example
46    /// ```
47    /// # use google_cloud_storage::builder::storage_control::DeleteBucket;
48    /// # async fn sample() -> google_cloud_storage::Result<()> {
49    ///
50    /// let builder = prepare_request_builder();
51    /// let response = builder.send().await?;
52    /// # Ok(()) }
53    ///
54    /// fn prepare_request_builder() -> DeleteBucket {
55    ///   # panic!();
56    ///   // ... details omitted ...
57    /// }
58    /// ```
59    #[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        /// Sets the full request, replacing any prior values.
70        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        /// Sets all the options, replacing any prior values.
76        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
77            self.0.options = v.into();
78            self
79        }
80
81        /// Sends the request.
82        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        /// Sets the value of [name][crate::model::DeleteBucketRequest::name].
90        ///
91        /// This is a **required** field for requests.
92        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        /// Sets the value of [if_metageneration_match][crate::model::DeleteBucketRequest::if_metageneration_match].
98        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        /// Sets or clears the value of [if_metageneration_match][crate::model::DeleteBucketRequest::if_metageneration_match].
107        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        /// Sets the value of [if_metageneration_not_match][crate::model::DeleteBucketRequest::if_metageneration_not_match].
116        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        /// Sets or clears the value of [if_metageneration_not_match][crate::model::DeleteBucketRequest::if_metageneration_not_match].
125        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    /// The request builder for [StorageControl::get_bucket][crate::client::StorageControl::get_bucket] calls.
145    ///
146    /// # Example
147    /// ```
148    /// # use google_cloud_storage::builder::storage_control::GetBucket;
149    /// # async fn sample() -> google_cloud_storage::Result<()> {
150    ///
151    /// let builder = prepare_request_builder();
152    /// let response = builder.send().await?;
153    /// # Ok(()) }
154    ///
155    /// fn prepare_request_builder() -> GetBucket {
156    ///   # panic!();
157    ///   // ... details omitted ...
158    /// }
159    /// ```
160    #[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        /// Sets the full request, replacing any prior values.
171        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        /// Sets all the options, replacing any prior values.
177        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
178            self.0.options = v.into();
179            self
180        }
181
182        /// Sends the request.
183        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        /// Sets the value of [name][crate::model::GetBucketRequest::name].
191        ///
192        /// This is a **required** field for requests.
193        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        /// Sets the value of [if_metageneration_match][crate::model::GetBucketRequest::if_metageneration_match].
199        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        /// Sets or clears the value of [if_metageneration_match][crate::model::GetBucketRequest::if_metageneration_match].
208        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        /// Sets the value of [if_metageneration_not_match][crate::model::GetBucketRequest::if_metageneration_not_match].
217        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        /// Sets or clears the value of [if_metageneration_not_match][crate::model::GetBucketRequest::if_metageneration_not_match].
226        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        /// Sets the value of [read_mask][crate::model::GetBucketRequest::read_mask].
238        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        /// Sets or clears the value of [read_mask][crate::model::GetBucketRequest::read_mask].
247        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    /// The request builder for [StorageControl::create_bucket][crate::client::StorageControl::create_bucket] calls.
264    ///
265    /// # Example
266    /// ```
267    /// # use google_cloud_storage::builder::storage_control::CreateBucket;
268    /// # async fn sample() -> google_cloud_storage::Result<()> {
269    ///
270    /// let builder = prepare_request_builder();
271    /// let response = builder.send().await?;
272    /// # Ok(()) }
273    ///
274    /// fn prepare_request_builder() -> CreateBucket {
275    ///   # panic!();
276    ///   // ... details omitted ...
277    /// }
278    /// ```
279    #[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        /// Sets the full request, replacing any prior values.
290        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        /// Sets all the options, replacing any prior values.
296        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
297            self.0.options = v.into();
298            self
299        }
300
301        /// Sends the request.
302        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        /// Sets the value of [parent][crate::model::CreateBucketRequest::parent].
310        ///
311        /// This is a **required** field for requests.
312        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        /// Sets the value of [bucket][crate::model::CreateBucketRequest::bucket].
318        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        /// Sets or clears the value of [bucket][crate::model::CreateBucketRequest::bucket].
327        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        /// Sets the value of [bucket_id][crate::model::CreateBucketRequest::bucket_id].
336        ///
337        /// This is a **required** field for requests.
338        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        /// Sets the value of [predefined_acl][crate::model::CreateBucketRequest::predefined_acl].
344        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        /// Sets the value of [predefined_default_object_acl][crate::model::CreateBucketRequest::predefined_default_object_acl].
350        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        /// Sets the value of [enable_object_retention][crate::model::CreateBucketRequest::enable_object_retention].
359        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    /// The request builder for [StorageControl::list_buckets][crate::client::StorageControl::list_buckets] calls.
373    ///
374    /// # Example
375    /// ```
376    /// # use google_cloud_storage::builder::storage_control::ListBuckets;
377    /// # async fn sample() -> google_cloud_storage::Result<()> {
378    /// use google_cloud_gax::paginator::ItemPaginator;
379    ///
380    /// let builder = prepare_request_builder();
381    /// let mut items = builder.by_item();
382    /// while let Some(result) = items.next().await {
383    ///   let item = result?;
384    /// }
385    /// # Ok(()) }
386    ///
387    /// fn prepare_request_builder() -> ListBuckets {
388    ///   # panic!();
389    ///   // ... details omitted ...
390    /// }
391    /// ```
392    #[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        /// Sets the full request, replacing any prior values.
403        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        /// Sets all the options, replacing any prior values.
409        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
410            self.0.options = v.into();
411            self
412        }
413
414        /// Sends the request.
415        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        /// Streams each page in the collection.
423        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        /// Streams each item in the collection.
438        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        /// Sets the value of [parent][crate::model::ListBucketsRequest::parent].
449        ///
450        /// This is a **required** field for requests.
451        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        /// Sets the value of [page_size][crate::model::ListBucketsRequest::page_size].
457        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        /// Sets the value of [page_token][crate::model::ListBucketsRequest::page_token].
463        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        /// Sets the value of [prefix][crate::model::ListBucketsRequest::prefix].
469        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        /// Sets the value of [read_mask][crate::model::ListBucketsRequest::read_mask].
475        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        /// Sets or clears the value of [read_mask][crate::model::ListBucketsRequest::read_mask].
484        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        /// Sets the value of [return_partial_success][crate::model::ListBucketsRequest::return_partial_success].
493        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    /// The request builder for [StorageControl::lock_bucket_retention_policy][crate::client::StorageControl::lock_bucket_retention_policy] calls.
507    ///
508    /// # Example
509    /// ```
510    /// # use google_cloud_storage::builder::storage_control::LockBucketRetentionPolicy;
511    /// # async fn sample() -> google_cloud_storage::Result<()> {
512    ///
513    /// let builder = prepare_request_builder();
514    /// let response = builder.send().await?;
515    /// # Ok(()) }
516    ///
517    /// fn prepare_request_builder() -> LockBucketRetentionPolicy {
518    ///   # panic!();
519    ///   // ... details omitted ...
520    /// }
521    /// ```
522    #[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        /// Sets the full request, replacing any prior values.
535        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        /// Sets all the options, replacing any prior values.
544        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
545            self.0.options = v.into();
546            self
547        }
548
549        /// Sends the request.
550        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        /// Sets the value of [bucket][crate::model::LockBucketRetentionPolicyRequest::bucket].
558        ///
559        /// This is a **required** field for requests.
560        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        /// Sets the value of [if_metageneration_match][crate::model::LockBucketRetentionPolicyRequest::if_metageneration_match].
566        ///
567        /// This is a **required** field for requests.
568        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    /// The request builder for [StorageControl::update_bucket][crate::client::StorageControl::update_bucket] calls.
582    ///
583    /// # Example
584    /// ```
585    /// # use google_cloud_storage::builder::storage_control::UpdateBucket;
586    /// # async fn sample() -> google_cloud_storage::Result<()> {
587    ///
588    /// let builder = prepare_request_builder();
589    /// let response = builder.send().await?;
590    /// # Ok(()) }
591    ///
592    /// fn prepare_request_builder() -> UpdateBucket {
593    ///   # panic!();
594    ///   // ... details omitted ...
595    /// }
596    /// ```
597    #[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        /// Sets the full request, replacing any prior values.
608        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        /// Sets all the options, replacing any prior values.
614        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
615            self.0.options = v.into();
616            self
617        }
618
619        /// Sends the request.
620        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        /// Sets the value of [bucket][crate::model::UpdateBucketRequest::bucket].
628        ///
629        /// This is a **required** field for requests.
630        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        /// Sets or clears the value of [bucket][crate::model::UpdateBucketRequest::bucket].
639        ///
640        /// This is a **required** field for requests.
641        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        /// Sets the value of [if_metageneration_match][crate::model::UpdateBucketRequest::if_metageneration_match].
650        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        /// Sets or clears the value of [if_metageneration_match][crate::model::UpdateBucketRequest::if_metageneration_match].
659        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        /// Sets the value of [if_metageneration_not_match][crate::model::UpdateBucketRequest::if_metageneration_not_match].
668        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        /// Sets or clears the value of [if_metageneration_not_match][crate::model::UpdateBucketRequest::if_metageneration_not_match].
677        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        /// Sets the value of [predefined_acl][crate::model::UpdateBucketRequest::predefined_acl].
689        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        /// Sets the value of [predefined_default_object_acl][crate::model::UpdateBucketRequest::predefined_default_object_acl].
695        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        /// Sets the value of [update_mask][crate::model::UpdateBucketRequest::update_mask].
704        ///
705        /// This is a **required** field for requests.
706        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        /// Sets or clears the value of [update_mask][crate::model::UpdateBucketRequest::update_mask].
715        ///
716        /// This is a **required** field for requests.
717        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    /// The request builder for [StorageControl::compose_object][crate::client::StorageControl::compose_object] calls.
734    ///
735    /// # Example
736    /// ```
737    /// # use google_cloud_storage::builder::storage_control::ComposeObject;
738    /// # async fn sample() -> google_cloud_storage::Result<()> {
739    ///
740    /// let builder = prepare_request_builder();
741    /// let response = builder.send().await?;
742    /// # Ok(()) }
743    ///
744    /// fn prepare_request_builder() -> ComposeObject {
745    ///   # panic!();
746    ///   // ... details omitted ...
747    /// }
748    /// ```
749    #[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        /// Sets the full request, replacing any prior values.
760        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        /// Sets all the options, replacing any prior values.
766        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
767            self.0.options = v.into();
768            self
769        }
770
771        /// Sends the request.
772        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        /// Sets the value of [destination][crate::model::ComposeObjectRequest::destination].
780        ///
781        /// This is a **required** field for requests.
782        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        /// Sets or clears the value of [destination][crate::model::ComposeObjectRequest::destination].
791        ///
792        /// This is a **required** field for requests.
793        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        /// Sets the value of [source_objects][crate::model::ComposeObjectRequest::source_objects].
802        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        /// Sets the value of [destination_predefined_acl][crate::model::ComposeObjectRequest::destination_predefined_acl].
813        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        /// Sets the value of [if_generation_match][crate::model::ComposeObjectRequest::if_generation_match].
822        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        /// Sets or clears the value of [if_generation_match][crate::model::ComposeObjectRequest::if_generation_match].
831        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        /// Sets the value of [if_metageneration_match][crate::model::ComposeObjectRequest::if_metageneration_match].
840        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        /// Sets or clears the value of [if_metageneration_match][crate::model::ComposeObjectRequest::if_metageneration_match].
849        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        /// Sets the value of [kms_key][crate::model::ComposeObjectRequest::kms_key].
858        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        /// Sets the value of [common_object_request_params][crate::model::ComposeObjectRequest::common_object_request_params].
864        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        /// Sets or clears the value of [common_object_request_params][crate::model::ComposeObjectRequest::common_object_request_params].
873        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        /// Sets the value of [object_checksums][crate::model::ComposeObjectRequest::object_checksums].
885        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        /// Sets or clears the value of [object_checksums][crate::model::ComposeObjectRequest::object_checksums].
894        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        /// Sets the value of [delete_source_objects][crate::model::ComposeObjectRequest::delete_source_objects].
903        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        /// Sets or clears the value of [delete_source_objects][crate::model::ComposeObjectRequest::delete_source_objects].
912        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    /// The request builder for [StorageControl::delete_object][crate::client::StorageControl::delete_object] calls.
929    ///
930    /// # Example
931    /// ```
932    /// # use google_cloud_storage::builder::storage_control::DeleteObject;
933    /// # async fn sample() -> google_cloud_storage::Result<()> {
934    ///
935    /// let builder = prepare_request_builder();
936    /// let response = builder.send().await?;
937    /// # Ok(()) }
938    ///
939    /// fn prepare_request_builder() -> DeleteObject {
940    ///   # panic!();
941    ///   // ... details omitted ...
942    /// }
943    /// ```
944    #[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        /// Sets the full request, replacing any prior values.
955        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        /// Sets all the options, replacing any prior values.
961        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
962            self.0.options = v.into();
963            self
964        }
965
966        /// Sends the request.
967        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        /// Sets the value of [bucket][crate::model::DeleteObjectRequest::bucket].
975        ///
976        /// This is a **required** field for requests.
977        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        /// Sets the value of [object][crate::model::DeleteObjectRequest::object].
983        ///
984        /// This is a **required** field for requests.
985        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        /// Sets the value of [generation][crate::model::DeleteObjectRequest::generation].
991        pub fn set_generation<T: Into<i64>>(mut self, v: T) -> Self {
992            self.0.request.generation = v.into();
993            self
994        }
995
996        /// Sets the value of [if_generation_match][crate::model::DeleteObjectRequest::if_generation_match].
997        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        /// Sets or clears the value of [if_generation_match][crate::model::DeleteObjectRequest::if_generation_match].
1006        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        /// Sets the value of [if_generation_not_match][crate::model::DeleteObjectRequest::if_generation_not_match].
1015        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        /// Sets or clears the value of [if_generation_not_match][crate::model::DeleteObjectRequest::if_generation_not_match].
1024        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        /// Sets the value of [if_metageneration_match][crate::model::DeleteObjectRequest::if_metageneration_match].
1033        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        /// Sets or clears the value of [if_metageneration_match][crate::model::DeleteObjectRequest::if_metageneration_match].
1042        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        /// Sets the value of [if_metageneration_not_match][crate::model::DeleteObjectRequest::if_metageneration_not_match].
1051        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        /// Sets or clears the value of [if_metageneration_not_match][crate::model::DeleteObjectRequest::if_metageneration_not_match].
1060        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        /// Sets the value of [common_object_request_params][crate::model::DeleteObjectRequest::common_object_request_params].
1072        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        /// Sets or clears the value of [common_object_request_params][crate::model::DeleteObjectRequest::common_object_request_params].
1081        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    /// The request builder for [StorageControl::restore_object][crate::client::StorageControl::restore_object] calls.
1101    ///
1102    /// # Example
1103    /// ```
1104    /// # use google_cloud_storage::builder::storage_control::RestoreObject;
1105    /// # async fn sample() -> google_cloud_storage::Result<()> {
1106    ///
1107    /// let builder = prepare_request_builder();
1108    /// let response = builder.send().await?;
1109    /// # Ok(()) }
1110    ///
1111    /// fn prepare_request_builder() -> RestoreObject {
1112    ///   # panic!();
1113    ///   // ... details omitted ...
1114    /// }
1115    /// ```
1116    #[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        /// Sets the full request, replacing any prior values.
1127        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        /// Sets all the options, replacing any prior values.
1133        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1134            self.0.options = v.into();
1135            self
1136        }
1137
1138        /// Sends the request.
1139        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        /// Sets the value of [bucket][crate::model::RestoreObjectRequest::bucket].
1147        ///
1148        /// This is a **required** field for requests.
1149        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        /// Sets the value of [object][crate::model::RestoreObjectRequest::object].
1155        ///
1156        /// This is a **required** field for requests.
1157        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        /// Sets the value of [generation][crate::model::RestoreObjectRequest::generation].
1163        ///
1164        /// This is a **required** field for requests.
1165        pub fn set_generation<T: Into<i64>>(mut self, v: T) -> Self {
1166            self.0.request.generation = v.into();
1167            self
1168        }
1169
1170        /// Sets the value of [restore_token][crate::model::RestoreObjectRequest::restore_token].
1171        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        /// Sets the value of [if_generation_match][crate::model::RestoreObjectRequest::if_generation_match].
1177        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        /// Sets or clears the value of [if_generation_match][crate::model::RestoreObjectRequest::if_generation_match].
1186        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        /// Sets the value of [if_generation_not_match][crate::model::RestoreObjectRequest::if_generation_not_match].
1195        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        /// Sets or clears the value of [if_generation_not_match][crate::model::RestoreObjectRequest::if_generation_not_match].
1204        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        /// Sets the value of [if_metageneration_match][crate::model::RestoreObjectRequest::if_metageneration_match].
1213        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        /// Sets or clears the value of [if_metageneration_match][crate::model::RestoreObjectRequest::if_metageneration_match].
1222        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        /// Sets the value of [if_metageneration_not_match][crate::model::RestoreObjectRequest::if_metageneration_not_match].
1231        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        /// Sets or clears the value of [if_metageneration_not_match][crate::model::RestoreObjectRequest::if_metageneration_not_match].
1240        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        /// Sets the value of [copy_source_acl][crate::model::RestoreObjectRequest::copy_source_acl].
1252        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        /// Sets or clears the value of [copy_source_acl][crate::model::RestoreObjectRequest::copy_source_acl].
1261        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        /// Sets the value of [common_object_request_params][crate::model::RestoreObjectRequest::common_object_request_params].
1270        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        /// Sets or clears the value of [common_object_request_params][crate::model::RestoreObjectRequest::common_object_request_params].
1279        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    /// The request builder for [StorageControl::get_object][crate::client::StorageControl::get_object] calls.
1299    ///
1300    /// # Example
1301    /// ```
1302    /// # use google_cloud_storage::builder::storage_control::GetObject;
1303    /// # async fn sample() -> google_cloud_storage::Result<()> {
1304    ///
1305    /// let builder = prepare_request_builder();
1306    /// let response = builder.send().await?;
1307    /// # Ok(()) }
1308    ///
1309    /// fn prepare_request_builder() -> GetObject {
1310    ///   # panic!();
1311    ///   // ... details omitted ...
1312    /// }
1313    /// ```
1314    #[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        /// Sets the full request, replacing any prior values.
1325        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        /// Sets all the options, replacing any prior values.
1331        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1332            self.0.options = v.into();
1333            self
1334        }
1335
1336        /// Sends the request.
1337        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        /// Sets the value of [bucket][crate::model::GetObjectRequest::bucket].
1345        ///
1346        /// This is a **required** field for requests.
1347        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        /// Sets the value of [object][crate::model::GetObjectRequest::object].
1353        ///
1354        /// This is a **required** field for requests.
1355        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        /// Sets the value of [generation][crate::model::GetObjectRequest::generation].
1361        pub fn set_generation<T: Into<i64>>(mut self, v: T) -> Self {
1362            self.0.request.generation = v.into();
1363            self
1364        }
1365
1366        /// Sets the value of [soft_deleted][crate::model::GetObjectRequest::soft_deleted].
1367        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        /// Sets or clears the value of [soft_deleted][crate::model::GetObjectRequest::soft_deleted].
1376        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        /// Sets the value of [if_generation_match][crate::model::GetObjectRequest::if_generation_match].
1385        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        /// Sets or clears the value of [if_generation_match][crate::model::GetObjectRequest::if_generation_match].
1394        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        /// Sets the value of [if_generation_not_match][crate::model::GetObjectRequest::if_generation_not_match].
1403        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        /// Sets or clears the value of [if_generation_not_match][crate::model::GetObjectRequest::if_generation_not_match].
1412        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        /// Sets the value of [if_metageneration_match][crate::model::GetObjectRequest::if_metageneration_match].
1421        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        /// Sets or clears the value of [if_metageneration_match][crate::model::GetObjectRequest::if_metageneration_match].
1430        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        /// Sets the value of [if_metageneration_not_match][crate::model::GetObjectRequest::if_metageneration_not_match].
1439        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        /// Sets or clears the value of [if_metageneration_not_match][crate::model::GetObjectRequest::if_metageneration_not_match].
1448        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        /// Sets the value of [common_object_request_params][crate::model::GetObjectRequest::common_object_request_params].
1460        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        /// Sets or clears the value of [common_object_request_params][crate::model::GetObjectRequest::common_object_request_params].
1469        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        /// Sets the value of [read_mask][crate::model::GetObjectRequest::read_mask].
1481        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        /// Sets or clears the value of [read_mask][crate::model::GetObjectRequest::read_mask].
1490        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        /// Sets the value of [restore_token][crate::model::GetObjectRequest::restore_token].
1499        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    /// The request builder for [StorageControl::update_object][crate::client::StorageControl::update_object] calls.
1513    ///
1514    /// # Example
1515    /// ```
1516    /// # use google_cloud_storage::builder::storage_control::UpdateObject;
1517    /// # async fn sample() -> google_cloud_storage::Result<()> {
1518    ///
1519    /// let builder = prepare_request_builder();
1520    /// let response = builder.send().await?;
1521    /// # Ok(()) }
1522    ///
1523    /// fn prepare_request_builder() -> UpdateObject {
1524    ///   # panic!();
1525    ///   // ... details omitted ...
1526    /// }
1527    /// ```
1528    #[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        /// Sets the full request, replacing any prior values.
1539        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        /// Sets all the options, replacing any prior values.
1545        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1546            self.0.options = v.into();
1547            self
1548        }
1549
1550        /// Sends the request.
1551        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        /// Sets the value of [object][crate::model::UpdateObjectRequest::object].
1559        ///
1560        /// This is a **required** field for requests.
1561        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        /// Sets or clears the value of [object][crate::model::UpdateObjectRequest::object].
1570        ///
1571        /// This is a **required** field for requests.
1572        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        /// Sets the value of [if_generation_match][crate::model::UpdateObjectRequest::if_generation_match].
1581        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        /// Sets or clears the value of [if_generation_match][crate::model::UpdateObjectRequest::if_generation_match].
1590        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        /// Sets the value of [if_generation_not_match][crate::model::UpdateObjectRequest::if_generation_not_match].
1599        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        /// Sets or clears the value of [if_generation_not_match][crate::model::UpdateObjectRequest::if_generation_not_match].
1608        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        /// Sets the value of [if_metageneration_match][crate::model::UpdateObjectRequest::if_metageneration_match].
1617        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        /// Sets or clears the value of [if_metageneration_match][crate::model::UpdateObjectRequest::if_metageneration_match].
1626        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        /// Sets the value of [if_metageneration_not_match][crate::model::UpdateObjectRequest::if_metageneration_not_match].
1635        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        /// Sets or clears the value of [if_metageneration_not_match][crate::model::UpdateObjectRequest::if_metageneration_not_match].
1644        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        /// Sets the value of [predefined_acl][crate::model::UpdateObjectRequest::predefined_acl].
1656        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        /// Sets the value of [update_mask][crate::model::UpdateObjectRequest::update_mask].
1662        ///
1663        /// This is a **required** field for requests.
1664        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        /// Sets or clears the value of [update_mask][crate::model::UpdateObjectRequest::update_mask].
1673        ///
1674        /// This is a **required** field for requests.
1675        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        /// Sets the value of [common_object_request_params][crate::model::UpdateObjectRequest::common_object_request_params].
1684        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        /// Sets or clears the value of [common_object_request_params][crate::model::UpdateObjectRequest::common_object_request_params].
1693        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        /// Sets the value of [override_unlocked_retention][crate::model::UpdateObjectRequest::override_unlocked_retention].
1705        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    /// The request builder for [StorageControl::list_objects][crate::client::StorageControl::list_objects] calls.
1719    ///
1720    /// # Example
1721    /// ```
1722    /// # use google_cloud_storage::builder::storage_control::ListObjects;
1723    /// # async fn sample() -> google_cloud_storage::Result<()> {
1724    /// use google_cloud_gax::paginator::ItemPaginator;
1725    ///
1726    /// let builder = prepare_request_builder();
1727    /// let mut items = builder.by_item();
1728    /// while let Some(result) = items.next().await {
1729    ///   let item = result?;
1730    /// }
1731    /// # Ok(()) }
1732    ///
1733    /// fn prepare_request_builder() -> ListObjects {
1734    ///   # panic!();
1735    ///   // ... details omitted ...
1736    /// }
1737    /// ```
1738    #[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        /// Sets the full request, replacing any prior values.
1749        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        /// Sets all the options, replacing any prior values.
1755        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1756            self.0.options = v.into();
1757            self
1758        }
1759
1760        /// Sends the request.
1761        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        /// Streams each page in the collection.
1769        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        /// Streams each item in the collection.
1784        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        /// Sets the value of [parent][crate::model::ListObjectsRequest::parent].
1795        ///
1796        /// This is a **required** field for requests.
1797        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        /// Sets the value of [page_size][crate::model::ListObjectsRequest::page_size].
1803        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        /// Sets the value of [page_token][crate::model::ListObjectsRequest::page_token].
1809        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        /// Sets the value of [delimiter][crate::model::ListObjectsRequest::delimiter].
1815        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        /// Sets the value of [include_trailing_delimiter][crate::model::ListObjectsRequest::include_trailing_delimiter].
1821        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        /// Sets the value of [prefix][crate::model::ListObjectsRequest::prefix].
1827        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        /// Sets the value of [versions][crate::model::ListObjectsRequest::versions].
1833        pub fn set_versions<T: Into<bool>>(mut self, v: T) -> Self {
1834            self.0.request.versions = v.into();
1835            self
1836        }
1837
1838        /// Sets the value of [read_mask][crate::model::ListObjectsRequest::read_mask].
1839        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        /// Sets or clears the value of [read_mask][crate::model::ListObjectsRequest::read_mask].
1848        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        /// Sets the value of [lexicographic_start][crate::model::ListObjectsRequest::lexicographic_start].
1857        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        /// Sets the value of [lexicographic_end][crate::model::ListObjectsRequest::lexicographic_end].
1863        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        /// Sets the value of [soft_deleted][crate::model::ListObjectsRequest::soft_deleted].
1869        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        /// Sets the value of [include_folders_as_prefixes][crate::model::ListObjectsRequest::include_folders_as_prefixes].
1875        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        /// Sets the value of [match_glob][crate::model::ListObjectsRequest::match_glob].
1881        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        /// Sets the value of [filter][crate::model::ListObjectsRequest::filter].
1887        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    /// The request builder for [StorageControl::rewrite_object][crate::client::StorageControl::rewrite_object] calls.
1901    ///
1902    /// # Example
1903    /// ```
1904    /// # use google_cloud_storage::builder::storage_control::RewriteObject;
1905    /// # async fn sample() -> google_cloud_storage::Result<()> {
1906    ///
1907    /// let builder = prepare_request_builder();
1908    /// let response = builder.send().await?;
1909    /// # Ok(()) }
1910    ///
1911    /// fn prepare_request_builder() -> RewriteObject {
1912    ///   # panic!();
1913    ///   // ... details omitted ...
1914    /// }
1915    /// ```
1916    #[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        /// Sets the full request, replacing any prior values.
1927        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        /// Sets all the options, replacing any prior values.
1933        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1934            self.0.options = v.into();
1935            self
1936        }
1937
1938        /// Sends the request.
1939        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        /// Sets the value of [destination_name][crate::model::RewriteObjectRequest::destination_name].
1947        ///
1948        /// This is a **required** field for requests.
1949        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        /// Sets the value of [destination_bucket][crate::model::RewriteObjectRequest::destination_bucket].
1955        ///
1956        /// This is a **required** field for requests.
1957        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        /// Sets the value of [destination_kms_key][crate::model::RewriteObjectRequest::destination_kms_key].
1963        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        /// Sets the value of [destination][crate::model::RewriteObjectRequest::destination].
1969        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        /// Sets or clears the value of [destination][crate::model::RewriteObjectRequest::destination].
1978        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        /// Sets the value of [source_bucket][crate::model::RewriteObjectRequest::source_bucket].
1987        ///
1988        /// This is a **required** field for requests.
1989        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        /// Sets the value of [source_object][crate::model::RewriteObjectRequest::source_object].
1995        ///
1996        /// This is a **required** field for requests.
1997        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        /// Sets the value of [source_generation][crate::model::RewriteObjectRequest::source_generation].
2003        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        /// Sets the value of [rewrite_token][crate::model::RewriteObjectRequest::rewrite_token].
2009        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        /// Sets the value of [destination_predefined_acl][crate::model::RewriteObjectRequest::destination_predefined_acl].
2015        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        /// Sets the value of [if_generation_match][crate::model::RewriteObjectRequest::if_generation_match].
2024        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        /// Sets or clears the value of [if_generation_match][crate::model::RewriteObjectRequest::if_generation_match].
2033        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        /// Sets the value of [if_generation_not_match][crate::model::RewriteObjectRequest::if_generation_not_match].
2042        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        /// Sets or clears the value of [if_generation_not_match][crate::model::RewriteObjectRequest::if_generation_not_match].
2051        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        /// Sets the value of [if_metageneration_match][crate::model::RewriteObjectRequest::if_metageneration_match].
2060        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        /// Sets or clears the value of [if_metageneration_match][crate::model::RewriteObjectRequest::if_metageneration_match].
2069        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        /// Sets the value of [if_metageneration_not_match][crate::model::RewriteObjectRequest::if_metageneration_not_match].
2078        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        /// Sets or clears the value of [if_metageneration_not_match][crate::model::RewriteObjectRequest::if_metageneration_not_match].
2087        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        /// Sets the value of [if_source_generation_match][crate::model::RewriteObjectRequest::if_source_generation_match].
2099        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        /// Sets or clears the value of [if_source_generation_match][crate::model::RewriteObjectRequest::if_source_generation_match].
2108        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        /// Sets the value of [if_source_generation_not_match][crate::model::RewriteObjectRequest::if_source_generation_not_match].
2120        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        /// Sets or clears the value of [if_source_generation_not_match][crate::model::RewriteObjectRequest::if_source_generation_not_match].
2129        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        /// Sets the value of [if_source_metageneration_match][crate::model::RewriteObjectRequest::if_source_metageneration_match].
2141        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        /// Sets or clears the value of [if_source_metageneration_match][crate::model::RewriteObjectRequest::if_source_metageneration_match].
2150        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        /// Sets the value of [if_source_metageneration_not_match][crate::model::RewriteObjectRequest::if_source_metageneration_not_match].
2162        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        /// Sets or clears the value of [if_source_metageneration_not_match][crate::model::RewriteObjectRequest::if_source_metageneration_not_match].
2171        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        /// Sets the value of [max_bytes_rewritten_per_call][crate::model::RewriteObjectRequest::max_bytes_rewritten_per_call].
2183        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        /// Sets the value of [copy_source_encryption_algorithm][crate::model::RewriteObjectRequest::copy_source_encryption_algorithm].
2189        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        /// Sets the value of [copy_source_encryption_key_bytes][crate::model::RewriteObjectRequest::copy_source_encryption_key_bytes].
2198        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        /// Sets the value of [copy_source_encryption_key_sha256_bytes][crate::model::RewriteObjectRequest::copy_source_encryption_key_sha256_bytes].
2207        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        /// Sets the value of [common_object_request_params][crate::model::RewriteObjectRequest::common_object_request_params].
2216        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        /// Sets or clears the value of [common_object_request_params][crate::model::RewriteObjectRequest::common_object_request_params].
2225        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        /// Sets the value of [object_checksums][crate::model::RewriteObjectRequest::object_checksums].
2237        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        /// Sets or clears the value of [object_checksums][crate::model::RewriteObjectRequest::object_checksums].
2246        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    /// The request builder for [StorageControl::move_object][crate::client::StorageControl::move_object] calls.
2263    ///
2264    /// # Example
2265    /// ```
2266    /// # use google_cloud_storage::builder::storage_control::MoveObject;
2267    /// # async fn sample() -> google_cloud_storage::Result<()> {
2268    ///
2269    /// let builder = prepare_request_builder();
2270    /// let response = builder.send().await?;
2271    /// # Ok(()) }
2272    ///
2273    /// fn prepare_request_builder() -> MoveObject {
2274    ///   # panic!();
2275    ///   // ... details omitted ...
2276    /// }
2277    /// ```
2278    #[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        /// Sets the full request, replacing any prior values.
2289        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        /// Sets all the options, replacing any prior values.
2295        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2296            self.0.options = v.into();
2297            self
2298        }
2299
2300        /// Sends the request.
2301        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        /// Sets the value of [bucket][crate::model::MoveObjectRequest::bucket].
2309        ///
2310        /// This is a **required** field for requests.
2311        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        /// Sets the value of [source_object][crate::model::MoveObjectRequest::source_object].
2317        ///
2318        /// This is a **required** field for requests.
2319        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        /// Sets the value of [destination_object][crate::model::MoveObjectRequest::destination_object].
2325        ///
2326        /// This is a **required** field for requests.
2327        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        /// Sets the value of [if_source_generation_match][crate::model::MoveObjectRequest::if_source_generation_match].
2333        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        /// Sets or clears the value of [if_source_generation_match][crate::model::MoveObjectRequest::if_source_generation_match].
2342        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        /// Sets the value of [if_source_generation_not_match][crate::model::MoveObjectRequest::if_source_generation_not_match].
2354        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        /// Sets or clears the value of [if_source_generation_not_match][crate::model::MoveObjectRequest::if_source_generation_not_match].
2363        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        /// Sets the value of [if_source_metageneration_match][crate::model::MoveObjectRequest::if_source_metageneration_match].
2375        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        /// Sets or clears the value of [if_source_metageneration_match][crate::model::MoveObjectRequest::if_source_metageneration_match].
2384        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        /// Sets the value of [if_source_metageneration_not_match][crate::model::MoveObjectRequest::if_source_metageneration_not_match].
2396        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        /// Sets or clears the value of [if_source_metageneration_not_match][crate::model::MoveObjectRequest::if_source_metageneration_not_match].
2405        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        /// Sets the value of [if_generation_match][crate::model::MoveObjectRequest::if_generation_match].
2417        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        /// Sets or clears the value of [if_generation_match][crate::model::MoveObjectRequest::if_generation_match].
2426        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        /// Sets the value of [if_generation_not_match][crate::model::MoveObjectRequest::if_generation_not_match].
2435        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        /// Sets or clears the value of [if_generation_not_match][crate::model::MoveObjectRequest::if_generation_not_match].
2444        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        /// Sets the value of [if_metageneration_match][crate::model::MoveObjectRequest::if_metageneration_match].
2453        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        /// Sets or clears the value of [if_metageneration_match][crate::model::MoveObjectRequest::if_metageneration_match].
2462        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        /// Sets the value of [if_metageneration_not_match][crate::model::MoveObjectRequest::if_metageneration_not_match].
2471        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        /// Sets or clears the value of [if_metageneration_not_match][crate::model::MoveObjectRequest::if_metageneration_not_match].
2480        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}