Skip to main content

google_cloud_storage/generated/gapic/
builder.rs

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