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: gax::options::RequestOptions,
26    }
27
28    impl<R> RequestBuilder<R>
29    where
30        R: std::default::Default,
31    {
32        pub(crate) fn new(
33            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
34        ) -> Self {
35            Self {
36                stub,
37                request: R::default(),
38                options: gax::options::RequestOptions::default(),
39            }
40        }
41    }
42
43    /// The request builder for [StorageControl::delete_bucket][crate::client::StorageControl::delete_bucket] calls.
44    ///
45    /// # Example
46    /// ```no_run
47    /// # use google_cloud_storage::builder;
48    /// use builder::storage_control::DeleteBucket;
49    /// # tokio_test::block_on(async {
50    ///
51    /// let builder = prepare_request_builder();
52    /// let response = builder.send().await?;
53    /// # gax::Result::<()>::Ok(()) });
54    ///
55    /// fn prepare_request_builder() -> DeleteBucket {
56    ///   # panic!();
57    ///   // ... details omitted ...
58    /// }
59    /// ```
60    #[derive(Clone, Debug)]
61    pub struct DeleteBucket(RequestBuilder<crate::model::DeleteBucketRequest>);
62
63    impl DeleteBucket {
64        pub(crate) fn new(
65            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
66        ) -> Self {
67            Self(RequestBuilder::new(stub))
68        }
69
70        /// Sets the full request, replacing any prior values.
71        pub fn with_request<V: Into<crate::model::DeleteBucketRequest>>(mut self, v: V) -> Self {
72            self.0.request = v.into();
73            self
74        }
75
76        /// Sets all the options, replacing any prior values.
77        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
78            self.0.options = v.into();
79            self
80        }
81
82        /// Sends the request.
83        pub async fn send(self) -> Result<()> {
84            (*self.0.stub)
85                .delete_bucket(self.0.request, self.0.options)
86                .await
87                .map(gax::response::Response::into_body)
88        }
89
90        /// Sets the value of [name][crate::model::DeleteBucketRequest::name].
91        ///
92        /// This is a **required** field for requests.
93        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
94            self.0.request.name = v.into();
95            self
96        }
97
98        /// Sets the value of [if_metageneration_match][crate::model::DeleteBucketRequest::if_metageneration_match].
99        pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
100        where
101            T: std::convert::Into<i64>,
102        {
103            self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
104            self
105        }
106
107        /// Sets or clears the value of [if_metageneration_match][crate::model::DeleteBucketRequest::if_metageneration_match].
108        pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
109        where
110            T: std::convert::Into<i64>,
111        {
112            self.0.request.if_metageneration_match = v.map(|x| x.into());
113            self
114        }
115
116        /// Sets the value of [if_metageneration_not_match][crate::model::DeleteBucketRequest::if_metageneration_not_match].
117        pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
118        where
119            T: std::convert::Into<i64>,
120        {
121            self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
122            self
123        }
124
125        /// Sets or clears the value of [if_metageneration_not_match][crate::model::DeleteBucketRequest::if_metageneration_not_match].
126        pub fn set_or_clear_if_metageneration_not_match<T>(
127            mut self,
128            v: std::option::Option<T>,
129        ) -> Self
130        where
131            T: std::convert::Into<i64>,
132        {
133            self.0.request.if_metageneration_not_match = v.map(|x| x.into());
134            self
135        }
136    }
137
138    #[doc(hidden)]
139    impl gax::options::internal::RequestBuilder for DeleteBucket {
140        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
141            &mut self.0.options
142        }
143    }
144
145    /// The request builder for [StorageControl::get_bucket][crate::client::StorageControl::get_bucket] calls.
146    ///
147    /// # Example
148    /// ```no_run
149    /// # use google_cloud_storage::builder;
150    /// use builder::storage_control::GetBucket;
151    /// # tokio_test::block_on(async {
152    ///
153    /// let builder = prepare_request_builder();
154    /// let response = builder.send().await?;
155    /// # gax::Result::<()>::Ok(()) });
156    ///
157    /// fn prepare_request_builder() -> GetBucket {
158    ///   # panic!();
159    ///   // ... details omitted ...
160    /// }
161    /// ```
162    #[derive(Clone, Debug)]
163    pub struct GetBucket(RequestBuilder<crate::model::GetBucketRequest>);
164
165    impl GetBucket {
166        pub(crate) fn new(
167            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
168        ) -> Self {
169            Self(RequestBuilder::new(stub))
170        }
171
172        /// Sets the full request, replacing any prior values.
173        pub fn with_request<V: Into<crate::model::GetBucketRequest>>(mut self, v: V) -> Self {
174            self.0.request = v.into();
175            self
176        }
177
178        /// Sets all the options, replacing any prior values.
179        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
180            self.0.options = v.into();
181            self
182        }
183
184        /// Sends the request.
185        pub async fn send(self) -> Result<crate::model::Bucket> {
186            (*self.0.stub)
187                .get_bucket(self.0.request, self.0.options)
188                .await
189                .map(gax::response::Response::into_body)
190        }
191
192        /// Sets the value of [name][crate::model::GetBucketRequest::name].
193        ///
194        /// This is a **required** field for requests.
195        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
196            self.0.request.name = v.into();
197            self
198        }
199
200        /// Sets the value of [if_metageneration_match][crate::model::GetBucketRequest::if_metageneration_match].
201        pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
202        where
203            T: std::convert::Into<i64>,
204        {
205            self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
206            self
207        }
208
209        /// Sets or clears the value of [if_metageneration_match][crate::model::GetBucketRequest::if_metageneration_match].
210        pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
211        where
212            T: std::convert::Into<i64>,
213        {
214            self.0.request.if_metageneration_match = v.map(|x| x.into());
215            self
216        }
217
218        /// Sets the value of [if_metageneration_not_match][crate::model::GetBucketRequest::if_metageneration_not_match].
219        pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
220        where
221            T: std::convert::Into<i64>,
222        {
223            self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
224            self
225        }
226
227        /// Sets or clears the value of [if_metageneration_not_match][crate::model::GetBucketRequest::if_metageneration_not_match].
228        pub fn set_or_clear_if_metageneration_not_match<T>(
229            mut self,
230            v: std::option::Option<T>,
231        ) -> Self
232        where
233            T: std::convert::Into<i64>,
234        {
235            self.0.request.if_metageneration_not_match = v.map(|x| x.into());
236            self
237        }
238
239        /// Sets the value of [read_mask][crate::model::GetBucketRequest::read_mask].
240        pub fn set_read_mask<T>(mut self, v: T) -> Self
241        where
242            T: std::convert::Into<wkt::FieldMask>,
243        {
244            self.0.request.read_mask = std::option::Option::Some(v.into());
245            self
246        }
247
248        /// Sets or clears the value of [read_mask][crate::model::GetBucketRequest::read_mask].
249        pub fn set_or_clear_read_mask<T>(mut self, v: std::option::Option<T>) -> Self
250        where
251            T: std::convert::Into<wkt::FieldMask>,
252        {
253            self.0.request.read_mask = v.map(|x| x.into());
254            self
255        }
256    }
257
258    #[doc(hidden)]
259    impl gax::options::internal::RequestBuilder for GetBucket {
260        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
261            &mut self.0.options
262        }
263    }
264
265    /// The request builder for [StorageControl::create_bucket][crate::client::StorageControl::create_bucket] calls.
266    ///
267    /// # Example
268    /// ```no_run
269    /// # use google_cloud_storage::builder;
270    /// use builder::storage_control::CreateBucket;
271    /// # tokio_test::block_on(async {
272    ///
273    /// let builder = prepare_request_builder();
274    /// let response = builder.send().await?;
275    /// # gax::Result::<()>::Ok(()) });
276    ///
277    /// fn prepare_request_builder() -> CreateBucket {
278    ///   # panic!();
279    ///   // ... details omitted ...
280    /// }
281    /// ```
282    #[derive(Clone, Debug)]
283    pub struct CreateBucket(RequestBuilder<crate::model::CreateBucketRequest>);
284
285    impl CreateBucket {
286        pub(crate) fn new(
287            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
288        ) -> Self {
289            Self(RequestBuilder::new(stub))
290        }
291
292        /// Sets the full request, replacing any prior values.
293        pub fn with_request<V: Into<crate::model::CreateBucketRequest>>(mut self, v: V) -> Self {
294            self.0.request = v.into();
295            self
296        }
297
298        /// Sets all the options, replacing any prior values.
299        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
300            self.0.options = v.into();
301            self
302        }
303
304        /// Sends the request.
305        pub async fn send(self) -> Result<crate::model::Bucket> {
306            (*self.0.stub)
307                .create_bucket(self.0.request, self.0.options)
308                .await
309                .map(gax::response::Response::into_body)
310        }
311
312        /// Sets the value of [parent][crate::model::CreateBucketRequest::parent].
313        ///
314        /// This is a **required** field for requests.
315        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
316            self.0.request.parent = v.into();
317            self
318        }
319
320        /// Sets the value of [bucket][crate::model::CreateBucketRequest::bucket].
321        pub fn set_bucket<T>(mut self, v: T) -> Self
322        where
323            T: std::convert::Into<crate::model::Bucket>,
324        {
325            self.0.request.bucket = std::option::Option::Some(v.into());
326            self
327        }
328
329        /// Sets or clears the value of [bucket][crate::model::CreateBucketRequest::bucket].
330        pub fn set_or_clear_bucket<T>(mut self, v: std::option::Option<T>) -> Self
331        where
332            T: std::convert::Into<crate::model::Bucket>,
333        {
334            self.0.request.bucket = v.map(|x| x.into());
335            self
336        }
337
338        /// Sets the value of [bucket_id][crate::model::CreateBucketRequest::bucket_id].
339        ///
340        /// This is a **required** field for requests.
341        pub fn set_bucket_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
342            self.0.request.bucket_id = v.into();
343            self
344        }
345
346        /// Sets the value of [predefined_acl][crate::model::CreateBucketRequest::predefined_acl].
347        pub fn set_predefined_acl<T: Into<std::string::String>>(mut self, v: T) -> Self {
348            self.0.request.predefined_acl = v.into();
349            self
350        }
351
352        /// Sets the value of [predefined_default_object_acl][crate::model::CreateBucketRequest::predefined_default_object_acl].
353        pub fn set_predefined_default_object_acl<T: Into<std::string::String>>(
354            mut self,
355            v: T,
356        ) -> Self {
357            self.0.request.predefined_default_object_acl = v.into();
358            self
359        }
360
361        /// Sets the value of [enable_object_retention][crate::model::CreateBucketRequest::enable_object_retention].
362        pub fn set_enable_object_retention<T: Into<bool>>(mut self, v: T) -> Self {
363            self.0.request.enable_object_retention = v.into();
364            self
365        }
366    }
367
368    #[doc(hidden)]
369    impl gax::options::internal::RequestBuilder for CreateBucket {
370        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
371            &mut self.0.options
372        }
373    }
374
375    /// The request builder for [StorageControl::list_buckets][crate::client::StorageControl::list_buckets] calls.
376    ///
377    /// # Example
378    /// ```no_run
379    /// # use google_cloud_storage::builder;
380    /// use builder::storage_control::ListBuckets;
381    /// # tokio_test::block_on(async {
382    /// use gax::paginator::ItemPaginator;
383    ///
384    /// let builder = prepare_request_builder();
385    /// let mut items = builder.by_item();
386    /// while let Some(result) = items.next().await {
387    ///   let item = result?;
388    /// }
389    /// # gax::Result::<()>::Ok(()) });
390    ///
391    /// fn prepare_request_builder() -> ListBuckets {
392    ///   # panic!();
393    ///   // ... details omitted ...
394    /// }
395    /// ```
396    #[derive(Clone, Debug)]
397    pub struct ListBuckets(RequestBuilder<crate::model::ListBucketsRequest>);
398
399    impl ListBuckets {
400        pub(crate) fn new(
401            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
402        ) -> Self {
403            Self(RequestBuilder::new(stub))
404        }
405
406        /// Sets the full request, replacing any prior values.
407        pub fn with_request<V: Into<crate::model::ListBucketsRequest>>(mut self, v: V) -> Self {
408            self.0.request = v.into();
409            self
410        }
411
412        /// Sets all the options, replacing any prior values.
413        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
414            self.0.options = v.into();
415            self
416        }
417
418        /// Sends the request.
419        pub async fn send(self) -> Result<crate::model::ListBucketsResponse> {
420            (*self.0.stub)
421                .list_buckets(self.0.request, self.0.options)
422                .await
423                .map(gax::response::Response::into_body)
424        }
425
426        /// Streams each page in the collection.
427        pub fn by_page(
428            self,
429        ) -> impl gax::paginator::Paginator<crate::model::ListBucketsResponse, gax::error::Error>
430        {
431            use std::clone::Clone;
432            let token = self.0.request.page_token.clone();
433            let execute = move |token: String| {
434                let mut builder = self.clone();
435                builder.0.request = builder.0.request.set_page_token(token);
436                builder.send()
437            };
438            gax::paginator::internal::new_paginator(token, execute)
439        }
440
441        /// Streams each item in the collection.
442        pub fn by_item(
443            self,
444        ) -> impl gax::paginator::ItemPaginator<crate::model::ListBucketsResponse, gax::error::Error>
445        {
446            use gax::paginator::Paginator;
447            self.by_page().items()
448        }
449
450        /// Sets the value of [parent][crate::model::ListBucketsRequest::parent].
451        ///
452        /// This is a **required** field for requests.
453        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
454            self.0.request.parent = v.into();
455            self
456        }
457
458        /// Sets the value of [page_size][crate::model::ListBucketsRequest::page_size].
459        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
460            self.0.request.page_size = v.into();
461            self
462        }
463
464        /// Sets the value of [page_token][crate::model::ListBucketsRequest::page_token].
465        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
466            self.0.request.page_token = v.into();
467            self
468        }
469
470        /// Sets the value of [prefix][crate::model::ListBucketsRequest::prefix].
471        pub fn set_prefix<T: Into<std::string::String>>(mut self, v: T) -> Self {
472            self.0.request.prefix = v.into();
473            self
474        }
475
476        /// Sets the value of [read_mask][crate::model::ListBucketsRequest::read_mask].
477        pub fn set_read_mask<T>(mut self, v: T) -> Self
478        where
479            T: std::convert::Into<wkt::FieldMask>,
480        {
481            self.0.request.read_mask = std::option::Option::Some(v.into());
482            self
483        }
484
485        /// Sets or clears the value of [read_mask][crate::model::ListBucketsRequest::read_mask].
486        pub fn set_or_clear_read_mask<T>(mut self, v: std::option::Option<T>) -> Self
487        where
488            T: std::convert::Into<wkt::FieldMask>,
489        {
490            self.0.request.read_mask = v.map(|x| x.into());
491            self
492        }
493
494        /// Sets the value of [return_partial_success][crate::model::ListBucketsRequest::return_partial_success].
495        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
496            self.0.request.return_partial_success = v.into();
497            self
498        }
499    }
500
501    #[doc(hidden)]
502    impl gax::options::internal::RequestBuilder for ListBuckets {
503        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
504            &mut self.0.options
505        }
506    }
507
508    /// The request builder for [StorageControl::lock_bucket_retention_policy][crate::client::StorageControl::lock_bucket_retention_policy] calls.
509    ///
510    /// # Example
511    /// ```no_run
512    /// # use google_cloud_storage::builder;
513    /// use builder::storage_control::LockBucketRetentionPolicy;
514    /// # tokio_test::block_on(async {
515    ///
516    /// let builder = prepare_request_builder();
517    /// let response = builder.send().await?;
518    /// # gax::Result::<()>::Ok(()) });
519    ///
520    /// fn prepare_request_builder() -> LockBucketRetentionPolicy {
521    ///   # panic!();
522    ///   // ... details omitted ...
523    /// }
524    /// ```
525    #[derive(Clone, Debug)]
526    pub struct LockBucketRetentionPolicy(
527        RequestBuilder<crate::model::LockBucketRetentionPolicyRequest>,
528    );
529
530    impl LockBucketRetentionPolicy {
531        pub(crate) fn new(
532            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
533        ) -> Self {
534            Self(RequestBuilder::new(stub))
535        }
536
537        /// Sets the full request, replacing any prior values.
538        pub fn with_request<V: Into<crate::model::LockBucketRetentionPolicyRequest>>(
539            mut self,
540            v: V,
541        ) -> Self {
542            self.0.request = v.into();
543            self
544        }
545
546        /// Sets all the options, replacing any prior values.
547        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
548            self.0.options = v.into();
549            self
550        }
551
552        /// Sends the request.
553        pub async fn send(self) -> Result<crate::model::Bucket> {
554            (*self.0.stub)
555                .lock_bucket_retention_policy(self.0.request, self.0.options)
556                .await
557                .map(gax::response::Response::into_body)
558        }
559
560        /// Sets the value of [bucket][crate::model::LockBucketRetentionPolicyRequest::bucket].
561        ///
562        /// This is a **required** field for requests.
563        pub fn set_bucket<T: Into<std::string::String>>(mut self, v: T) -> Self {
564            self.0.request.bucket = v.into();
565            self
566        }
567
568        /// Sets the value of [if_metageneration_match][crate::model::LockBucketRetentionPolicyRequest::if_metageneration_match].
569        ///
570        /// This is a **required** field for requests.
571        pub fn set_if_metageneration_match<T: Into<i64>>(mut self, v: T) -> Self {
572            self.0.request.if_metageneration_match = v.into();
573            self
574        }
575    }
576
577    #[doc(hidden)]
578    impl gax::options::internal::RequestBuilder for LockBucketRetentionPolicy {
579        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
580            &mut self.0.options
581        }
582    }
583
584    /// The request builder for [StorageControl::update_bucket][crate::client::StorageControl::update_bucket] calls.
585    ///
586    /// # Example
587    /// ```no_run
588    /// # use google_cloud_storage::builder;
589    /// use builder::storage_control::UpdateBucket;
590    /// # tokio_test::block_on(async {
591    ///
592    /// let builder = prepare_request_builder();
593    /// let response = builder.send().await?;
594    /// # gax::Result::<()>::Ok(()) });
595    ///
596    /// fn prepare_request_builder() -> UpdateBucket {
597    ///   # panic!();
598    ///   // ... details omitted ...
599    /// }
600    /// ```
601    #[derive(Clone, Debug)]
602    pub struct UpdateBucket(RequestBuilder<crate::model::UpdateBucketRequest>);
603
604    impl UpdateBucket {
605        pub(crate) fn new(
606            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
607        ) -> Self {
608            Self(RequestBuilder::new(stub))
609        }
610
611        /// Sets the full request, replacing any prior values.
612        pub fn with_request<V: Into<crate::model::UpdateBucketRequest>>(mut self, v: V) -> Self {
613            self.0.request = v.into();
614            self
615        }
616
617        /// Sets all the options, replacing any prior values.
618        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
619            self.0.options = v.into();
620            self
621        }
622
623        /// Sends the request.
624        pub async fn send(self) -> Result<crate::model::Bucket> {
625            (*self.0.stub)
626                .update_bucket(self.0.request, self.0.options)
627                .await
628                .map(gax::response::Response::into_body)
629        }
630
631        /// Sets the value of [bucket][crate::model::UpdateBucketRequest::bucket].
632        ///
633        /// This is a **required** field for requests.
634        pub fn set_bucket<T>(mut self, v: T) -> Self
635        where
636            T: std::convert::Into<crate::model::Bucket>,
637        {
638            self.0.request.bucket = std::option::Option::Some(v.into());
639            self
640        }
641
642        /// Sets or clears the value of [bucket][crate::model::UpdateBucketRequest::bucket].
643        ///
644        /// This is a **required** field for requests.
645        pub fn set_or_clear_bucket<T>(mut self, v: std::option::Option<T>) -> Self
646        where
647            T: std::convert::Into<crate::model::Bucket>,
648        {
649            self.0.request.bucket = v.map(|x| x.into());
650            self
651        }
652
653        /// Sets the value of [if_metageneration_match][crate::model::UpdateBucketRequest::if_metageneration_match].
654        pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
655        where
656            T: std::convert::Into<i64>,
657        {
658            self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
659            self
660        }
661
662        /// Sets or clears the value of [if_metageneration_match][crate::model::UpdateBucketRequest::if_metageneration_match].
663        pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
664        where
665            T: std::convert::Into<i64>,
666        {
667            self.0.request.if_metageneration_match = v.map(|x| x.into());
668            self
669        }
670
671        /// Sets the value of [if_metageneration_not_match][crate::model::UpdateBucketRequest::if_metageneration_not_match].
672        pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
673        where
674            T: std::convert::Into<i64>,
675        {
676            self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
677            self
678        }
679
680        /// Sets or clears the value of [if_metageneration_not_match][crate::model::UpdateBucketRequest::if_metageneration_not_match].
681        pub fn set_or_clear_if_metageneration_not_match<T>(
682            mut self,
683            v: std::option::Option<T>,
684        ) -> Self
685        where
686            T: std::convert::Into<i64>,
687        {
688            self.0.request.if_metageneration_not_match = v.map(|x| x.into());
689            self
690        }
691
692        /// Sets the value of [predefined_acl][crate::model::UpdateBucketRequest::predefined_acl].
693        pub fn set_predefined_acl<T: Into<std::string::String>>(mut self, v: T) -> Self {
694            self.0.request.predefined_acl = v.into();
695            self
696        }
697
698        /// Sets the value of [predefined_default_object_acl][crate::model::UpdateBucketRequest::predefined_default_object_acl].
699        pub fn set_predefined_default_object_acl<T: Into<std::string::String>>(
700            mut self,
701            v: T,
702        ) -> Self {
703            self.0.request.predefined_default_object_acl = v.into();
704            self
705        }
706
707        /// Sets the value of [update_mask][crate::model::UpdateBucketRequest::update_mask].
708        ///
709        /// This is a **required** field for requests.
710        pub fn set_update_mask<T>(mut self, v: T) -> Self
711        where
712            T: std::convert::Into<wkt::FieldMask>,
713        {
714            self.0.request.update_mask = std::option::Option::Some(v.into());
715            self
716        }
717
718        /// Sets or clears the value of [update_mask][crate::model::UpdateBucketRequest::update_mask].
719        ///
720        /// This is a **required** field for requests.
721        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
722        where
723            T: std::convert::Into<wkt::FieldMask>,
724        {
725            self.0.request.update_mask = v.map(|x| x.into());
726            self
727        }
728    }
729
730    #[doc(hidden)]
731    impl gax::options::internal::RequestBuilder for UpdateBucket {
732        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
733            &mut self.0.options
734        }
735    }
736
737    /// The request builder for [StorageControl::compose_object][crate::client::StorageControl::compose_object] calls.
738    ///
739    /// # Example
740    /// ```no_run
741    /// # use google_cloud_storage::builder;
742    /// use builder::storage_control::ComposeObject;
743    /// # tokio_test::block_on(async {
744    ///
745    /// let builder = prepare_request_builder();
746    /// let response = builder.send().await?;
747    /// # gax::Result::<()>::Ok(()) });
748    ///
749    /// fn prepare_request_builder() -> ComposeObject {
750    ///   # panic!();
751    ///   // ... details omitted ...
752    /// }
753    /// ```
754    #[derive(Clone, Debug)]
755    pub struct ComposeObject(RequestBuilder<crate::model::ComposeObjectRequest>);
756
757    impl ComposeObject {
758        pub(crate) fn new(
759            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
760        ) -> Self {
761            Self(RequestBuilder::new(stub))
762        }
763
764        /// Sets the full request, replacing any prior values.
765        pub fn with_request<V: Into<crate::model::ComposeObjectRequest>>(mut self, v: V) -> Self {
766            self.0.request = v.into();
767            self
768        }
769
770        /// Sets all the options, replacing any prior values.
771        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
772            self.0.options = v.into();
773            self
774        }
775
776        /// Sends the request.
777        pub async fn send(self) -> Result<crate::model::Object> {
778            (*self.0.stub)
779                .compose_object(self.0.request, self.0.options)
780                .await
781                .map(gax::response::Response::into_body)
782        }
783
784        /// Sets the value of [destination][crate::model::ComposeObjectRequest::destination].
785        ///
786        /// This is a **required** field for requests.
787        pub fn set_destination<T>(mut self, v: T) -> Self
788        where
789            T: std::convert::Into<crate::model::Object>,
790        {
791            self.0.request.destination = std::option::Option::Some(v.into());
792            self
793        }
794
795        /// Sets or clears the value of [destination][crate::model::ComposeObjectRequest::destination].
796        ///
797        /// This is a **required** field for requests.
798        pub fn set_or_clear_destination<T>(mut self, v: std::option::Option<T>) -> Self
799        where
800            T: std::convert::Into<crate::model::Object>,
801        {
802            self.0.request.destination = v.map(|x| x.into());
803            self
804        }
805
806        /// Sets the value of [source_objects][crate::model::ComposeObjectRequest::source_objects].
807        pub fn set_source_objects<T, V>(mut self, v: T) -> Self
808        where
809            T: std::iter::IntoIterator<Item = V>,
810            V: std::convert::Into<crate::model::compose_object_request::SourceObject>,
811        {
812            use std::iter::Iterator;
813            self.0.request.source_objects = v.into_iter().map(|i| i.into()).collect();
814            self
815        }
816
817        /// Sets the value of [destination_predefined_acl][crate::model::ComposeObjectRequest::destination_predefined_acl].
818        pub fn set_destination_predefined_acl<T: Into<std::string::String>>(
819            mut self,
820            v: T,
821        ) -> Self {
822            self.0.request.destination_predefined_acl = v.into();
823            self
824        }
825
826        /// Sets the value of [if_generation_match][crate::model::ComposeObjectRequest::if_generation_match].
827        pub fn set_if_generation_match<T>(mut self, v: T) -> Self
828        where
829            T: std::convert::Into<i64>,
830        {
831            self.0.request.if_generation_match = std::option::Option::Some(v.into());
832            self
833        }
834
835        /// Sets or clears the value of [if_generation_match][crate::model::ComposeObjectRequest::if_generation_match].
836        pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
837        where
838            T: std::convert::Into<i64>,
839        {
840            self.0.request.if_generation_match = v.map(|x| x.into());
841            self
842        }
843
844        /// Sets the value of [if_metageneration_match][crate::model::ComposeObjectRequest::if_metageneration_match].
845        pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
846        where
847            T: std::convert::Into<i64>,
848        {
849            self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
850            self
851        }
852
853        /// Sets or clears the value of [if_metageneration_match][crate::model::ComposeObjectRequest::if_metageneration_match].
854        pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
855        where
856            T: std::convert::Into<i64>,
857        {
858            self.0.request.if_metageneration_match = v.map(|x| x.into());
859            self
860        }
861
862        /// Sets the value of [kms_key][crate::model::ComposeObjectRequest::kms_key].
863        pub fn set_kms_key<T: Into<std::string::String>>(mut self, v: T) -> Self {
864            self.0.request.kms_key = v.into();
865            self
866        }
867
868        /// Sets the value of [common_object_request_params][crate::model::ComposeObjectRequest::common_object_request_params].
869        pub fn set_common_object_request_params<T>(mut self, v: T) -> Self
870        where
871            T: std::convert::Into<crate::model::CommonObjectRequestParams>,
872        {
873            self.0.request.common_object_request_params = std::option::Option::Some(v.into());
874            self
875        }
876
877        /// Sets or clears the value of [common_object_request_params][crate::model::ComposeObjectRequest::common_object_request_params].
878        pub fn set_or_clear_common_object_request_params<T>(
879            mut self,
880            v: std::option::Option<T>,
881        ) -> Self
882        where
883            T: std::convert::Into<crate::model::CommonObjectRequestParams>,
884        {
885            self.0.request.common_object_request_params = v.map(|x| x.into());
886            self
887        }
888
889        /// Sets the value of [object_checksums][crate::model::ComposeObjectRequest::object_checksums].
890        pub fn set_object_checksums<T>(mut self, v: T) -> Self
891        where
892            T: std::convert::Into<crate::model::ObjectChecksums>,
893        {
894            self.0.request.object_checksums = std::option::Option::Some(v.into());
895            self
896        }
897
898        /// Sets or clears the value of [object_checksums][crate::model::ComposeObjectRequest::object_checksums].
899        pub fn set_or_clear_object_checksums<T>(mut self, v: std::option::Option<T>) -> Self
900        where
901            T: std::convert::Into<crate::model::ObjectChecksums>,
902        {
903            self.0.request.object_checksums = v.map(|x| x.into());
904            self
905        }
906    }
907
908    #[doc(hidden)]
909    impl gax::options::internal::RequestBuilder for ComposeObject {
910        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
911            &mut self.0.options
912        }
913    }
914
915    /// The request builder for [StorageControl::delete_object][crate::client::StorageControl::delete_object] calls.
916    ///
917    /// # Example
918    /// ```no_run
919    /// # use google_cloud_storage::builder;
920    /// use builder::storage_control::DeleteObject;
921    /// # tokio_test::block_on(async {
922    ///
923    /// let builder = prepare_request_builder();
924    /// let response = builder.send().await?;
925    /// # gax::Result::<()>::Ok(()) });
926    ///
927    /// fn prepare_request_builder() -> DeleteObject {
928    ///   # panic!();
929    ///   // ... details omitted ...
930    /// }
931    /// ```
932    #[derive(Clone, Debug)]
933    pub struct DeleteObject(RequestBuilder<crate::model::DeleteObjectRequest>);
934
935    impl DeleteObject {
936        pub(crate) fn new(
937            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
938        ) -> Self {
939            Self(RequestBuilder::new(stub))
940        }
941
942        /// Sets the full request, replacing any prior values.
943        pub fn with_request<V: Into<crate::model::DeleteObjectRequest>>(mut self, v: V) -> Self {
944            self.0.request = v.into();
945            self
946        }
947
948        /// Sets all the options, replacing any prior values.
949        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
950            self.0.options = v.into();
951            self
952        }
953
954        /// Sends the request.
955        pub async fn send(self) -> Result<()> {
956            (*self.0.stub)
957                .delete_object(self.0.request, self.0.options)
958                .await
959                .map(gax::response::Response::into_body)
960        }
961
962        /// Sets the value of [bucket][crate::model::DeleteObjectRequest::bucket].
963        ///
964        /// This is a **required** field for requests.
965        pub fn set_bucket<T: Into<std::string::String>>(mut self, v: T) -> Self {
966            self.0.request.bucket = v.into();
967            self
968        }
969
970        /// Sets the value of [object][crate::model::DeleteObjectRequest::object].
971        ///
972        /// This is a **required** field for requests.
973        pub fn set_object<T: Into<std::string::String>>(mut self, v: T) -> Self {
974            self.0.request.object = v.into();
975            self
976        }
977
978        /// Sets the value of [generation][crate::model::DeleteObjectRequest::generation].
979        pub fn set_generation<T: Into<i64>>(mut self, v: T) -> Self {
980            self.0.request.generation = v.into();
981            self
982        }
983
984        /// Sets the value of [if_generation_match][crate::model::DeleteObjectRequest::if_generation_match].
985        pub fn set_if_generation_match<T>(mut self, v: T) -> Self
986        where
987            T: std::convert::Into<i64>,
988        {
989            self.0.request.if_generation_match = std::option::Option::Some(v.into());
990            self
991        }
992
993        /// Sets or clears the value of [if_generation_match][crate::model::DeleteObjectRequest::if_generation_match].
994        pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
995        where
996            T: std::convert::Into<i64>,
997        {
998            self.0.request.if_generation_match = v.map(|x| x.into());
999            self
1000        }
1001
1002        /// Sets the value of [if_generation_not_match][crate::model::DeleteObjectRequest::if_generation_not_match].
1003        pub fn set_if_generation_not_match<T>(mut self, v: T) -> Self
1004        where
1005            T: std::convert::Into<i64>,
1006        {
1007            self.0.request.if_generation_not_match = std::option::Option::Some(v.into());
1008            self
1009        }
1010
1011        /// Sets or clears the value of [if_generation_not_match][crate::model::DeleteObjectRequest::if_generation_not_match].
1012        pub fn set_or_clear_if_generation_not_match<T>(mut self, v: std::option::Option<T>) -> Self
1013        where
1014            T: std::convert::Into<i64>,
1015        {
1016            self.0.request.if_generation_not_match = v.map(|x| x.into());
1017            self
1018        }
1019
1020        /// Sets the value of [if_metageneration_match][crate::model::DeleteObjectRequest::if_metageneration_match].
1021        pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
1022        where
1023            T: std::convert::Into<i64>,
1024        {
1025            self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
1026            self
1027        }
1028
1029        /// Sets or clears the value of [if_metageneration_match][crate::model::DeleteObjectRequest::if_metageneration_match].
1030        pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
1031        where
1032            T: std::convert::Into<i64>,
1033        {
1034            self.0.request.if_metageneration_match = v.map(|x| x.into());
1035            self
1036        }
1037
1038        /// Sets the value of [if_metageneration_not_match][crate::model::DeleteObjectRequest::if_metageneration_not_match].
1039        pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
1040        where
1041            T: std::convert::Into<i64>,
1042        {
1043            self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
1044            self
1045        }
1046
1047        /// Sets or clears the value of [if_metageneration_not_match][crate::model::DeleteObjectRequest::if_metageneration_not_match].
1048        pub fn set_or_clear_if_metageneration_not_match<T>(
1049            mut self,
1050            v: std::option::Option<T>,
1051        ) -> Self
1052        where
1053            T: std::convert::Into<i64>,
1054        {
1055            self.0.request.if_metageneration_not_match = v.map(|x| x.into());
1056            self
1057        }
1058
1059        /// Sets the value of [common_object_request_params][crate::model::DeleteObjectRequest::common_object_request_params].
1060        pub fn set_common_object_request_params<T>(mut self, v: T) -> Self
1061        where
1062            T: std::convert::Into<crate::model::CommonObjectRequestParams>,
1063        {
1064            self.0.request.common_object_request_params = std::option::Option::Some(v.into());
1065            self
1066        }
1067
1068        /// Sets or clears the value of [common_object_request_params][crate::model::DeleteObjectRequest::common_object_request_params].
1069        pub fn set_or_clear_common_object_request_params<T>(
1070            mut self,
1071            v: std::option::Option<T>,
1072        ) -> Self
1073        where
1074            T: std::convert::Into<crate::model::CommonObjectRequestParams>,
1075        {
1076            self.0.request.common_object_request_params = v.map(|x| x.into());
1077            self
1078        }
1079    }
1080
1081    #[doc(hidden)]
1082    impl gax::options::internal::RequestBuilder for DeleteObject {
1083        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1084            &mut self.0.options
1085        }
1086    }
1087
1088    /// The request builder for [StorageControl::restore_object][crate::client::StorageControl::restore_object] calls.
1089    ///
1090    /// # Example
1091    /// ```no_run
1092    /// # use google_cloud_storage::builder;
1093    /// use builder::storage_control::RestoreObject;
1094    /// # tokio_test::block_on(async {
1095    ///
1096    /// let builder = prepare_request_builder();
1097    /// let response = builder.send().await?;
1098    /// # gax::Result::<()>::Ok(()) });
1099    ///
1100    /// fn prepare_request_builder() -> RestoreObject {
1101    ///   # panic!();
1102    ///   // ... details omitted ...
1103    /// }
1104    /// ```
1105    #[derive(Clone, Debug)]
1106    pub struct RestoreObject(RequestBuilder<crate::model::RestoreObjectRequest>);
1107
1108    impl RestoreObject {
1109        pub(crate) fn new(
1110            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1111        ) -> Self {
1112            Self(RequestBuilder::new(stub))
1113        }
1114
1115        /// Sets the full request, replacing any prior values.
1116        pub fn with_request<V: Into<crate::model::RestoreObjectRequest>>(mut self, v: V) -> Self {
1117            self.0.request = v.into();
1118            self
1119        }
1120
1121        /// Sets all the options, replacing any prior values.
1122        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1123            self.0.options = v.into();
1124            self
1125        }
1126
1127        /// Sends the request.
1128        pub async fn send(self) -> Result<crate::model::Object> {
1129            (*self.0.stub)
1130                .restore_object(self.0.request, self.0.options)
1131                .await
1132                .map(gax::response::Response::into_body)
1133        }
1134
1135        /// Sets the value of [bucket][crate::model::RestoreObjectRequest::bucket].
1136        ///
1137        /// This is a **required** field for requests.
1138        pub fn set_bucket<T: Into<std::string::String>>(mut self, v: T) -> Self {
1139            self.0.request.bucket = v.into();
1140            self
1141        }
1142
1143        /// Sets the value of [object][crate::model::RestoreObjectRequest::object].
1144        ///
1145        /// This is a **required** field for requests.
1146        pub fn set_object<T: Into<std::string::String>>(mut self, v: T) -> Self {
1147            self.0.request.object = v.into();
1148            self
1149        }
1150
1151        /// Sets the value of [generation][crate::model::RestoreObjectRequest::generation].
1152        ///
1153        /// This is a **required** field for requests.
1154        pub fn set_generation<T: Into<i64>>(mut self, v: T) -> Self {
1155            self.0.request.generation = v.into();
1156            self
1157        }
1158
1159        /// Sets the value of [restore_token][crate::model::RestoreObjectRequest::restore_token].
1160        pub fn set_restore_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1161            self.0.request.restore_token = v.into();
1162            self
1163        }
1164
1165        /// Sets the value of [if_generation_match][crate::model::RestoreObjectRequest::if_generation_match].
1166        pub fn set_if_generation_match<T>(mut self, v: T) -> Self
1167        where
1168            T: std::convert::Into<i64>,
1169        {
1170            self.0.request.if_generation_match = std::option::Option::Some(v.into());
1171            self
1172        }
1173
1174        /// Sets or clears the value of [if_generation_match][crate::model::RestoreObjectRequest::if_generation_match].
1175        pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
1176        where
1177            T: std::convert::Into<i64>,
1178        {
1179            self.0.request.if_generation_match = v.map(|x| x.into());
1180            self
1181        }
1182
1183        /// Sets the value of [if_generation_not_match][crate::model::RestoreObjectRequest::if_generation_not_match].
1184        pub fn set_if_generation_not_match<T>(mut self, v: T) -> Self
1185        where
1186            T: std::convert::Into<i64>,
1187        {
1188            self.0.request.if_generation_not_match = std::option::Option::Some(v.into());
1189            self
1190        }
1191
1192        /// Sets or clears the value of [if_generation_not_match][crate::model::RestoreObjectRequest::if_generation_not_match].
1193        pub fn set_or_clear_if_generation_not_match<T>(mut self, v: std::option::Option<T>) -> Self
1194        where
1195            T: std::convert::Into<i64>,
1196        {
1197            self.0.request.if_generation_not_match = v.map(|x| x.into());
1198            self
1199        }
1200
1201        /// Sets the value of [if_metageneration_match][crate::model::RestoreObjectRequest::if_metageneration_match].
1202        pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
1203        where
1204            T: std::convert::Into<i64>,
1205        {
1206            self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
1207            self
1208        }
1209
1210        /// Sets or clears the value of [if_metageneration_match][crate::model::RestoreObjectRequest::if_metageneration_match].
1211        pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
1212        where
1213            T: std::convert::Into<i64>,
1214        {
1215            self.0.request.if_metageneration_match = v.map(|x| x.into());
1216            self
1217        }
1218
1219        /// Sets the value of [if_metageneration_not_match][crate::model::RestoreObjectRequest::if_metageneration_not_match].
1220        pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
1221        where
1222            T: std::convert::Into<i64>,
1223        {
1224            self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
1225            self
1226        }
1227
1228        /// Sets or clears the value of [if_metageneration_not_match][crate::model::RestoreObjectRequest::if_metageneration_not_match].
1229        pub fn set_or_clear_if_metageneration_not_match<T>(
1230            mut self,
1231            v: std::option::Option<T>,
1232        ) -> Self
1233        where
1234            T: std::convert::Into<i64>,
1235        {
1236            self.0.request.if_metageneration_not_match = v.map(|x| x.into());
1237            self
1238        }
1239
1240        /// Sets the value of [copy_source_acl][crate::model::RestoreObjectRequest::copy_source_acl].
1241        pub fn set_copy_source_acl<T>(mut self, v: T) -> Self
1242        where
1243            T: std::convert::Into<bool>,
1244        {
1245            self.0.request.copy_source_acl = std::option::Option::Some(v.into());
1246            self
1247        }
1248
1249        /// Sets or clears the value of [copy_source_acl][crate::model::RestoreObjectRequest::copy_source_acl].
1250        pub fn set_or_clear_copy_source_acl<T>(mut self, v: std::option::Option<T>) -> Self
1251        where
1252            T: std::convert::Into<bool>,
1253        {
1254            self.0.request.copy_source_acl = v.map(|x| x.into());
1255            self
1256        }
1257
1258        /// Sets the value of [common_object_request_params][crate::model::RestoreObjectRequest::common_object_request_params].
1259        pub fn set_common_object_request_params<T>(mut self, v: T) -> Self
1260        where
1261            T: std::convert::Into<crate::model::CommonObjectRequestParams>,
1262        {
1263            self.0.request.common_object_request_params = std::option::Option::Some(v.into());
1264            self
1265        }
1266
1267        /// Sets or clears the value of [common_object_request_params][crate::model::RestoreObjectRequest::common_object_request_params].
1268        pub fn set_or_clear_common_object_request_params<T>(
1269            mut self,
1270            v: std::option::Option<T>,
1271        ) -> Self
1272        where
1273            T: std::convert::Into<crate::model::CommonObjectRequestParams>,
1274        {
1275            self.0.request.common_object_request_params = v.map(|x| x.into());
1276            self
1277        }
1278    }
1279
1280    #[doc(hidden)]
1281    impl gax::options::internal::RequestBuilder for RestoreObject {
1282        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1283            &mut self.0.options
1284        }
1285    }
1286
1287    /// The request builder for [StorageControl::get_object][crate::client::StorageControl::get_object] calls.
1288    ///
1289    /// # Example
1290    /// ```no_run
1291    /// # use google_cloud_storage::builder;
1292    /// use builder::storage_control::GetObject;
1293    /// # tokio_test::block_on(async {
1294    ///
1295    /// let builder = prepare_request_builder();
1296    /// let response = builder.send().await?;
1297    /// # gax::Result::<()>::Ok(()) });
1298    ///
1299    /// fn prepare_request_builder() -> GetObject {
1300    ///   # panic!();
1301    ///   // ... details omitted ...
1302    /// }
1303    /// ```
1304    #[derive(Clone, Debug)]
1305    pub struct GetObject(RequestBuilder<crate::model::GetObjectRequest>);
1306
1307    impl GetObject {
1308        pub(crate) fn new(
1309            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1310        ) -> Self {
1311            Self(RequestBuilder::new(stub))
1312        }
1313
1314        /// Sets the full request, replacing any prior values.
1315        pub fn with_request<V: Into<crate::model::GetObjectRequest>>(mut self, v: V) -> Self {
1316            self.0.request = v.into();
1317            self
1318        }
1319
1320        /// Sets all the options, replacing any prior values.
1321        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1322            self.0.options = v.into();
1323            self
1324        }
1325
1326        /// Sends the request.
1327        pub async fn send(self) -> Result<crate::model::Object> {
1328            (*self.0.stub)
1329                .get_object(self.0.request, self.0.options)
1330                .await
1331                .map(gax::response::Response::into_body)
1332        }
1333
1334        /// Sets the value of [bucket][crate::model::GetObjectRequest::bucket].
1335        ///
1336        /// This is a **required** field for requests.
1337        pub fn set_bucket<T: Into<std::string::String>>(mut self, v: T) -> Self {
1338            self.0.request.bucket = v.into();
1339            self
1340        }
1341
1342        /// Sets the value of [object][crate::model::GetObjectRequest::object].
1343        ///
1344        /// This is a **required** field for requests.
1345        pub fn set_object<T: Into<std::string::String>>(mut self, v: T) -> Self {
1346            self.0.request.object = v.into();
1347            self
1348        }
1349
1350        /// Sets the value of [generation][crate::model::GetObjectRequest::generation].
1351        pub fn set_generation<T: Into<i64>>(mut self, v: T) -> Self {
1352            self.0.request.generation = v.into();
1353            self
1354        }
1355
1356        /// Sets the value of [soft_deleted][crate::model::GetObjectRequest::soft_deleted].
1357        pub fn set_soft_deleted<T>(mut self, v: T) -> Self
1358        where
1359            T: std::convert::Into<bool>,
1360        {
1361            self.0.request.soft_deleted = std::option::Option::Some(v.into());
1362            self
1363        }
1364
1365        /// Sets or clears the value of [soft_deleted][crate::model::GetObjectRequest::soft_deleted].
1366        pub fn set_or_clear_soft_deleted<T>(mut self, v: std::option::Option<T>) -> Self
1367        where
1368            T: std::convert::Into<bool>,
1369        {
1370            self.0.request.soft_deleted = v.map(|x| x.into());
1371            self
1372        }
1373
1374        /// Sets the value of [if_generation_match][crate::model::GetObjectRequest::if_generation_match].
1375        pub fn set_if_generation_match<T>(mut self, v: T) -> Self
1376        where
1377            T: std::convert::Into<i64>,
1378        {
1379            self.0.request.if_generation_match = std::option::Option::Some(v.into());
1380            self
1381        }
1382
1383        /// Sets or clears the value of [if_generation_match][crate::model::GetObjectRequest::if_generation_match].
1384        pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
1385        where
1386            T: std::convert::Into<i64>,
1387        {
1388            self.0.request.if_generation_match = v.map(|x| x.into());
1389            self
1390        }
1391
1392        /// Sets the value of [if_generation_not_match][crate::model::GetObjectRequest::if_generation_not_match].
1393        pub fn set_if_generation_not_match<T>(mut self, v: T) -> Self
1394        where
1395            T: std::convert::Into<i64>,
1396        {
1397            self.0.request.if_generation_not_match = std::option::Option::Some(v.into());
1398            self
1399        }
1400
1401        /// Sets or clears the value of [if_generation_not_match][crate::model::GetObjectRequest::if_generation_not_match].
1402        pub fn set_or_clear_if_generation_not_match<T>(mut self, v: std::option::Option<T>) -> Self
1403        where
1404            T: std::convert::Into<i64>,
1405        {
1406            self.0.request.if_generation_not_match = v.map(|x| x.into());
1407            self
1408        }
1409
1410        /// Sets the value of [if_metageneration_match][crate::model::GetObjectRequest::if_metageneration_match].
1411        pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
1412        where
1413            T: std::convert::Into<i64>,
1414        {
1415            self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
1416            self
1417        }
1418
1419        /// Sets or clears the value of [if_metageneration_match][crate::model::GetObjectRequest::if_metageneration_match].
1420        pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
1421        where
1422            T: std::convert::Into<i64>,
1423        {
1424            self.0.request.if_metageneration_match = v.map(|x| x.into());
1425            self
1426        }
1427
1428        /// Sets the value of [if_metageneration_not_match][crate::model::GetObjectRequest::if_metageneration_not_match].
1429        pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
1430        where
1431            T: std::convert::Into<i64>,
1432        {
1433            self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
1434            self
1435        }
1436
1437        /// Sets or clears the value of [if_metageneration_not_match][crate::model::GetObjectRequest::if_metageneration_not_match].
1438        pub fn set_or_clear_if_metageneration_not_match<T>(
1439            mut self,
1440            v: std::option::Option<T>,
1441        ) -> Self
1442        where
1443            T: std::convert::Into<i64>,
1444        {
1445            self.0.request.if_metageneration_not_match = v.map(|x| x.into());
1446            self
1447        }
1448
1449        /// Sets the value of [common_object_request_params][crate::model::GetObjectRequest::common_object_request_params].
1450        pub fn set_common_object_request_params<T>(mut self, v: T) -> Self
1451        where
1452            T: std::convert::Into<crate::model::CommonObjectRequestParams>,
1453        {
1454            self.0.request.common_object_request_params = std::option::Option::Some(v.into());
1455            self
1456        }
1457
1458        /// Sets or clears the value of [common_object_request_params][crate::model::GetObjectRequest::common_object_request_params].
1459        pub fn set_or_clear_common_object_request_params<T>(
1460            mut self,
1461            v: std::option::Option<T>,
1462        ) -> Self
1463        where
1464            T: std::convert::Into<crate::model::CommonObjectRequestParams>,
1465        {
1466            self.0.request.common_object_request_params = v.map(|x| x.into());
1467            self
1468        }
1469
1470        /// Sets the value of [read_mask][crate::model::GetObjectRequest::read_mask].
1471        pub fn set_read_mask<T>(mut self, v: T) -> Self
1472        where
1473            T: std::convert::Into<wkt::FieldMask>,
1474        {
1475            self.0.request.read_mask = std::option::Option::Some(v.into());
1476            self
1477        }
1478
1479        /// Sets or clears the value of [read_mask][crate::model::GetObjectRequest::read_mask].
1480        pub fn set_or_clear_read_mask<T>(mut self, v: std::option::Option<T>) -> Self
1481        where
1482            T: std::convert::Into<wkt::FieldMask>,
1483        {
1484            self.0.request.read_mask = v.map(|x| x.into());
1485            self
1486        }
1487
1488        /// Sets the value of [restore_token][crate::model::GetObjectRequest::restore_token].
1489        pub fn set_restore_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1490            self.0.request.restore_token = v.into();
1491            self
1492        }
1493    }
1494
1495    #[doc(hidden)]
1496    impl gax::options::internal::RequestBuilder for GetObject {
1497        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1498            &mut self.0.options
1499        }
1500    }
1501
1502    /// The request builder for [StorageControl::update_object][crate::client::StorageControl::update_object] calls.
1503    ///
1504    /// # Example
1505    /// ```no_run
1506    /// # use google_cloud_storage::builder;
1507    /// use builder::storage_control::UpdateObject;
1508    /// # tokio_test::block_on(async {
1509    ///
1510    /// let builder = prepare_request_builder();
1511    /// let response = builder.send().await?;
1512    /// # gax::Result::<()>::Ok(()) });
1513    ///
1514    /// fn prepare_request_builder() -> UpdateObject {
1515    ///   # panic!();
1516    ///   // ... details omitted ...
1517    /// }
1518    /// ```
1519    #[derive(Clone, Debug)]
1520    pub struct UpdateObject(RequestBuilder<crate::model::UpdateObjectRequest>);
1521
1522    impl UpdateObject {
1523        pub(crate) fn new(
1524            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1525        ) -> Self {
1526            Self(RequestBuilder::new(stub))
1527        }
1528
1529        /// Sets the full request, replacing any prior values.
1530        pub fn with_request<V: Into<crate::model::UpdateObjectRequest>>(mut self, v: V) -> Self {
1531            self.0.request = v.into();
1532            self
1533        }
1534
1535        /// Sets all the options, replacing any prior values.
1536        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1537            self.0.options = v.into();
1538            self
1539        }
1540
1541        /// Sends the request.
1542        pub async fn send(self) -> Result<crate::model::Object> {
1543            (*self.0.stub)
1544                .update_object(self.0.request, self.0.options)
1545                .await
1546                .map(gax::response::Response::into_body)
1547        }
1548
1549        /// Sets the value of [object][crate::model::UpdateObjectRequest::object].
1550        ///
1551        /// This is a **required** field for requests.
1552        pub fn set_object<T>(mut self, v: T) -> Self
1553        where
1554            T: std::convert::Into<crate::model::Object>,
1555        {
1556            self.0.request.object = std::option::Option::Some(v.into());
1557            self
1558        }
1559
1560        /// Sets or clears the value of [object][crate::model::UpdateObjectRequest::object].
1561        ///
1562        /// This is a **required** field for requests.
1563        pub fn set_or_clear_object<T>(mut self, v: std::option::Option<T>) -> Self
1564        where
1565            T: std::convert::Into<crate::model::Object>,
1566        {
1567            self.0.request.object = v.map(|x| x.into());
1568            self
1569        }
1570
1571        /// Sets the value of [if_generation_match][crate::model::UpdateObjectRequest::if_generation_match].
1572        pub fn set_if_generation_match<T>(mut self, v: T) -> Self
1573        where
1574            T: std::convert::Into<i64>,
1575        {
1576            self.0.request.if_generation_match = std::option::Option::Some(v.into());
1577            self
1578        }
1579
1580        /// Sets or clears the value of [if_generation_match][crate::model::UpdateObjectRequest::if_generation_match].
1581        pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
1582        where
1583            T: std::convert::Into<i64>,
1584        {
1585            self.0.request.if_generation_match = v.map(|x| x.into());
1586            self
1587        }
1588
1589        /// Sets the value of [if_generation_not_match][crate::model::UpdateObjectRequest::if_generation_not_match].
1590        pub fn set_if_generation_not_match<T>(mut self, v: T) -> Self
1591        where
1592            T: std::convert::Into<i64>,
1593        {
1594            self.0.request.if_generation_not_match = std::option::Option::Some(v.into());
1595            self
1596        }
1597
1598        /// Sets or clears the value of [if_generation_not_match][crate::model::UpdateObjectRequest::if_generation_not_match].
1599        pub fn set_or_clear_if_generation_not_match<T>(mut self, v: std::option::Option<T>) -> Self
1600        where
1601            T: std::convert::Into<i64>,
1602        {
1603            self.0.request.if_generation_not_match = v.map(|x| x.into());
1604            self
1605        }
1606
1607        /// Sets the value of [if_metageneration_match][crate::model::UpdateObjectRequest::if_metageneration_match].
1608        pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
1609        where
1610            T: std::convert::Into<i64>,
1611        {
1612            self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
1613            self
1614        }
1615
1616        /// Sets or clears the value of [if_metageneration_match][crate::model::UpdateObjectRequest::if_metageneration_match].
1617        pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
1618        where
1619            T: std::convert::Into<i64>,
1620        {
1621            self.0.request.if_metageneration_match = v.map(|x| x.into());
1622            self
1623        }
1624
1625        /// Sets the value of [if_metageneration_not_match][crate::model::UpdateObjectRequest::if_metageneration_not_match].
1626        pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
1627        where
1628            T: std::convert::Into<i64>,
1629        {
1630            self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
1631            self
1632        }
1633
1634        /// Sets or clears the value of [if_metageneration_not_match][crate::model::UpdateObjectRequest::if_metageneration_not_match].
1635        pub fn set_or_clear_if_metageneration_not_match<T>(
1636            mut self,
1637            v: std::option::Option<T>,
1638        ) -> Self
1639        where
1640            T: std::convert::Into<i64>,
1641        {
1642            self.0.request.if_metageneration_not_match = v.map(|x| x.into());
1643            self
1644        }
1645
1646        /// Sets the value of [predefined_acl][crate::model::UpdateObjectRequest::predefined_acl].
1647        pub fn set_predefined_acl<T: Into<std::string::String>>(mut self, v: T) -> Self {
1648            self.0.request.predefined_acl = v.into();
1649            self
1650        }
1651
1652        /// Sets the value of [update_mask][crate::model::UpdateObjectRequest::update_mask].
1653        ///
1654        /// This is a **required** field for requests.
1655        pub fn set_update_mask<T>(mut self, v: T) -> Self
1656        where
1657            T: std::convert::Into<wkt::FieldMask>,
1658        {
1659            self.0.request.update_mask = std::option::Option::Some(v.into());
1660            self
1661        }
1662
1663        /// Sets or clears the value of [update_mask][crate::model::UpdateObjectRequest::update_mask].
1664        ///
1665        /// This is a **required** field for requests.
1666        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1667        where
1668            T: std::convert::Into<wkt::FieldMask>,
1669        {
1670            self.0.request.update_mask = v.map(|x| x.into());
1671            self
1672        }
1673
1674        /// Sets the value of [common_object_request_params][crate::model::UpdateObjectRequest::common_object_request_params].
1675        pub fn set_common_object_request_params<T>(mut self, v: T) -> Self
1676        where
1677            T: std::convert::Into<crate::model::CommonObjectRequestParams>,
1678        {
1679            self.0.request.common_object_request_params = std::option::Option::Some(v.into());
1680            self
1681        }
1682
1683        /// Sets or clears the value of [common_object_request_params][crate::model::UpdateObjectRequest::common_object_request_params].
1684        pub fn set_or_clear_common_object_request_params<T>(
1685            mut self,
1686            v: std::option::Option<T>,
1687        ) -> Self
1688        where
1689            T: std::convert::Into<crate::model::CommonObjectRequestParams>,
1690        {
1691            self.0.request.common_object_request_params = v.map(|x| x.into());
1692            self
1693        }
1694
1695        /// Sets the value of [override_unlocked_retention][crate::model::UpdateObjectRequest::override_unlocked_retention].
1696        pub fn set_override_unlocked_retention<T: Into<bool>>(mut self, v: T) -> Self {
1697            self.0.request.override_unlocked_retention = v.into();
1698            self
1699        }
1700    }
1701
1702    #[doc(hidden)]
1703    impl gax::options::internal::RequestBuilder for UpdateObject {
1704        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1705            &mut self.0.options
1706        }
1707    }
1708
1709    /// The request builder for [StorageControl::list_objects][crate::client::StorageControl::list_objects] calls.
1710    ///
1711    /// # Example
1712    /// ```no_run
1713    /// # use google_cloud_storage::builder;
1714    /// use builder::storage_control::ListObjects;
1715    /// # tokio_test::block_on(async {
1716    /// use gax::paginator::ItemPaginator;
1717    ///
1718    /// let builder = prepare_request_builder();
1719    /// let mut items = builder.by_item();
1720    /// while let Some(result) = items.next().await {
1721    ///   let item = result?;
1722    /// }
1723    /// # gax::Result::<()>::Ok(()) });
1724    ///
1725    /// fn prepare_request_builder() -> ListObjects {
1726    ///   # panic!();
1727    ///   // ... details omitted ...
1728    /// }
1729    /// ```
1730    #[derive(Clone, Debug)]
1731    pub struct ListObjects(RequestBuilder<crate::model::ListObjectsRequest>);
1732
1733    impl ListObjects {
1734        pub(crate) fn new(
1735            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1736        ) -> Self {
1737            Self(RequestBuilder::new(stub))
1738        }
1739
1740        /// Sets the full request, replacing any prior values.
1741        pub fn with_request<V: Into<crate::model::ListObjectsRequest>>(mut self, v: V) -> Self {
1742            self.0.request = v.into();
1743            self
1744        }
1745
1746        /// Sets all the options, replacing any prior values.
1747        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1748            self.0.options = v.into();
1749            self
1750        }
1751
1752        /// Sends the request.
1753        pub async fn send(self) -> Result<crate::model::ListObjectsResponse> {
1754            (*self.0.stub)
1755                .list_objects(self.0.request, self.0.options)
1756                .await
1757                .map(gax::response::Response::into_body)
1758        }
1759
1760        /// Streams each page in the collection.
1761        pub fn by_page(
1762            self,
1763        ) -> impl gax::paginator::Paginator<crate::model::ListObjectsResponse, gax::error::Error>
1764        {
1765            use std::clone::Clone;
1766            let token = self.0.request.page_token.clone();
1767            let execute = move |token: String| {
1768                let mut builder = self.clone();
1769                builder.0.request = builder.0.request.set_page_token(token);
1770                builder.send()
1771            };
1772            gax::paginator::internal::new_paginator(token, execute)
1773        }
1774
1775        /// Streams each item in the collection.
1776        pub fn by_item(
1777            self,
1778        ) -> impl gax::paginator::ItemPaginator<crate::model::ListObjectsResponse, gax::error::Error>
1779        {
1780            use gax::paginator::Paginator;
1781            self.by_page().items()
1782        }
1783
1784        /// Sets the value of [parent][crate::model::ListObjectsRequest::parent].
1785        ///
1786        /// This is a **required** field for requests.
1787        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1788            self.0.request.parent = v.into();
1789            self
1790        }
1791
1792        /// Sets the value of [page_size][crate::model::ListObjectsRequest::page_size].
1793        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1794            self.0.request.page_size = v.into();
1795            self
1796        }
1797
1798        /// Sets the value of [page_token][crate::model::ListObjectsRequest::page_token].
1799        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1800            self.0.request.page_token = v.into();
1801            self
1802        }
1803
1804        /// Sets the value of [delimiter][crate::model::ListObjectsRequest::delimiter].
1805        pub fn set_delimiter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1806            self.0.request.delimiter = v.into();
1807            self
1808        }
1809
1810        /// Sets the value of [include_trailing_delimiter][crate::model::ListObjectsRequest::include_trailing_delimiter].
1811        pub fn set_include_trailing_delimiter<T: Into<bool>>(mut self, v: T) -> Self {
1812            self.0.request.include_trailing_delimiter = v.into();
1813            self
1814        }
1815
1816        /// Sets the value of [prefix][crate::model::ListObjectsRequest::prefix].
1817        pub fn set_prefix<T: Into<std::string::String>>(mut self, v: T) -> Self {
1818            self.0.request.prefix = v.into();
1819            self
1820        }
1821
1822        /// Sets the value of [versions][crate::model::ListObjectsRequest::versions].
1823        pub fn set_versions<T: Into<bool>>(mut self, v: T) -> Self {
1824            self.0.request.versions = v.into();
1825            self
1826        }
1827
1828        /// Sets the value of [read_mask][crate::model::ListObjectsRequest::read_mask].
1829        pub fn set_read_mask<T>(mut self, v: T) -> Self
1830        where
1831            T: std::convert::Into<wkt::FieldMask>,
1832        {
1833            self.0.request.read_mask = std::option::Option::Some(v.into());
1834            self
1835        }
1836
1837        /// Sets or clears the value of [read_mask][crate::model::ListObjectsRequest::read_mask].
1838        pub fn set_or_clear_read_mask<T>(mut self, v: std::option::Option<T>) -> Self
1839        where
1840            T: std::convert::Into<wkt::FieldMask>,
1841        {
1842            self.0.request.read_mask = v.map(|x| x.into());
1843            self
1844        }
1845
1846        /// Sets the value of [lexicographic_start][crate::model::ListObjectsRequest::lexicographic_start].
1847        pub fn set_lexicographic_start<T: Into<std::string::String>>(mut self, v: T) -> Self {
1848            self.0.request.lexicographic_start = v.into();
1849            self
1850        }
1851
1852        /// Sets the value of [lexicographic_end][crate::model::ListObjectsRequest::lexicographic_end].
1853        pub fn set_lexicographic_end<T: Into<std::string::String>>(mut self, v: T) -> Self {
1854            self.0.request.lexicographic_end = v.into();
1855            self
1856        }
1857
1858        /// Sets the value of [soft_deleted][crate::model::ListObjectsRequest::soft_deleted].
1859        pub fn set_soft_deleted<T: Into<bool>>(mut self, v: T) -> Self {
1860            self.0.request.soft_deleted = v.into();
1861            self
1862        }
1863
1864        /// Sets the value of [include_folders_as_prefixes][crate::model::ListObjectsRequest::include_folders_as_prefixes].
1865        pub fn set_include_folders_as_prefixes<T: Into<bool>>(mut self, v: T) -> Self {
1866            self.0.request.include_folders_as_prefixes = v.into();
1867            self
1868        }
1869
1870        /// Sets the value of [match_glob][crate::model::ListObjectsRequest::match_glob].
1871        pub fn set_match_glob<T: Into<std::string::String>>(mut self, v: T) -> Self {
1872            self.0.request.match_glob = v.into();
1873            self
1874        }
1875
1876        /// Sets the value of [filter][crate::model::ListObjectsRequest::filter].
1877        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1878            self.0.request.filter = v.into();
1879            self
1880        }
1881    }
1882
1883    #[doc(hidden)]
1884    impl gax::options::internal::RequestBuilder for ListObjects {
1885        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1886            &mut self.0.options
1887        }
1888    }
1889
1890    /// The request builder for [StorageControl::rewrite_object][crate::client::StorageControl::rewrite_object] calls.
1891    ///
1892    /// # Example
1893    /// ```no_run
1894    /// # use google_cloud_storage::builder;
1895    /// use builder::storage_control::RewriteObject;
1896    /// # tokio_test::block_on(async {
1897    ///
1898    /// let builder = prepare_request_builder();
1899    /// let response = builder.send().await?;
1900    /// # gax::Result::<()>::Ok(()) });
1901    ///
1902    /// fn prepare_request_builder() -> RewriteObject {
1903    ///   # panic!();
1904    ///   // ... details omitted ...
1905    /// }
1906    /// ```
1907    #[derive(Clone, Debug)]
1908    pub struct RewriteObject(RequestBuilder<crate::model::RewriteObjectRequest>);
1909
1910    impl RewriteObject {
1911        pub(crate) fn new(
1912            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1913        ) -> Self {
1914            Self(RequestBuilder::new(stub))
1915        }
1916
1917        /// Sets the full request, replacing any prior values.
1918        pub fn with_request<V: Into<crate::model::RewriteObjectRequest>>(mut self, v: V) -> Self {
1919            self.0.request = v.into();
1920            self
1921        }
1922
1923        /// Sets all the options, replacing any prior values.
1924        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1925            self.0.options = v.into();
1926            self
1927        }
1928
1929        /// Sends the request.
1930        pub async fn send(self) -> Result<crate::model::RewriteResponse> {
1931            (*self.0.stub)
1932                .rewrite_object(self.0.request, self.0.options)
1933                .await
1934                .map(gax::response::Response::into_body)
1935        }
1936
1937        /// Sets the value of [destination_name][crate::model::RewriteObjectRequest::destination_name].
1938        ///
1939        /// This is a **required** field for requests.
1940        pub fn set_destination_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1941            self.0.request.destination_name = v.into();
1942            self
1943        }
1944
1945        /// Sets the value of [destination_bucket][crate::model::RewriteObjectRequest::destination_bucket].
1946        ///
1947        /// This is a **required** field for requests.
1948        pub fn set_destination_bucket<T: Into<std::string::String>>(mut self, v: T) -> Self {
1949            self.0.request.destination_bucket = v.into();
1950            self
1951        }
1952
1953        /// Sets the value of [destination_kms_key][crate::model::RewriteObjectRequest::destination_kms_key].
1954        pub fn set_destination_kms_key<T: Into<std::string::String>>(mut self, v: T) -> Self {
1955            self.0.request.destination_kms_key = v.into();
1956            self
1957        }
1958
1959        /// Sets the value of [destination][crate::model::RewriteObjectRequest::destination].
1960        pub fn set_destination<T>(mut self, v: T) -> Self
1961        where
1962            T: std::convert::Into<crate::model::Object>,
1963        {
1964            self.0.request.destination = std::option::Option::Some(v.into());
1965            self
1966        }
1967
1968        /// Sets or clears the value of [destination][crate::model::RewriteObjectRequest::destination].
1969        pub fn set_or_clear_destination<T>(mut self, v: std::option::Option<T>) -> Self
1970        where
1971            T: std::convert::Into<crate::model::Object>,
1972        {
1973            self.0.request.destination = v.map(|x| x.into());
1974            self
1975        }
1976
1977        /// Sets the value of [source_bucket][crate::model::RewriteObjectRequest::source_bucket].
1978        ///
1979        /// This is a **required** field for requests.
1980        pub fn set_source_bucket<T: Into<std::string::String>>(mut self, v: T) -> Self {
1981            self.0.request.source_bucket = v.into();
1982            self
1983        }
1984
1985        /// Sets the value of [source_object][crate::model::RewriteObjectRequest::source_object].
1986        ///
1987        /// This is a **required** field for requests.
1988        pub fn set_source_object<T: Into<std::string::String>>(mut self, v: T) -> Self {
1989            self.0.request.source_object = v.into();
1990            self
1991        }
1992
1993        /// Sets the value of [source_generation][crate::model::RewriteObjectRequest::source_generation].
1994        pub fn set_source_generation<T: Into<i64>>(mut self, v: T) -> Self {
1995            self.0.request.source_generation = v.into();
1996            self
1997        }
1998
1999        /// Sets the value of [rewrite_token][crate::model::RewriteObjectRequest::rewrite_token].
2000        pub fn set_rewrite_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2001            self.0.request.rewrite_token = v.into();
2002            self
2003        }
2004
2005        /// Sets the value of [destination_predefined_acl][crate::model::RewriteObjectRequest::destination_predefined_acl].
2006        pub fn set_destination_predefined_acl<T: Into<std::string::String>>(
2007            mut self,
2008            v: T,
2009        ) -> Self {
2010            self.0.request.destination_predefined_acl = v.into();
2011            self
2012        }
2013
2014        /// Sets the value of [if_generation_match][crate::model::RewriteObjectRequest::if_generation_match].
2015        pub fn set_if_generation_match<T>(mut self, v: T) -> Self
2016        where
2017            T: std::convert::Into<i64>,
2018        {
2019            self.0.request.if_generation_match = std::option::Option::Some(v.into());
2020            self
2021        }
2022
2023        /// Sets or clears the value of [if_generation_match][crate::model::RewriteObjectRequest::if_generation_match].
2024        pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
2025        where
2026            T: std::convert::Into<i64>,
2027        {
2028            self.0.request.if_generation_match = v.map(|x| x.into());
2029            self
2030        }
2031
2032        /// Sets the value of [if_generation_not_match][crate::model::RewriteObjectRequest::if_generation_not_match].
2033        pub fn set_if_generation_not_match<T>(mut self, v: T) -> Self
2034        where
2035            T: std::convert::Into<i64>,
2036        {
2037            self.0.request.if_generation_not_match = std::option::Option::Some(v.into());
2038            self
2039        }
2040
2041        /// Sets or clears the value of [if_generation_not_match][crate::model::RewriteObjectRequest::if_generation_not_match].
2042        pub fn set_or_clear_if_generation_not_match<T>(mut self, v: std::option::Option<T>) -> Self
2043        where
2044            T: std::convert::Into<i64>,
2045        {
2046            self.0.request.if_generation_not_match = v.map(|x| x.into());
2047            self
2048        }
2049
2050        /// Sets the value of [if_metageneration_match][crate::model::RewriteObjectRequest::if_metageneration_match].
2051        pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
2052        where
2053            T: std::convert::Into<i64>,
2054        {
2055            self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
2056            self
2057        }
2058
2059        /// Sets or clears the value of [if_metageneration_match][crate::model::RewriteObjectRequest::if_metageneration_match].
2060        pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
2061        where
2062            T: std::convert::Into<i64>,
2063        {
2064            self.0.request.if_metageneration_match = v.map(|x| x.into());
2065            self
2066        }
2067
2068        /// Sets the value of [if_metageneration_not_match][crate::model::RewriteObjectRequest::if_metageneration_not_match].
2069        pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
2070        where
2071            T: std::convert::Into<i64>,
2072        {
2073            self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
2074            self
2075        }
2076
2077        /// Sets or clears the value of [if_metageneration_not_match][crate::model::RewriteObjectRequest::if_metageneration_not_match].
2078        pub fn set_or_clear_if_metageneration_not_match<T>(
2079            mut self,
2080            v: std::option::Option<T>,
2081        ) -> Self
2082        where
2083            T: std::convert::Into<i64>,
2084        {
2085            self.0.request.if_metageneration_not_match = v.map(|x| x.into());
2086            self
2087        }
2088
2089        /// Sets the value of [if_source_generation_match][crate::model::RewriteObjectRequest::if_source_generation_match].
2090        pub fn set_if_source_generation_match<T>(mut self, v: T) -> Self
2091        where
2092            T: std::convert::Into<i64>,
2093        {
2094            self.0.request.if_source_generation_match = std::option::Option::Some(v.into());
2095            self
2096        }
2097
2098        /// Sets or clears the value of [if_source_generation_match][crate::model::RewriteObjectRequest::if_source_generation_match].
2099        pub fn set_or_clear_if_source_generation_match<T>(
2100            mut self,
2101            v: std::option::Option<T>,
2102        ) -> Self
2103        where
2104            T: std::convert::Into<i64>,
2105        {
2106            self.0.request.if_source_generation_match = v.map(|x| x.into());
2107            self
2108        }
2109
2110        /// Sets the value of [if_source_generation_not_match][crate::model::RewriteObjectRequest::if_source_generation_not_match].
2111        pub fn set_if_source_generation_not_match<T>(mut self, v: T) -> Self
2112        where
2113            T: std::convert::Into<i64>,
2114        {
2115            self.0.request.if_source_generation_not_match = std::option::Option::Some(v.into());
2116            self
2117        }
2118
2119        /// Sets or clears the value of [if_source_generation_not_match][crate::model::RewriteObjectRequest::if_source_generation_not_match].
2120        pub fn set_or_clear_if_source_generation_not_match<T>(
2121            mut self,
2122            v: std::option::Option<T>,
2123        ) -> Self
2124        where
2125            T: std::convert::Into<i64>,
2126        {
2127            self.0.request.if_source_generation_not_match = v.map(|x| x.into());
2128            self
2129        }
2130
2131        /// Sets the value of [if_source_metageneration_match][crate::model::RewriteObjectRequest::if_source_metageneration_match].
2132        pub fn set_if_source_metageneration_match<T>(mut self, v: T) -> Self
2133        where
2134            T: std::convert::Into<i64>,
2135        {
2136            self.0.request.if_source_metageneration_match = std::option::Option::Some(v.into());
2137            self
2138        }
2139
2140        /// Sets or clears the value of [if_source_metageneration_match][crate::model::RewriteObjectRequest::if_source_metageneration_match].
2141        pub fn set_or_clear_if_source_metageneration_match<T>(
2142            mut self,
2143            v: std::option::Option<T>,
2144        ) -> Self
2145        where
2146            T: std::convert::Into<i64>,
2147        {
2148            self.0.request.if_source_metageneration_match = v.map(|x| x.into());
2149            self
2150        }
2151
2152        /// Sets the value of [if_source_metageneration_not_match][crate::model::RewriteObjectRequest::if_source_metageneration_not_match].
2153        pub fn set_if_source_metageneration_not_match<T>(mut self, v: T) -> Self
2154        where
2155            T: std::convert::Into<i64>,
2156        {
2157            self.0.request.if_source_metageneration_not_match = std::option::Option::Some(v.into());
2158            self
2159        }
2160
2161        /// Sets or clears the value of [if_source_metageneration_not_match][crate::model::RewriteObjectRequest::if_source_metageneration_not_match].
2162        pub fn set_or_clear_if_source_metageneration_not_match<T>(
2163            mut self,
2164            v: std::option::Option<T>,
2165        ) -> Self
2166        where
2167            T: std::convert::Into<i64>,
2168        {
2169            self.0.request.if_source_metageneration_not_match = v.map(|x| x.into());
2170            self
2171        }
2172
2173        /// Sets the value of [max_bytes_rewritten_per_call][crate::model::RewriteObjectRequest::max_bytes_rewritten_per_call].
2174        pub fn set_max_bytes_rewritten_per_call<T: Into<i64>>(mut self, v: T) -> Self {
2175            self.0.request.max_bytes_rewritten_per_call = v.into();
2176            self
2177        }
2178
2179        /// Sets the value of [copy_source_encryption_algorithm][crate::model::RewriteObjectRequest::copy_source_encryption_algorithm].
2180        pub fn set_copy_source_encryption_algorithm<T: Into<std::string::String>>(
2181            mut self,
2182            v: T,
2183        ) -> Self {
2184            self.0.request.copy_source_encryption_algorithm = v.into();
2185            self
2186        }
2187
2188        /// Sets the value of [copy_source_encryption_key_bytes][crate::model::RewriteObjectRequest::copy_source_encryption_key_bytes].
2189        pub fn set_copy_source_encryption_key_bytes<T: Into<::bytes::Bytes>>(
2190            mut self,
2191            v: T,
2192        ) -> Self {
2193            self.0.request.copy_source_encryption_key_bytes = v.into();
2194            self
2195        }
2196
2197        /// Sets the value of [copy_source_encryption_key_sha256_bytes][crate::model::RewriteObjectRequest::copy_source_encryption_key_sha256_bytes].
2198        pub fn set_copy_source_encryption_key_sha256_bytes<T: Into<::bytes::Bytes>>(
2199            mut self,
2200            v: T,
2201        ) -> Self {
2202            self.0.request.copy_source_encryption_key_sha256_bytes = v.into();
2203            self
2204        }
2205
2206        /// Sets the value of [common_object_request_params][crate::model::RewriteObjectRequest::common_object_request_params].
2207        pub fn set_common_object_request_params<T>(mut self, v: T) -> Self
2208        where
2209            T: std::convert::Into<crate::model::CommonObjectRequestParams>,
2210        {
2211            self.0.request.common_object_request_params = std::option::Option::Some(v.into());
2212            self
2213        }
2214
2215        /// Sets or clears the value of [common_object_request_params][crate::model::RewriteObjectRequest::common_object_request_params].
2216        pub fn set_or_clear_common_object_request_params<T>(
2217            mut self,
2218            v: std::option::Option<T>,
2219        ) -> Self
2220        where
2221            T: std::convert::Into<crate::model::CommonObjectRequestParams>,
2222        {
2223            self.0.request.common_object_request_params = v.map(|x| x.into());
2224            self
2225        }
2226
2227        /// Sets the value of [object_checksums][crate::model::RewriteObjectRequest::object_checksums].
2228        pub fn set_object_checksums<T>(mut self, v: T) -> Self
2229        where
2230            T: std::convert::Into<crate::model::ObjectChecksums>,
2231        {
2232            self.0.request.object_checksums = std::option::Option::Some(v.into());
2233            self
2234        }
2235
2236        /// Sets or clears the value of [object_checksums][crate::model::RewriteObjectRequest::object_checksums].
2237        pub fn set_or_clear_object_checksums<T>(mut self, v: std::option::Option<T>) -> Self
2238        where
2239            T: std::convert::Into<crate::model::ObjectChecksums>,
2240        {
2241            self.0.request.object_checksums = v.map(|x| x.into());
2242            self
2243        }
2244    }
2245
2246    #[doc(hidden)]
2247    impl gax::options::internal::RequestBuilder for RewriteObject {
2248        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2249            &mut self.0.options
2250        }
2251    }
2252
2253    /// The request builder for [StorageControl::move_object][crate::client::StorageControl::move_object] calls.
2254    ///
2255    /// # Example
2256    /// ```no_run
2257    /// # use google_cloud_storage::builder;
2258    /// use builder::storage_control::MoveObject;
2259    /// # tokio_test::block_on(async {
2260    ///
2261    /// let builder = prepare_request_builder();
2262    /// let response = builder.send().await?;
2263    /// # gax::Result::<()>::Ok(()) });
2264    ///
2265    /// fn prepare_request_builder() -> MoveObject {
2266    ///   # panic!();
2267    ///   // ... details omitted ...
2268    /// }
2269    /// ```
2270    #[derive(Clone, Debug)]
2271    pub struct MoveObject(RequestBuilder<crate::model::MoveObjectRequest>);
2272
2273    impl MoveObject {
2274        pub(crate) fn new(
2275            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2276        ) -> Self {
2277            Self(RequestBuilder::new(stub))
2278        }
2279
2280        /// Sets the full request, replacing any prior values.
2281        pub fn with_request<V: Into<crate::model::MoveObjectRequest>>(mut self, v: V) -> Self {
2282            self.0.request = v.into();
2283            self
2284        }
2285
2286        /// Sets all the options, replacing any prior values.
2287        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2288            self.0.options = v.into();
2289            self
2290        }
2291
2292        /// Sends the request.
2293        pub async fn send(self) -> Result<crate::model::Object> {
2294            (*self.0.stub)
2295                .move_object(self.0.request, self.0.options)
2296                .await
2297                .map(gax::response::Response::into_body)
2298        }
2299
2300        /// Sets the value of [bucket][crate::model::MoveObjectRequest::bucket].
2301        ///
2302        /// This is a **required** field for requests.
2303        pub fn set_bucket<T: Into<std::string::String>>(mut self, v: T) -> Self {
2304            self.0.request.bucket = v.into();
2305            self
2306        }
2307
2308        /// Sets the value of [source_object][crate::model::MoveObjectRequest::source_object].
2309        ///
2310        /// This is a **required** field for requests.
2311        pub fn set_source_object<T: Into<std::string::String>>(mut self, v: T) -> Self {
2312            self.0.request.source_object = v.into();
2313            self
2314        }
2315
2316        /// Sets the value of [destination_object][crate::model::MoveObjectRequest::destination_object].
2317        ///
2318        /// This is a **required** field for requests.
2319        pub fn set_destination_object<T: Into<std::string::String>>(mut self, v: T) -> Self {
2320            self.0.request.destination_object = v.into();
2321            self
2322        }
2323
2324        /// Sets the value of [if_source_generation_match][crate::model::MoveObjectRequest::if_source_generation_match].
2325        pub fn set_if_source_generation_match<T>(mut self, v: T) -> Self
2326        where
2327            T: std::convert::Into<i64>,
2328        {
2329            self.0.request.if_source_generation_match = std::option::Option::Some(v.into());
2330            self
2331        }
2332
2333        /// Sets or clears the value of [if_source_generation_match][crate::model::MoveObjectRequest::if_source_generation_match].
2334        pub fn set_or_clear_if_source_generation_match<T>(
2335            mut self,
2336            v: std::option::Option<T>,
2337        ) -> Self
2338        where
2339            T: std::convert::Into<i64>,
2340        {
2341            self.0.request.if_source_generation_match = v.map(|x| x.into());
2342            self
2343        }
2344
2345        /// Sets the value of [if_source_generation_not_match][crate::model::MoveObjectRequest::if_source_generation_not_match].
2346        pub fn set_if_source_generation_not_match<T>(mut self, v: T) -> Self
2347        where
2348            T: std::convert::Into<i64>,
2349        {
2350            self.0.request.if_source_generation_not_match = std::option::Option::Some(v.into());
2351            self
2352        }
2353
2354        /// Sets or clears the value of [if_source_generation_not_match][crate::model::MoveObjectRequest::if_source_generation_not_match].
2355        pub fn set_or_clear_if_source_generation_not_match<T>(
2356            mut self,
2357            v: std::option::Option<T>,
2358        ) -> Self
2359        where
2360            T: std::convert::Into<i64>,
2361        {
2362            self.0.request.if_source_generation_not_match = v.map(|x| x.into());
2363            self
2364        }
2365
2366        /// Sets the value of [if_source_metageneration_match][crate::model::MoveObjectRequest::if_source_metageneration_match].
2367        pub fn set_if_source_metageneration_match<T>(mut self, v: T) -> Self
2368        where
2369            T: std::convert::Into<i64>,
2370        {
2371            self.0.request.if_source_metageneration_match = std::option::Option::Some(v.into());
2372            self
2373        }
2374
2375        /// Sets or clears the value of [if_source_metageneration_match][crate::model::MoveObjectRequest::if_source_metageneration_match].
2376        pub fn set_or_clear_if_source_metageneration_match<T>(
2377            mut self,
2378            v: std::option::Option<T>,
2379        ) -> Self
2380        where
2381            T: std::convert::Into<i64>,
2382        {
2383            self.0.request.if_source_metageneration_match = v.map(|x| x.into());
2384            self
2385        }
2386
2387        /// Sets the value of [if_source_metageneration_not_match][crate::model::MoveObjectRequest::if_source_metageneration_not_match].
2388        pub fn set_if_source_metageneration_not_match<T>(mut self, v: T) -> Self
2389        where
2390            T: std::convert::Into<i64>,
2391        {
2392            self.0.request.if_source_metageneration_not_match = std::option::Option::Some(v.into());
2393            self
2394        }
2395
2396        /// Sets or clears the value of [if_source_metageneration_not_match][crate::model::MoveObjectRequest::if_source_metageneration_not_match].
2397        pub fn set_or_clear_if_source_metageneration_not_match<T>(
2398            mut self,
2399            v: std::option::Option<T>,
2400        ) -> Self
2401        where
2402            T: std::convert::Into<i64>,
2403        {
2404            self.0.request.if_source_metageneration_not_match = v.map(|x| x.into());
2405            self
2406        }
2407
2408        /// Sets the value of [if_generation_match][crate::model::MoveObjectRequest::if_generation_match].
2409        pub fn set_if_generation_match<T>(mut self, v: T) -> Self
2410        where
2411            T: std::convert::Into<i64>,
2412        {
2413            self.0.request.if_generation_match = std::option::Option::Some(v.into());
2414            self
2415        }
2416
2417        /// Sets or clears the value of [if_generation_match][crate::model::MoveObjectRequest::if_generation_match].
2418        pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
2419        where
2420            T: std::convert::Into<i64>,
2421        {
2422            self.0.request.if_generation_match = v.map(|x| x.into());
2423            self
2424        }
2425
2426        /// Sets the value of [if_generation_not_match][crate::model::MoveObjectRequest::if_generation_not_match].
2427        pub fn set_if_generation_not_match<T>(mut self, v: T) -> Self
2428        where
2429            T: std::convert::Into<i64>,
2430        {
2431            self.0.request.if_generation_not_match = std::option::Option::Some(v.into());
2432            self
2433        }
2434
2435        /// Sets or clears the value of [if_generation_not_match][crate::model::MoveObjectRequest::if_generation_not_match].
2436        pub fn set_or_clear_if_generation_not_match<T>(mut self, v: std::option::Option<T>) -> Self
2437        where
2438            T: std::convert::Into<i64>,
2439        {
2440            self.0.request.if_generation_not_match = v.map(|x| x.into());
2441            self
2442        }
2443
2444        /// Sets the value of [if_metageneration_match][crate::model::MoveObjectRequest::if_metageneration_match].
2445        pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
2446        where
2447            T: std::convert::Into<i64>,
2448        {
2449            self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
2450            self
2451        }
2452
2453        /// Sets or clears the value of [if_metageneration_match][crate::model::MoveObjectRequest::if_metageneration_match].
2454        pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
2455        where
2456            T: std::convert::Into<i64>,
2457        {
2458            self.0.request.if_metageneration_match = v.map(|x| x.into());
2459            self
2460        }
2461
2462        /// Sets the value of [if_metageneration_not_match][crate::model::MoveObjectRequest::if_metageneration_not_match].
2463        pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
2464        where
2465            T: std::convert::Into<i64>,
2466        {
2467            self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
2468            self
2469        }
2470
2471        /// Sets or clears the value of [if_metageneration_not_match][crate::model::MoveObjectRequest::if_metageneration_not_match].
2472        pub fn set_or_clear_if_metageneration_not_match<T>(
2473            mut self,
2474            v: std::option::Option<T>,
2475        ) -> Self
2476        where
2477            T: std::convert::Into<i64>,
2478        {
2479            self.0.request.if_metageneration_not_match = v.map(|x| x.into());
2480            self
2481        }
2482    }
2483
2484    #[doc(hidden)]
2485    impl gax::options::internal::RequestBuilder for MoveObject {
2486        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2487            &mut self.0.options
2488        }
2489    }
2490}