google_cloud_storage/generated/gapic/
builder.rs

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