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