google_cloud_storage/generated/gapic_control/
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::create_folder][crate::client::StorageControl::create_folder] calls.
44    ///
45    /// # Example
46    /// ```no_run
47    /// # use google_cloud_storage::builder;
48    /// use builder::storage_control::CreateFolder;
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() -> CreateFolder {
56    ///   # panic!();
57    ///   // ... details omitted ...
58    /// }
59    /// ```
60    #[derive(Clone, Debug)]
61    pub struct CreateFolder(RequestBuilder<crate::model::CreateFolderRequest>);
62
63    impl CreateFolder {
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::CreateFolderRequest>>(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<crate::model::Folder> {
84            let req = Self::auto_populate(self.0.request, false);
85            (*self.0.stub)
86                .create_folder(req, self.0.options)
87                .await
88                .map(gax::response::Response::into_body)
89        }
90
91        fn auto_populate(
92            mut req: crate::model::CreateFolderRequest,
93            force: bool,
94        ) -> crate::model::CreateFolderRequest {
95            if force || req.request_id.is_empty() {
96                req = req.set_request_id(uuid::Uuid::new_v4().to_string())
97            }
98            req
99        }
100
101        /// Sets the value of [parent][crate::model::CreateFolderRequest::parent].
102        ///
103        /// This is a **required** field for requests.
104        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
105            self.0.request.parent = v.into();
106            self
107        }
108
109        /// Sets the value of [folder][crate::model::CreateFolderRequest::folder].
110        ///
111        /// This is a **required** field for requests.
112        pub fn set_folder<T>(mut self, v: T) -> Self
113        where
114            T: std::convert::Into<crate::model::Folder>,
115        {
116            self.0.request.folder = std::option::Option::Some(v.into());
117            self
118        }
119
120        /// Sets or clears the value of [folder][crate::model::CreateFolderRequest::folder].
121        ///
122        /// This is a **required** field for requests.
123        pub fn set_or_clear_folder<T>(mut self, v: std::option::Option<T>) -> Self
124        where
125            T: std::convert::Into<crate::model::Folder>,
126        {
127            self.0.request.folder = v.map(|x| x.into());
128            self
129        }
130
131        /// Sets the value of [folder_id][crate::model::CreateFolderRequest::folder_id].
132        ///
133        /// This is a **required** field for requests.
134        pub fn set_folder_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
135            self.0.request.folder_id = v.into();
136            self
137        }
138
139        /// Sets the value of [recursive][crate::model::CreateFolderRequest::recursive].
140        pub fn set_recursive<T: Into<bool>>(mut self, v: T) -> Self {
141            self.0.request.recursive = v.into();
142            self
143        }
144
145        /// Sets the value of [request_id][crate::model::CreateFolderRequest::request_id].
146        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
147            self.0.request.request_id = v.into();
148            self
149        }
150    }
151
152    #[doc(hidden)]
153    impl gax::options::internal::RequestBuilder for CreateFolder {
154        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
155            &mut self.0.options
156        }
157    }
158
159    /// The request builder for [StorageControl::delete_folder][crate::client::StorageControl::delete_folder] calls.
160    ///
161    /// # Example
162    /// ```no_run
163    /// # use google_cloud_storage::builder;
164    /// use builder::storage_control::DeleteFolder;
165    /// # tokio_test::block_on(async {
166    ///
167    /// let builder = prepare_request_builder();
168    /// let response = builder.send().await?;
169    /// # gax::Result::<()>::Ok(()) });
170    ///
171    /// fn prepare_request_builder() -> DeleteFolder {
172    ///   # panic!();
173    ///   // ... details omitted ...
174    /// }
175    /// ```
176    #[derive(Clone, Debug)]
177    pub struct DeleteFolder(RequestBuilder<crate::model::DeleteFolderRequest>);
178
179    impl DeleteFolder {
180        pub(crate) fn new(
181            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
182        ) -> Self {
183            Self(RequestBuilder::new(stub))
184        }
185
186        /// Sets the full request, replacing any prior values.
187        pub fn with_request<V: Into<crate::model::DeleteFolderRequest>>(mut self, v: V) -> Self {
188            self.0.request = v.into();
189            self
190        }
191
192        /// Sets all the options, replacing any prior values.
193        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
194            self.0.options = v.into();
195            self
196        }
197
198        /// Sends the request.
199        pub async fn send(self) -> Result<()> {
200            let req = Self::auto_populate(self.0.request, false);
201            (*self.0.stub)
202                .delete_folder(req, self.0.options)
203                .await
204                .map(gax::response::Response::into_body)
205        }
206
207        fn auto_populate(
208            mut req: crate::model::DeleteFolderRequest,
209            force: bool,
210        ) -> crate::model::DeleteFolderRequest {
211            if force || req.request_id.is_empty() {
212                req = req.set_request_id(uuid::Uuid::new_v4().to_string())
213            }
214            req
215        }
216
217        /// Sets the value of [name][crate::model::DeleteFolderRequest::name].
218        ///
219        /// This is a **required** field for requests.
220        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
221            self.0.request.name = v.into();
222            self
223        }
224
225        /// Sets the value of [if_metageneration_match][crate::model::DeleteFolderRequest::if_metageneration_match].
226        pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
227        where
228            T: std::convert::Into<i64>,
229        {
230            self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
231            self
232        }
233
234        /// Sets or clears the value of [if_metageneration_match][crate::model::DeleteFolderRequest::if_metageneration_match].
235        pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
236        where
237            T: std::convert::Into<i64>,
238        {
239            self.0.request.if_metageneration_match = v.map(|x| x.into());
240            self
241        }
242
243        /// Sets the value of [if_metageneration_not_match][crate::model::DeleteFolderRequest::if_metageneration_not_match].
244        pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
245        where
246            T: std::convert::Into<i64>,
247        {
248            self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
249            self
250        }
251
252        /// Sets or clears the value of [if_metageneration_not_match][crate::model::DeleteFolderRequest::if_metageneration_not_match].
253        pub fn set_or_clear_if_metageneration_not_match<T>(
254            mut self,
255            v: std::option::Option<T>,
256        ) -> Self
257        where
258            T: std::convert::Into<i64>,
259        {
260            self.0.request.if_metageneration_not_match = v.map(|x| x.into());
261            self
262        }
263
264        /// Sets the value of [request_id][crate::model::DeleteFolderRequest::request_id].
265        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
266            self.0.request.request_id = v.into();
267            self
268        }
269    }
270
271    #[doc(hidden)]
272    impl gax::options::internal::RequestBuilder for DeleteFolder {
273        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
274            &mut self.0.options
275        }
276    }
277
278    /// The request builder for [StorageControl::get_folder][crate::client::StorageControl::get_folder] calls.
279    ///
280    /// # Example
281    /// ```no_run
282    /// # use google_cloud_storage::builder;
283    /// use builder::storage_control::GetFolder;
284    /// # tokio_test::block_on(async {
285    ///
286    /// let builder = prepare_request_builder();
287    /// let response = builder.send().await?;
288    /// # gax::Result::<()>::Ok(()) });
289    ///
290    /// fn prepare_request_builder() -> GetFolder {
291    ///   # panic!();
292    ///   // ... details omitted ...
293    /// }
294    /// ```
295    #[derive(Clone, Debug)]
296    pub struct GetFolder(RequestBuilder<crate::model::GetFolderRequest>);
297
298    impl GetFolder {
299        pub(crate) fn new(
300            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
301        ) -> Self {
302            Self(RequestBuilder::new(stub))
303        }
304
305        /// Sets the full request, replacing any prior values.
306        pub fn with_request<V: Into<crate::model::GetFolderRequest>>(mut self, v: V) -> Self {
307            self.0.request = v.into();
308            self
309        }
310
311        /// Sets all the options, replacing any prior values.
312        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
313            self.0.options = v.into();
314            self
315        }
316
317        /// Sends the request.
318        pub async fn send(self) -> Result<crate::model::Folder> {
319            let req = Self::auto_populate(self.0.request, false);
320            (*self.0.stub)
321                .get_folder(req, self.0.options)
322                .await
323                .map(gax::response::Response::into_body)
324        }
325
326        fn auto_populate(
327            mut req: crate::model::GetFolderRequest,
328            force: bool,
329        ) -> crate::model::GetFolderRequest {
330            if force || req.request_id.is_empty() {
331                req = req.set_request_id(uuid::Uuid::new_v4().to_string())
332            }
333            req
334        }
335
336        /// Sets the value of [name][crate::model::GetFolderRequest::name].
337        ///
338        /// This is a **required** field for requests.
339        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
340            self.0.request.name = v.into();
341            self
342        }
343
344        /// Sets the value of [if_metageneration_match][crate::model::GetFolderRequest::if_metageneration_match].
345        pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
346        where
347            T: std::convert::Into<i64>,
348        {
349            self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
350            self
351        }
352
353        /// Sets or clears the value of [if_metageneration_match][crate::model::GetFolderRequest::if_metageneration_match].
354        pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
355        where
356            T: std::convert::Into<i64>,
357        {
358            self.0.request.if_metageneration_match = v.map(|x| x.into());
359            self
360        }
361
362        /// Sets the value of [if_metageneration_not_match][crate::model::GetFolderRequest::if_metageneration_not_match].
363        pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
364        where
365            T: std::convert::Into<i64>,
366        {
367            self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
368            self
369        }
370
371        /// Sets or clears the value of [if_metageneration_not_match][crate::model::GetFolderRequest::if_metageneration_not_match].
372        pub fn set_or_clear_if_metageneration_not_match<T>(
373            mut self,
374            v: std::option::Option<T>,
375        ) -> Self
376        where
377            T: std::convert::Into<i64>,
378        {
379            self.0.request.if_metageneration_not_match = v.map(|x| x.into());
380            self
381        }
382
383        /// Sets the value of [request_id][crate::model::GetFolderRequest::request_id].
384        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
385            self.0.request.request_id = v.into();
386            self
387        }
388    }
389
390    #[doc(hidden)]
391    impl gax::options::internal::RequestBuilder for GetFolder {
392        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
393            &mut self.0.options
394        }
395    }
396
397    /// The request builder for [StorageControl::list_folders][crate::client::StorageControl::list_folders] calls.
398    ///
399    /// # Example
400    /// ```no_run
401    /// # use google_cloud_storage::builder;
402    /// use builder::storage_control::ListFolders;
403    /// # tokio_test::block_on(async {
404    /// use gax::paginator::ItemPaginator;
405    ///
406    /// let builder = prepare_request_builder();
407    /// let mut items = builder.by_item();
408    /// while let Some(result) = items.next().await {
409    ///   let item = result?;
410    /// }
411    /// # gax::Result::<()>::Ok(()) });
412    ///
413    /// fn prepare_request_builder() -> ListFolders {
414    ///   # panic!();
415    ///   // ... details omitted ...
416    /// }
417    /// ```
418    #[derive(Clone, Debug)]
419    pub struct ListFolders(RequestBuilder<crate::model::ListFoldersRequest>);
420
421    impl ListFolders {
422        pub(crate) fn new(
423            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
424        ) -> Self {
425            Self(RequestBuilder::new(stub))
426        }
427
428        /// Sets the full request, replacing any prior values.
429        pub fn with_request<V: Into<crate::model::ListFoldersRequest>>(mut self, v: V) -> Self {
430            self.0.request = v.into();
431            self
432        }
433
434        /// Sets all the options, replacing any prior values.
435        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
436            self.0.options = v.into();
437            self
438        }
439
440        /// Sends the request.
441        pub async fn send(self) -> Result<crate::model::ListFoldersResponse> {
442            (*self.0.stub)
443                .list_folders(self.0.request, self.0.options)
444                .await
445                .map(gax::response::Response::into_body)
446        }
447
448        /// Streams each page in the collection.
449        pub fn by_page(
450            self,
451        ) -> impl gax::paginator::Paginator<crate::model::ListFoldersResponse, gax::error::Error>
452        {
453            use std::clone::Clone;
454            let token = self.0.request.page_token.clone();
455            let execute = move |token: String| {
456                let mut builder = self.clone();
457                builder.0.request = builder.0.request.set_page_token(token);
458                builder.send()
459            };
460            gax::paginator::internal::new_paginator(token, execute)
461        }
462
463        /// Streams each item in the collection.
464        pub fn by_item(
465            self,
466        ) -> impl gax::paginator::ItemPaginator<crate::model::ListFoldersResponse, gax::error::Error>
467        {
468            use gax::paginator::Paginator;
469            self.by_page().items()
470        }
471
472        /// Sets the value of [parent][crate::model::ListFoldersRequest::parent].
473        ///
474        /// This is a **required** field for requests.
475        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
476            self.0.request.parent = v.into();
477            self
478        }
479
480        /// Sets the value of [page_size][crate::model::ListFoldersRequest::page_size].
481        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
482            self.0.request.page_size = v.into();
483            self
484        }
485
486        /// Sets the value of [page_token][crate::model::ListFoldersRequest::page_token].
487        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
488            self.0.request.page_token = v.into();
489            self
490        }
491
492        /// Sets the value of [prefix][crate::model::ListFoldersRequest::prefix].
493        pub fn set_prefix<T: Into<std::string::String>>(mut self, v: T) -> Self {
494            self.0.request.prefix = v.into();
495            self
496        }
497
498        /// Sets the value of [delimiter][crate::model::ListFoldersRequest::delimiter].
499        pub fn set_delimiter<T: Into<std::string::String>>(mut self, v: T) -> Self {
500            self.0.request.delimiter = v.into();
501            self
502        }
503
504        /// Sets the value of [lexicographic_start][crate::model::ListFoldersRequest::lexicographic_start].
505        pub fn set_lexicographic_start<T: Into<std::string::String>>(mut self, v: T) -> Self {
506            self.0.request.lexicographic_start = v.into();
507            self
508        }
509
510        /// Sets the value of [lexicographic_end][crate::model::ListFoldersRequest::lexicographic_end].
511        pub fn set_lexicographic_end<T: Into<std::string::String>>(mut self, v: T) -> Self {
512            self.0.request.lexicographic_end = v.into();
513            self
514        }
515
516        /// Sets the value of [request_id][crate::model::ListFoldersRequest::request_id].
517        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
518            self.0.request.request_id = v.into();
519            self
520        }
521    }
522
523    #[doc(hidden)]
524    impl gax::options::internal::RequestBuilder for ListFolders {
525        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
526            &mut self.0.options
527        }
528    }
529
530    /// The request builder for [StorageControl::rename_folder][crate::client::StorageControl::rename_folder] calls.
531    ///
532    /// # Example
533    /// ```no_run
534    /// # use google_cloud_storage::builder;
535    /// use builder::storage_control::RenameFolder;
536    /// # tokio_test::block_on(async {
537    /// use lro::Poller;
538    ///
539    /// let builder = prepare_request_builder();
540    /// let response = builder.poller().until_done().await?;
541    /// # gax::Result::<()>::Ok(()) });
542    ///
543    /// fn prepare_request_builder() -> RenameFolder {
544    ///   # panic!();
545    ///   // ... details omitted ...
546    /// }
547    /// ```
548    #[derive(Clone, Debug)]
549    pub struct RenameFolder(RequestBuilder<crate::model::RenameFolderRequest>);
550
551    impl RenameFolder {
552        pub(crate) fn new(
553            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
554        ) -> Self {
555            Self(RequestBuilder::new(stub))
556        }
557
558        /// Sets the full request, replacing any prior values.
559        pub fn with_request<V: Into<crate::model::RenameFolderRequest>>(mut self, v: V) -> Self {
560            self.0.request = v.into();
561            self
562        }
563
564        /// Sets all the options, replacing any prior values.
565        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
566            self.0.options = v.into();
567            self
568        }
569
570        /// Sends the request.
571        ///
572        /// # Long running operations
573        ///
574        /// This starts, but does not poll, a longrunning operation. More information
575        /// on [rename_folder][crate::client::StorageControl::rename_folder].
576        pub async fn send(self) -> Result<longrunning::model::Operation> {
577            let req = Self::auto_populate(self.0.request, false);
578            (*self.0.stub)
579                .rename_folder(req, self.0.options)
580                .await
581                .map(gax::response::Response::into_body)
582        }
583
584        /// Creates a [Poller][lro::Poller] to work with `rename_folder`.
585        pub fn poller(
586            self,
587        ) -> impl lro::Poller<crate::model::Folder, crate::model::RenameFolderMetadata> {
588            type Operation =
589                lro::internal::Operation<crate::model::Folder, crate::model::RenameFolderMetadata>;
590            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
591            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
592
593            let stub = self.0.stub.clone();
594            let mut options = self.0.options.clone();
595            options.set_retry_policy(gax::retry_policy::NeverRetry);
596            let query = move |name| {
597                let stub = stub.clone();
598                let options = options.clone();
599                async {
600                    let op = GetOperation::new(stub)
601                        .set_name(name)
602                        .with_options(options)
603                        .send()
604                        .await?;
605                    Ok(Operation::new(op))
606                }
607            };
608
609            let start = move || async {
610                let op = self.send().await?;
611                Ok(Operation::new(op))
612            };
613
614            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
615        }
616
617        fn auto_populate(
618            mut req: crate::model::RenameFolderRequest,
619            force: bool,
620        ) -> crate::model::RenameFolderRequest {
621            if force || req.request_id.is_empty() {
622                req = req.set_request_id(uuid::Uuid::new_v4().to_string())
623            }
624            req
625        }
626
627        /// Sets the value of [name][crate::model::RenameFolderRequest::name].
628        ///
629        /// This is a **required** field for requests.
630        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
631            self.0.request.name = v.into();
632            self
633        }
634
635        /// Sets the value of [destination_folder_id][crate::model::RenameFolderRequest::destination_folder_id].
636        ///
637        /// This is a **required** field for requests.
638        pub fn set_destination_folder_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
639            self.0.request.destination_folder_id = v.into();
640            self
641        }
642
643        /// Sets the value of [if_metageneration_match][crate::model::RenameFolderRequest::if_metageneration_match].
644        pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
645        where
646            T: std::convert::Into<i64>,
647        {
648            self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
649            self
650        }
651
652        /// Sets or clears the value of [if_metageneration_match][crate::model::RenameFolderRequest::if_metageneration_match].
653        pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
654        where
655            T: std::convert::Into<i64>,
656        {
657            self.0.request.if_metageneration_match = v.map(|x| x.into());
658            self
659        }
660
661        /// Sets the value of [if_metageneration_not_match][crate::model::RenameFolderRequest::if_metageneration_not_match].
662        pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
663        where
664            T: std::convert::Into<i64>,
665        {
666            self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
667            self
668        }
669
670        /// Sets or clears the value of [if_metageneration_not_match][crate::model::RenameFolderRequest::if_metageneration_not_match].
671        pub fn set_or_clear_if_metageneration_not_match<T>(
672            mut self,
673            v: std::option::Option<T>,
674        ) -> Self
675        where
676            T: std::convert::Into<i64>,
677        {
678            self.0.request.if_metageneration_not_match = v.map(|x| x.into());
679            self
680        }
681
682        /// Sets the value of [request_id][crate::model::RenameFolderRequest::request_id].
683        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
684            self.0.request.request_id = v.into();
685            self
686        }
687    }
688
689    #[doc(hidden)]
690    impl gax::options::internal::RequestBuilder for RenameFolder {
691        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
692            &mut self.0.options
693        }
694    }
695
696    /// The request builder for [StorageControl::get_storage_layout][crate::client::StorageControl::get_storage_layout] calls.
697    ///
698    /// # Example
699    /// ```no_run
700    /// # use google_cloud_storage::builder;
701    /// use builder::storage_control::GetStorageLayout;
702    /// # tokio_test::block_on(async {
703    ///
704    /// let builder = prepare_request_builder();
705    /// let response = builder.send().await?;
706    /// # gax::Result::<()>::Ok(()) });
707    ///
708    /// fn prepare_request_builder() -> GetStorageLayout {
709    ///   # panic!();
710    ///   // ... details omitted ...
711    /// }
712    /// ```
713    #[derive(Clone, Debug)]
714    pub struct GetStorageLayout(RequestBuilder<crate::model::GetStorageLayoutRequest>);
715
716    impl GetStorageLayout {
717        pub(crate) fn new(
718            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
719        ) -> Self {
720            Self(RequestBuilder::new(stub))
721        }
722
723        /// Sets the full request, replacing any prior values.
724        pub fn with_request<V: Into<crate::model::GetStorageLayoutRequest>>(
725            mut self,
726            v: V,
727        ) -> Self {
728            self.0.request = v.into();
729            self
730        }
731
732        /// Sets all the options, replacing any prior values.
733        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
734            self.0.options = v.into();
735            self
736        }
737
738        /// Sends the request.
739        pub async fn send(self) -> Result<crate::model::StorageLayout> {
740            let req = Self::auto_populate(self.0.request, false);
741            (*self.0.stub)
742                .get_storage_layout(req, self.0.options)
743                .await
744                .map(gax::response::Response::into_body)
745        }
746
747        fn auto_populate(
748            mut req: crate::model::GetStorageLayoutRequest,
749            force: bool,
750        ) -> crate::model::GetStorageLayoutRequest {
751            if force || req.request_id.is_empty() {
752                req = req.set_request_id(uuid::Uuid::new_v4().to_string())
753            }
754            req
755        }
756
757        /// Sets the value of [name][crate::model::GetStorageLayoutRequest::name].
758        ///
759        /// This is a **required** field for requests.
760        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
761            self.0.request.name = v.into();
762            self
763        }
764
765        /// Sets the value of [prefix][crate::model::GetStorageLayoutRequest::prefix].
766        pub fn set_prefix<T: Into<std::string::String>>(mut self, v: T) -> Self {
767            self.0.request.prefix = v.into();
768            self
769        }
770
771        /// Sets the value of [request_id][crate::model::GetStorageLayoutRequest::request_id].
772        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
773            self.0.request.request_id = v.into();
774            self
775        }
776    }
777
778    #[doc(hidden)]
779    impl gax::options::internal::RequestBuilder for GetStorageLayout {
780        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
781            &mut self.0.options
782        }
783    }
784
785    /// The request builder for [StorageControl::create_managed_folder][crate::client::StorageControl::create_managed_folder] calls.
786    ///
787    /// # Example
788    /// ```no_run
789    /// # use google_cloud_storage::builder;
790    /// use builder::storage_control::CreateManagedFolder;
791    /// # tokio_test::block_on(async {
792    ///
793    /// let builder = prepare_request_builder();
794    /// let response = builder.send().await?;
795    /// # gax::Result::<()>::Ok(()) });
796    ///
797    /// fn prepare_request_builder() -> CreateManagedFolder {
798    ///   # panic!();
799    ///   // ... details omitted ...
800    /// }
801    /// ```
802    #[derive(Clone, Debug)]
803    pub struct CreateManagedFolder(RequestBuilder<crate::model::CreateManagedFolderRequest>);
804
805    impl CreateManagedFolder {
806        pub(crate) fn new(
807            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
808        ) -> Self {
809            Self(RequestBuilder::new(stub))
810        }
811
812        /// Sets the full request, replacing any prior values.
813        pub fn with_request<V: Into<crate::model::CreateManagedFolderRequest>>(
814            mut self,
815            v: V,
816        ) -> Self {
817            self.0.request = v.into();
818            self
819        }
820
821        /// Sets all the options, replacing any prior values.
822        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
823            self.0.options = v.into();
824            self
825        }
826
827        /// Sends the request.
828        pub async fn send(self) -> Result<crate::model::ManagedFolder> {
829            let req = Self::auto_populate(self.0.request, false);
830            (*self.0.stub)
831                .create_managed_folder(req, self.0.options)
832                .await
833                .map(gax::response::Response::into_body)
834        }
835
836        fn auto_populate(
837            mut req: crate::model::CreateManagedFolderRequest,
838            force: bool,
839        ) -> crate::model::CreateManagedFolderRequest {
840            if force || req.request_id.is_empty() {
841                req = req.set_request_id(uuid::Uuid::new_v4().to_string())
842            }
843            req
844        }
845
846        /// Sets the value of [parent][crate::model::CreateManagedFolderRequest::parent].
847        ///
848        /// This is a **required** field for requests.
849        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
850            self.0.request.parent = v.into();
851            self
852        }
853
854        /// Sets the value of [managed_folder][crate::model::CreateManagedFolderRequest::managed_folder].
855        ///
856        /// This is a **required** field for requests.
857        pub fn set_managed_folder<T>(mut self, v: T) -> Self
858        where
859            T: std::convert::Into<crate::model::ManagedFolder>,
860        {
861            self.0.request.managed_folder = std::option::Option::Some(v.into());
862            self
863        }
864
865        /// Sets or clears the value of [managed_folder][crate::model::CreateManagedFolderRequest::managed_folder].
866        ///
867        /// This is a **required** field for requests.
868        pub fn set_or_clear_managed_folder<T>(mut self, v: std::option::Option<T>) -> Self
869        where
870            T: std::convert::Into<crate::model::ManagedFolder>,
871        {
872            self.0.request.managed_folder = v.map(|x| x.into());
873            self
874        }
875
876        /// Sets the value of [managed_folder_id][crate::model::CreateManagedFolderRequest::managed_folder_id].
877        ///
878        /// This is a **required** field for requests.
879        pub fn set_managed_folder_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
880            self.0.request.managed_folder_id = v.into();
881            self
882        }
883
884        /// Sets the value of [request_id][crate::model::CreateManagedFolderRequest::request_id].
885        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
886            self.0.request.request_id = v.into();
887            self
888        }
889    }
890
891    #[doc(hidden)]
892    impl gax::options::internal::RequestBuilder for CreateManagedFolder {
893        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
894            &mut self.0.options
895        }
896    }
897
898    /// The request builder for [StorageControl::delete_managed_folder][crate::client::StorageControl::delete_managed_folder] calls.
899    ///
900    /// # Example
901    /// ```no_run
902    /// # use google_cloud_storage::builder;
903    /// use builder::storage_control::DeleteManagedFolder;
904    /// # tokio_test::block_on(async {
905    ///
906    /// let builder = prepare_request_builder();
907    /// let response = builder.send().await?;
908    /// # gax::Result::<()>::Ok(()) });
909    ///
910    /// fn prepare_request_builder() -> DeleteManagedFolder {
911    ///   # panic!();
912    ///   // ... details omitted ...
913    /// }
914    /// ```
915    #[derive(Clone, Debug)]
916    pub struct DeleteManagedFolder(RequestBuilder<crate::model::DeleteManagedFolderRequest>);
917
918    impl DeleteManagedFolder {
919        pub(crate) fn new(
920            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
921        ) -> Self {
922            Self(RequestBuilder::new(stub))
923        }
924
925        /// Sets the full request, replacing any prior values.
926        pub fn with_request<V: Into<crate::model::DeleteManagedFolderRequest>>(
927            mut self,
928            v: V,
929        ) -> Self {
930            self.0.request = v.into();
931            self
932        }
933
934        /// Sets all the options, replacing any prior values.
935        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
936            self.0.options = v.into();
937            self
938        }
939
940        /// Sends the request.
941        pub async fn send(self) -> Result<()> {
942            let req = Self::auto_populate(self.0.request, false);
943            (*self.0.stub)
944                .delete_managed_folder(req, self.0.options)
945                .await
946                .map(gax::response::Response::into_body)
947        }
948
949        fn auto_populate(
950            mut req: crate::model::DeleteManagedFolderRequest,
951            force: bool,
952        ) -> crate::model::DeleteManagedFolderRequest {
953            if force || req.request_id.is_empty() {
954                req = req.set_request_id(uuid::Uuid::new_v4().to_string())
955            }
956            req
957        }
958
959        /// Sets the value of [name][crate::model::DeleteManagedFolderRequest::name].
960        ///
961        /// This is a **required** field for requests.
962        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
963            self.0.request.name = v.into();
964            self
965        }
966
967        /// Sets the value of [if_metageneration_match][crate::model::DeleteManagedFolderRequest::if_metageneration_match].
968        pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
969        where
970            T: std::convert::Into<i64>,
971        {
972            self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
973            self
974        }
975
976        /// Sets or clears the value of [if_metageneration_match][crate::model::DeleteManagedFolderRequest::if_metageneration_match].
977        pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
978        where
979            T: std::convert::Into<i64>,
980        {
981            self.0.request.if_metageneration_match = v.map(|x| x.into());
982            self
983        }
984
985        /// Sets the value of [if_metageneration_not_match][crate::model::DeleteManagedFolderRequest::if_metageneration_not_match].
986        pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
987        where
988            T: std::convert::Into<i64>,
989        {
990            self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
991            self
992        }
993
994        /// Sets or clears the value of [if_metageneration_not_match][crate::model::DeleteManagedFolderRequest::if_metageneration_not_match].
995        pub fn set_or_clear_if_metageneration_not_match<T>(
996            mut self,
997            v: std::option::Option<T>,
998        ) -> Self
999        where
1000            T: std::convert::Into<i64>,
1001        {
1002            self.0.request.if_metageneration_not_match = v.map(|x| x.into());
1003            self
1004        }
1005
1006        /// Sets the value of [allow_non_empty][crate::model::DeleteManagedFolderRequest::allow_non_empty].
1007        pub fn set_allow_non_empty<T: Into<bool>>(mut self, v: T) -> Self {
1008            self.0.request.allow_non_empty = v.into();
1009            self
1010        }
1011
1012        /// Sets the value of [request_id][crate::model::DeleteManagedFolderRequest::request_id].
1013        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1014            self.0.request.request_id = v.into();
1015            self
1016        }
1017    }
1018
1019    #[doc(hidden)]
1020    impl gax::options::internal::RequestBuilder for DeleteManagedFolder {
1021        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1022            &mut self.0.options
1023        }
1024    }
1025
1026    /// The request builder for [StorageControl::get_managed_folder][crate::client::StorageControl::get_managed_folder] calls.
1027    ///
1028    /// # Example
1029    /// ```no_run
1030    /// # use google_cloud_storage::builder;
1031    /// use builder::storage_control::GetManagedFolder;
1032    /// # tokio_test::block_on(async {
1033    ///
1034    /// let builder = prepare_request_builder();
1035    /// let response = builder.send().await?;
1036    /// # gax::Result::<()>::Ok(()) });
1037    ///
1038    /// fn prepare_request_builder() -> GetManagedFolder {
1039    ///   # panic!();
1040    ///   // ... details omitted ...
1041    /// }
1042    /// ```
1043    #[derive(Clone, Debug)]
1044    pub struct GetManagedFolder(RequestBuilder<crate::model::GetManagedFolderRequest>);
1045
1046    impl GetManagedFolder {
1047        pub(crate) fn new(
1048            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1049        ) -> Self {
1050            Self(RequestBuilder::new(stub))
1051        }
1052
1053        /// Sets the full request, replacing any prior values.
1054        pub fn with_request<V: Into<crate::model::GetManagedFolderRequest>>(
1055            mut self,
1056            v: V,
1057        ) -> Self {
1058            self.0.request = v.into();
1059            self
1060        }
1061
1062        /// Sets all the options, replacing any prior values.
1063        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1064            self.0.options = v.into();
1065            self
1066        }
1067
1068        /// Sends the request.
1069        pub async fn send(self) -> Result<crate::model::ManagedFolder> {
1070            let req = Self::auto_populate(self.0.request, false);
1071            (*self.0.stub)
1072                .get_managed_folder(req, self.0.options)
1073                .await
1074                .map(gax::response::Response::into_body)
1075        }
1076
1077        fn auto_populate(
1078            mut req: crate::model::GetManagedFolderRequest,
1079            force: bool,
1080        ) -> crate::model::GetManagedFolderRequest {
1081            if force || req.request_id.is_empty() {
1082                req = req.set_request_id(uuid::Uuid::new_v4().to_string())
1083            }
1084            req
1085        }
1086
1087        /// Sets the value of [name][crate::model::GetManagedFolderRequest::name].
1088        ///
1089        /// This is a **required** field for requests.
1090        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1091            self.0.request.name = v.into();
1092            self
1093        }
1094
1095        /// Sets the value of [if_metageneration_match][crate::model::GetManagedFolderRequest::if_metageneration_match].
1096        pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
1097        where
1098            T: std::convert::Into<i64>,
1099        {
1100            self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
1101            self
1102        }
1103
1104        /// Sets or clears the value of [if_metageneration_match][crate::model::GetManagedFolderRequest::if_metageneration_match].
1105        pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
1106        where
1107            T: std::convert::Into<i64>,
1108        {
1109            self.0.request.if_metageneration_match = v.map(|x| x.into());
1110            self
1111        }
1112
1113        /// Sets the value of [if_metageneration_not_match][crate::model::GetManagedFolderRequest::if_metageneration_not_match].
1114        pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
1115        where
1116            T: std::convert::Into<i64>,
1117        {
1118            self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
1119            self
1120        }
1121
1122        /// Sets or clears the value of [if_metageneration_not_match][crate::model::GetManagedFolderRequest::if_metageneration_not_match].
1123        pub fn set_or_clear_if_metageneration_not_match<T>(
1124            mut self,
1125            v: std::option::Option<T>,
1126        ) -> Self
1127        where
1128            T: std::convert::Into<i64>,
1129        {
1130            self.0.request.if_metageneration_not_match = v.map(|x| x.into());
1131            self
1132        }
1133
1134        /// Sets the value of [request_id][crate::model::GetManagedFolderRequest::request_id].
1135        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1136            self.0.request.request_id = v.into();
1137            self
1138        }
1139    }
1140
1141    #[doc(hidden)]
1142    impl gax::options::internal::RequestBuilder for GetManagedFolder {
1143        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1144            &mut self.0.options
1145        }
1146    }
1147
1148    /// The request builder for [StorageControl::list_managed_folders][crate::client::StorageControl::list_managed_folders] calls.
1149    ///
1150    /// # Example
1151    /// ```no_run
1152    /// # use google_cloud_storage::builder;
1153    /// use builder::storage_control::ListManagedFolders;
1154    /// # tokio_test::block_on(async {
1155    /// use gax::paginator::ItemPaginator;
1156    ///
1157    /// let builder = prepare_request_builder();
1158    /// let mut items = builder.by_item();
1159    /// while let Some(result) = items.next().await {
1160    ///   let item = result?;
1161    /// }
1162    /// # gax::Result::<()>::Ok(()) });
1163    ///
1164    /// fn prepare_request_builder() -> ListManagedFolders {
1165    ///   # panic!();
1166    ///   // ... details omitted ...
1167    /// }
1168    /// ```
1169    #[derive(Clone, Debug)]
1170    pub struct ListManagedFolders(RequestBuilder<crate::model::ListManagedFoldersRequest>);
1171
1172    impl ListManagedFolders {
1173        pub(crate) fn new(
1174            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1175        ) -> Self {
1176            Self(RequestBuilder::new(stub))
1177        }
1178
1179        /// Sets the full request, replacing any prior values.
1180        pub fn with_request<V: Into<crate::model::ListManagedFoldersRequest>>(
1181            mut self,
1182            v: V,
1183        ) -> Self {
1184            self.0.request = v.into();
1185            self
1186        }
1187
1188        /// Sets all the options, replacing any prior values.
1189        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1190            self.0.options = v.into();
1191            self
1192        }
1193
1194        /// Sends the request.
1195        pub async fn send(self) -> Result<crate::model::ListManagedFoldersResponse> {
1196            let req = Self::auto_populate(self.0.request, false);
1197            (*self.0.stub)
1198                .list_managed_folders(req, self.0.options)
1199                .await
1200                .map(gax::response::Response::into_body)
1201        }
1202
1203        /// Streams each page in the collection.
1204        pub fn by_page(
1205            self,
1206        ) -> impl gax::paginator::Paginator<crate::model::ListManagedFoldersResponse, gax::error::Error>
1207        {
1208            use std::clone::Clone;
1209            let token = self.0.request.page_token.clone();
1210            let execute = move |token: String| {
1211                let mut builder = self.clone();
1212                let initial = builder.0.request.page_token == token;
1213                builder.0.request = Self::auto_populate(builder.0.request, !initial);
1214                builder.0.request = builder.0.request.set_page_token(token);
1215                builder.send()
1216            };
1217            gax::paginator::internal::new_paginator(token, execute)
1218        }
1219
1220        /// Streams each item in the collection.
1221        pub fn by_item(
1222            self,
1223        ) -> impl gax::paginator::ItemPaginator<
1224            crate::model::ListManagedFoldersResponse,
1225            gax::error::Error,
1226        > {
1227            use gax::paginator::Paginator;
1228            self.by_page().items()
1229        }
1230
1231        fn auto_populate(
1232            mut req: crate::model::ListManagedFoldersRequest,
1233            force: bool,
1234        ) -> crate::model::ListManagedFoldersRequest {
1235            if force || req.request_id.is_empty() {
1236                req = req.set_request_id(uuid::Uuid::new_v4().to_string())
1237            }
1238            req
1239        }
1240
1241        /// Sets the value of [parent][crate::model::ListManagedFoldersRequest::parent].
1242        ///
1243        /// This is a **required** field for requests.
1244        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1245            self.0.request.parent = v.into();
1246            self
1247        }
1248
1249        /// Sets the value of [page_size][crate::model::ListManagedFoldersRequest::page_size].
1250        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1251            self.0.request.page_size = v.into();
1252            self
1253        }
1254
1255        /// Sets the value of [page_token][crate::model::ListManagedFoldersRequest::page_token].
1256        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1257            self.0.request.page_token = v.into();
1258            self
1259        }
1260
1261        /// Sets the value of [prefix][crate::model::ListManagedFoldersRequest::prefix].
1262        pub fn set_prefix<T: Into<std::string::String>>(mut self, v: T) -> Self {
1263            self.0.request.prefix = v.into();
1264            self
1265        }
1266
1267        /// Sets the value of [request_id][crate::model::ListManagedFoldersRequest::request_id].
1268        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1269            self.0.request.request_id = v.into();
1270            self
1271        }
1272    }
1273
1274    #[doc(hidden)]
1275    impl gax::options::internal::RequestBuilder for ListManagedFolders {
1276        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1277            &mut self.0.options
1278        }
1279    }
1280
1281    /// The request builder for [StorageControl::create_anywhere_cache][crate::client::StorageControl::create_anywhere_cache] calls.
1282    ///
1283    /// # Example
1284    /// ```no_run
1285    /// # use google_cloud_storage::builder;
1286    /// use builder::storage_control::CreateAnywhereCache;
1287    /// # tokio_test::block_on(async {
1288    /// use lro::Poller;
1289    ///
1290    /// let builder = prepare_request_builder();
1291    /// let response = builder.poller().until_done().await?;
1292    /// # gax::Result::<()>::Ok(()) });
1293    ///
1294    /// fn prepare_request_builder() -> CreateAnywhereCache {
1295    ///   # panic!();
1296    ///   // ... details omitted ...
1297    /// }
1298    /// ```
1299    #[derive(Clone, Debug)]
1300    pub struct CreateAnywhereCache(RequestBuilder<crate::model::CreateAnywhereCacheRequest>);
1301
1302    impl CreateAnywhereCache {
1303        pub(crate) fn new(
1304            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1305        ) -> Self {
1306            Self(RequestBuilder::new(stub))
1307        }
1308
1309        /// Sets the full request, replacing any prior values.
1310        pub fn with_request<V: Into<crate::model::CreateAnywhereCacheRequest>>(
1311            mut self,
1312            v: V,
1313        ) -> Self {
1314            self.0.request = v.into();
1315            self
1316        }
1317
1318        /// Sets all the options, replacing any prior values.
1319        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1320            self.0.options = v.into();
1321            self
1322        }
1323
1324        /// Sends the request.
1325        ///
1326        /// # Long running operations
1327        ///
1328        /// This starts, but does not poll, a longrunning operation. More information
1329        /// on [create_anywhere_cache][crate::client::StorageControl::create_anywhere_cache].
1330        pub async fn send(self) -> Result<longrunning::model::Operation> {
1331            let req = Self::auto_populate(self.0.request, false);
1332            (*self.0.stub)
1333                .create_anywhere_cache(req, self.0.options)
1334                .await
1335                .map(gax::response::Response::into_body)
1336        }
1337
1338        /// Creates a [Poller][lro::Poller] to work with `create_anywhere_cache`.
1339        pub fn poller(
1340            self,
1341        ) -> impl lro::Poller<crate::model::AnywhereCache, crate::model::CreateAnywhereCacheMetadata>
1342        {
1343            type Operation = lro::internal::Operation<
1344                crate::model::AnywhereCache,
1345                crate::model::CreateAnywhereCacheMetadata,
1346            >;
1347            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1348            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1349
1350            let stub = self.0.stub.clone();
1351            let mut options = self.0.options.clone();
1352            options.set_retry_policy(gax::retry_policy::NeverRetry);
1353            let query = move |name| {
1354                let stub = stub.clone();
1355                let options = options.clone();
1356                async {
1357                    let op = GetOperation::new(stub)
1358                        .set_name(name)
1359                        .with_options(options)
1360                        .send()
1361                        .await?;
1362                    Ok(Operation::new(op))
1363                }
1364            };
1365
1366            let start = move || async {
1367                let op = self.send().await?;
1368                Ok(Operation::new(op))
1369            };
1370
1371            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1372        }
1373
1374        fn auto_populate(
1375            mut req: crate::model::CreateAnywhereCacheRequest,
1376            force: bool,
1377        ) -> crate::model::CreateAnywhereCacheRequest {
1378            if force || req.request_id.is_empty() {
1379                req = req.set_request_id(uuid::Uuid::new_v4().to_string())
1380            }
1381            req
1382        }
1383
1384        /// Sets the value of [parent][crate::model::CreateAnywhereCacheRequest::parent].
1385        ///
1386        /// This is a **required** field for requests.
1387        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1388            self.0.request.parent = v.into();
1389            self
1390        }
1391
1392        /// Sets the value of [anywhere_cache][crate::model::CreateAnywhereCacheRequest::anywhere_cache].
1393        ///
1394        /// This is a **required** field for requests.
1395        pub fn set_anywhere_cache<T>(mut self, v: T) -> Self
1396        where
1397            T: std::convert::Into<crate::model::AnywhereCache>,
1398        {
1399            self.0.request.anywhere_cache = std::option::Option::Some(v.into());
1400            self
1401        }
1402
1403        /// Sets or clears the value of [anywhere_cache][crate::model::CreateAnywhereCacheRequest::anywhere_cache].
1404        ///
1405        /// This is a **required** field for requests.
1406        pub fn set_or_clear_anywhere_cache<T>(mut self, v: std::option::Option<T>) -> Self
1407        where
1408            T: std::convert::Into<crate::model::AnywhereCache>,
1409        {
1410            self.0.request.anywhere_cache = v.map(|x| x.into());
1411            self
1412        }
1413
1414        /// Sets the value of [request_id][crate::model::CreateAnywhereCacheRequest::request_id].
1415        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1416            self.0.request.request_id = v.into();
1417            self
1418        }
1419    }
1420
1421    #[doc(hidden)]
1422    impl gax::options::internal::RequestBuilder for CreateAnywhereCache {
1423        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1424            &mut self.0.options
1425        }
1426    }
1427
1428    /// The request builder for [StorageControl::update_anywhere_cache][crate::client::StorageControl::update_anywhere_cache] calls.
1429    ///
1430    /// # Example
1431    /// ```no_run
1432    /// # use google_cloud_storage::builder;
1433    /// use builder::storage_control::UpdateAnywhereCache;
1434    /// # tokio_test::block_on(async {
1435    /// use lro::Poller;
1436    ///
1437    /// let builder = prepare_request_builder();
1438    /// let response = builder.poller().until_done().await?;
1439    /// # gax::Result::<()>::Ok(()) });
1440    ///
1441    /// fn prepare_request_builder() -> UpdateAnywhereCache {
1442    ///   # panic!();
1443    ///   // ... details omitted ...
1444    /// }
1445    /// ```
1446    #[derive(Clone, Debug)]
1447    pub struct UpdateAnywhereCache(RequestBuilder<crate::model::UpdateAnywhereCacheRequest>);
1448
1449    impl UpdateAnywhereCache {
1450        pub(crate) fn new(
1451            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1452        ) -> Self {
1453            Self(RequestBuilder::new(stub))
1454        }
1455
1456        /// Sets the full request, replacing any prior values.
1457        pub fn with_request<V: Into<crate::model::UpdateAnywhereCacheRequest>>(
1458            mut self,
1459            v: V,
1460        ) -> Self {
1461            self.0.request = v.into();
1462            self
1463        }
1464
1465        /// Sets all the options, replacing any prior values.
1466        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1467            self.0.options = v.into();
1468            self
1469        }
1470
1471        /// Sends the request.
1472        ///
1473        /// # Long running operations
1474        ///
1475        /// This starts, but does not poll, a longrunning operation. More information
1476        /// on [update_anywhere_cache][crate::client::StorageControl::update_anywhere_cache].
1477        pub async fn send(self) -> Result<longrunning::model::Operation> {
1478            let req = Self::auto_populate(self.0.request, false);
1479            (*self.0.stub)
1480                .update_anywhere_cache(req, self.0.options)
1481                .await
1482                .map(gax::response::Response::into_body)
1483        }
1484
1485        /// Creates a [Poller][lro::Poller] to work with `update_anywhere_cache`.
1486        pub fn poller(
1487            self,
1488        ) -> impl lro::Poller<crate::model::AnywhereCache, crate::model::UpdateAnywhereCacheMetadata>
1489        {
1490            type Operation = lro::internal::Operation<
1491                crate::model::AnywhereCache,
1492                crate::model::UpdateAnywhereCacheMetadata,
1493            >;
1494            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1495            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1496
1497            let stub = self.0.stub.clone();
1498            let mut options = self.0.options.clone();
1499            options.set_retry_policy(gax::retry_policy::NeverRetry);
1500            let query = move |name| {
1501                let stub = stub.clone();
1502                let options = options.clone();
1503                async {
1504                    let op = GetOperation::new(stub)
1505                        .set_name(name)
1506                        .with_options(options)
1507                        .send()
1508                        .await?;
1509                    Ok(Operation::new(op))
1510                }
1511            };
1512
1513            let start = move || async {
1514                let op = self.send().await?;
1515                Ok(Operation::new(op))
1516            };
1517
1518            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1519        }
1520
1521        fn auto_populate(
1522            mut req: crate::model::UpdateAnywhereCacheRequest,
1523            force: bool,
1524        ) -> crate::model::UpdateAnywhereCacheRequest {
1525            if force || req.request_id.is_empty() {
1526                req = req.set_request_id(uuid::Uuid::new_v4().to_string())
1527            }
1528            req
1529        }
1530
1531        /// Sets the value of [anywhere_cache][crate::model::UpdateAnywhereCacheRequest::anywhere_cache].
1532        ///
1533        /// This is a **required** field for requests.
1534        pub fn set_anywhere_cache<T>(mut self, v: T) -> Self
1535        where
1536            T: std::convert::Into<crate::model::AnywhereCache>,
1537        {
1538            self.0.request.anywhere_cache = std::option::Option::Some(v.into());
1539            self
1540        }
1541
1542        /// Sets or clears the value of [anywhere_cache][crate::model::UpdateAnywhereCacheRequest::anywhere_cache].
1543        ///
1544        /// This is a **required** field for requests.
1545        pub fn set_or_clear_anywhere_cache<T>(mut self, v: std::option::Option<T>) -> Self
1546        where
1547            T: std::convert::Into<crate::model::AnywhereCache>,
1548        {
1549            self.0.request.anywhere_cache = v.map(|x| x.into());
1550            self
1551        }
1552
1553        /// Sets the value of [update_mask][crate::model::UpdateAnywhereCacheRequest::update_mask].
1554        ///
1555        /// This is a **required** field for requests.
1556        pub fn set_update_mask<T>(mut self, v: T) -> Self
1557        where
1558            T: std::convert::Into<wkt::FieldMask>,
1559        {
1560            self.0.request.update_mask = std::option::Option::Some(v.into());
1561            self
1562        }
1563
1564        /// Sets or clears the value of [update_mask][crate::model::UpdateAnywhereCacheRequest::update_mask].
1565        ///
1566        /// This is a **required** field for requests.
1567        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1568        where
1569            T: std::convert::Into<wkt::FieldMask>,
1570        {
1571            self.0.request.update_mask = v.map(|x| x.into());
1572            self
1573        }
1574
1575        /// Sets the value of [request_id][crate::model::UpdateAnywhereCacheRequest::request_id].
1576        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1577            self.0.request.request_id = v.into();
1578            self
1579        }
1580    }
1581
1582    #[doc(hidden)]
1583    impl gax::options::internal::RequestBuilder for UpdateAnywhereCache {
1584        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1585            &mut self.0.options
1586        }
1587    }
1588
1589    /// The request builder for [StorageControl::disable_anywhere_cache][crate::client::StorageControl::disable_anywhere_cache] calls.
1590    ///
1591    /// # Example
1592    /// ```no_run
1593    /// # use google_cloud_storage::builder;
1594    /// use builder::storage_control::DisableAnywhereCache;
1595    /// # tokio_test::block_on(async {
1596    ///
1597    /// let builder = prepare_request_builder();
1598    /// let response = builder.send().await?;
1599    /// # gax::Result::<()>::Ok(()) });
1600    ///
1601    /// fn prepare_request_builder() -> DisableAnywhereCache {
1602    ///   # panic!();
1603    ///   // ... details omitted ...
1604    /// }
1605    /// ```
1606    #[derive(Clone, Debug)]
1607    pub struct DisableAnywhereCache(RequestBuilder<crate::model::DisableAnywhereCacheRequest>);
1608
1609    impl DisableAnywhereCache {
1610        pub(crate) fn new(
1611            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1612        ) -> Self {
1613            Self(RequestBuilder::new(stub))
1614        }
1615
1616        /// Sets the full request, replacing any prior values.
1617        pub fn with_request<V: Into<crate::model::DisableAnywhereCacheRequest>>(
1618            mut self,
1619            v: V,
1620        ) -> Self {
1621            self.0.request = v.into();
1622            self
1623        }
1624
1625        /// Sets all the options, replacing any prior values.
1626        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1627            self.0.options = v.into();
1628            self
1629        }
1630
1631        /// Sends the request.
1632        pub async fn send(self) -> Result<crate::model::AnywhereCache> {
1633            let req = Self::auto_populate(self.0.request, false);
1634            (*self.0.stub)
1635                .disable_anywhere_cache(req, self.0.options)
1636                .await
1637                .map(gax::response::Response::into_body)
1638        }
1639
1640        fn auto_populate(
1641            mut req: crate::model::DisableAnywhereCacheRequest,
1642            force: bool,
1643        ) -> crate::model::DisableAnywhereCacheRequest {
1644            if force || req.request_id.is_empty() {
1645                req = req.set_request_id(uuid::Uuid::new_v4().to_string())
1646            }
1647            req
1648        }
1649
1650        /// Sets the value of [name][crate::model::DisableAnywhereCacheRequest::name].
1651        ///
1652        /// This is a **required** field for requests.
1653        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1654            self.0.request.name = v.into();
1655            self
1656        }
1657
1658        /// Sets the value of [request_id][crate::model::DisableAnywhereCacheRequest::request_id].
1659        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1660            self.0.request.request_id = v.into();
1661            self
1662        }
1663    }
1664
1665    #[doc(hidden)]
1666    impl gax::options::internal::RequestBuilder for DisableAnywhereCache {
1667        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1668            &mut self.0.options
1669        }
1670    }
1671
1672    /// The request builder for [StorageControl::pause_anywhere_cache][crate::client::StorageControl::pause_anywhere_cache] calls.
1673    ///
1674    /// # Example
1675    /// ```no_run
1676    /// # use google_cloud_storage::builder;
1677    /// use builder::storage_control::PauseAnywhereCache;
1678    /// # tokio_test::block_on(async {
1679    ///
1680    /// let builder = prepare_request_builder();
1681    /// let response = builder.send().await?;
1682    /// # gax::Result::<()>::Ok(()) });
1683    ///
1684    /// fn prepare_request_builder() -> PauseAnywhereCache {
1685    ///   # panic!();
1686    ///   // ... details omitted ...
1687    /// }
1688    /// ```
1689    #[derive(Clone, Debug)]
1690    pub struct PauseAnywhereCache(RequestBuilder<crate::model::PauseAnywhereCacheRequest>);
1691
1692    impl PauseAnywhereCache {
1693        pub(crate) fn new(
1694            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1695        ) -> Self {
1696            Self(RequestBuilder::new(stub))
1697        }
1698
1699        /// Sets the full request, replacing any prior values.
1700        pub fn with_request<V: Into<crate::model::PauseAnywhereCacheRequest>>(
1701            mut self,
1702            v: V,
1703        ) -> Self {
1704            self.0.request = v.into();
1705            self
1706        }
1707
1708        /// Sets all the options, replacing any prior values.
1709        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1710            self.0.options = v.into();
1711            self
1712        }
1713
1714        /// Sends the request.
1715        pub async fn send(self) -> Result<crate::model::AnywhereCache> {
1716            let req = Self::auto_populate(self.0.request, false);
1717            (*self.0.stub)
1718                .pause_anywhere_cache(req, self.0.options)
1719                .await
1720                .map(gax::response::Response::into_body)
1721        }
1722
1723        fn auto_populate(
1724            mut req: crate::model::PauseAnywhereCacheRequest,
1725            force: bool,
1726        ) -> crate::model::PauseAnywhereCacheRequest {
1727            if force || req.request_id.is_empty() {
1728                req = req.set_request_id(uuid::Uuid::new_v4().to_string())
1729            }
1730            req
1731        }
1732
1733        /// Sets the value of [name][crate::model::PauseAnywhereCacheRequest::name].
1734        ///
1735        /// This is a **required** field for requests.
1736        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1737            self.0.request.name = v.into();
1738            self
1739        }
1740
1741        /// Sets the value of [request_id][crate::model::PauseAnywhereCacheRequest::request_id].
1742        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1743            self.0.request.request_id = v.into();
1744            self
1745        }
1746    }
1747
1748    #[doc(hidden)]
1749    impl gax::options::internal::RequestBuilder for PauseAnywhereCache {
1750        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1751            &mut self.0.options
1752        }
1753    }
1754
1755    /// The request builder for [StorageControl::resume_anywhere_cache][crate::client::StorageControl::resume_anywhere_cache] calls.
1756    ///
1757    /// # Example
1758    /// ```no_run
1759    /// # use google_cloud_storage::builder;
1760    /// use builder::storage_control::ResumeAnywhereCache;
1761    /// # tokio_test::block_on(async {
1762    ///
1763    /// let builder = prepare_request_builder();
1764    /// let response = builder.send().await?;
1765    /// # gax::Result::<()>::Ok(()) });
1766    ///
1767    /// fn prepare_request_builder() -> ResumeAnywhereCache {
1768    ///   # panic!();
1769    ///   // ... details omitted ...
1770    /// }
1771    /// ```
1772    #[derive(Clone, Debug)]
1773    pub struct ResumeAnywhereCache(RequestBuilder<crate::model::ResumeAnywhereCacheRequest>);
1774
1775    impl ResumeAnywhereCache {
1776        pub(crate) fn new(
1777            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1778        ) -> Self {
1779            Self(RequestBuilder::new(stub))
1780        }
1781
1782        /// Sets the full request, replacing any prior values.
1783        pub fn with_request<V: Into<crate::model::ResumeAnywhereCacheRequest>>(
1784            mut self,
1785            v: V,
1786        ) -> Self {
1787            self.0.request = v.into();
1788            self
1789        }
1790
1791        /// Sets all the options, replacing any prior values.
1792        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1793            self.0.options = v.into();
1794            self
1795        }
1796
1797        /// Sends the request.
1798        pub async fn send(self) -> Result<crate::model::AnywhereCache> {
1799            let req = Self::auto_populate(self.0.request, false);
1800            (*self.0.stub)
1801                .resume_anywhere_cache(req, self.0.options)
1802                .await
1803                .map(gax::response::Response::into_body)
1804        }
1805
1806        fn auto_populate(
1807            mut req: crate::model::ResumeAnywhereCacheRequest,
1808            force: bool,
1809        ) -> crate::model::ResumeAnywhereCacheRequest {
1810            if force || req.request_id.is_empty() {
1811                req = req.set_request_id(uuid::Uuid::new_v4().to_string())
1812            }
1813            req
1814        }
1815
1816        /// Sets the value of [name][crate::model::ResumeAnywhereCacheRequest::name].
1817        ///
1818        /// This is a **required** field for requests.
1819        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1820            self.0.request.name = v.into();
1821            self
1822        }
1823
1824        /// Sets the value of [request_id][crate::model::ResumeAnywhereCacheRequest::request_id].
1825        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1826            self.0.request.request_id = v.into();
1827            self
1828        }
1829    }
1830
1831    #[doc(hidden)]
1832    impl gax::options::internal::RequestBuilder for ResumeAnywhereCache {
1833        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1834            &mut self.0.options
1835        }
1836    }
1837
1838    /// The request builder for [StorageControl::get_anywhere_cache][crate::client::StorageControl::get_anywhere_cache] calls.
1839    ///
1840    /// # Example
1841    /// ```no_run
1842    /// # use google_cloud_storage::builder;
1843    /// use builder::storage_control::GetAnywhereCache;
1844    /// # tokio_test::block_on(async {
1845    ///
1846    /// let builder = prepare_request_builder();
1847    /// let response = builder.send().await?;
1848    /// # gax::Result::<()>::Ok(()) });
1849    ///
1850    /// fn prepare_request_builder() -> GetAnywhereCache {
1851    ///   # panic!();
1852    ///   // ... details omitted ...
1853    /// }
1854    /// ```
1855    #[derive(Clone, Debug)]
1856    pub struct GetAnywhereCache(RequestBuilder<crate::model::GetAnywhereCacheRequest>);
1857
1858    impl GetAnywhereCache {
1859        pub(crate) fn new(
1860            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1861        ) -> Self {
1862            Self(RequestBuilder::new(stub))
1863        }
1864
1865        /// Sets the full request, replacing any prior values.
1866        pub fn with_request<V: Into<crate::model::GetAnywhereCacheRequest>>(
1867            mut self,
1868            v: V,
1869        ) -> Self {
1870            self.0.request = v.into();
1871            self
1872        }
1873
1874        /// Sets all the options, replacing any prior values.
1875        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1876            self.0.options = v.into();
1877            self
1878        }
1879
1880        /// Sends the request.
1881        pub async fn send(self) -> Result<crate::model::AnywhereCache> {
1882            let req = Self::auto_populate(self.0.request, false);
1883            (*self.0.stub)
1884                .get_anywhere_cache(req, self.0.options)
1885                .await
1886                .map(gax::response::Response::into_body)
1887        }
1888
1889        fn auto_populate(
1890            mut req: crate::model::GetAnywhereCacheRequest,
1891            force: bool,
1892        ) -> crate::model::GetAnywhereCacheRequest {
1893            if force || req.request_id.is_empty() {
1894                req = req.set_request_id(uuid::Uuid::new_v4().to_string())
1895            }
1896            req
1897        }
1898
1899        /// Sets the value of [name][crate::model::GetAnywhereCacheRequest::name].
1900        ///
1901        /// This is a **required** field for requests.
1902        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1903            self.0.request.name = v.into();
1904            self
1905        }
1906
1907        /// Sets the value of [request_id][crate::model::GetAnywhereCacheRequest::request_id].
1908        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1909            self.0.request.request_id = v.into();
1910            self
1911        }
1912    }
1913
1914    #[doc(hidden)]
1915    impl gax::options::internal::RequestBuilder for GetAnywhereCache {
1916        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1917            &mut self.0.options
1918        }
1919    }
1920
1921    /// The request builder for [StorageControl::list_anywhere_caches][crate::client::StorageControl::list_anywhere_caches] calls.
1922    ///
1923    /// # Example
1924    /// ```no_run
1925    /// # use google_cloud_storage::builder;
1926    /// use builder::storage_control::ListAnywhereCaches;
1927    /// # tokio_test::block_on(async {
1928    /// use gax::paginator::ItemPaginator;
1929    ///
1930    /// let builder = prepare_request_builder();
1931    /// let mut items = builder.by_item();
1932    /// while let Some(result) = items.next().await {
1933    ///   let item = result?;
1934    /// }
1935    /// # gax::Result::<()>::Ok(()) });
1936    ///
1937    /// fn prepare_request_builder() -> ListAnywhereCaches {
1938    ///   # panic!();
1939    ///   // ... details omitted ...
1940    /// }
1941    /// ```
1942    #[derive(Clone, Debug)]
1943    pub struct ListAnywhereCaches(RequestBuilder<crate::model::ListAnywhereCachesRequest>);
1944
1945    impl ListAnywhereCaches {
1946        pub(crate) fn new(
1947            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1948        ) -> Self {
1949            Self(RequestBuilder::new(stub))
1950        }
1951
1952        /// Sets the full request, replacing any prior values.
1953        pub fn with_request<V: Into<crate::model::ListAnywhereCachesRequest>>(
1954            mut self,
1955            v: V,
1956        ) -> Self {
1957            self.0.request = v.into();
1958            self
1959        }
1960
1961        /// Sets all the options, replacing any prior values.
1962        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1963            self.0.options = v.into();
1964            self
1965        }
1966
1967        /// Sends the request.
1968        pub async fn send(self) -> Result<crate::model::ListAnywhereCachesResponse> {
1969            let req = Self::auto_populate(self.0.request, false);
1970            (*self.0.stub)
1971                .list_anywhere_caches(req, self.0.options)
1972                .await
1973                .map(gax::response::Response::into_body)
1974        }
1975
1976        /// Streams each page in the collection.
1977        pub fn by_page(
1978            self,
1979        ) -> impl gax::paginator::Paginator<crate::model::ListAnywhereCachesResponse, gax::error::Error>
1980        {
1981            use std::clone::Clone;
1982            let token = self.0.request.page_token.clone();
1983            let execute = move |token: String| {
1984                let mut builder = self.clone();
1985                let initial = builder.0.request.page_token == token;
1986                builder.0.request = Self::auto_populate(builder.0.request, !initial);
1987                builder.0.request = builder.0.request.set_page_token(token);
1988                builder.send()
1989            };
1990            gax::paginator::internal::new_paginator(token, execute)
1991        }
1992
1993        /// Streams each item in the collection.
1994        pub fn by_item(
1995            self,
1996        ) -> impl gax::paginator::ItemPaginator<
1997            crate::model::ListAnywhereCachesResponse,
1998            gax::error::Error,
1999        > {
2000            use gax::paginator::Paginator;
2001            self.by_page().items()
2002        }
2003
2004        fn auto_populate(
2005            mut req: crate::model::ListAnywhereCachesRequest,
2006            force: bool,
2007        ) -> crate::model::ListAnywhereCachesRequest {
2008            if force || req.request_id.is_empty() {
2009                req = req.set_request_id(uuid::Uuid::new_v4().to_string())
2010            }
2011            req
2012        }
2013
2014        /// Sets the value of [parent][crate::model::ListAnywhereCachesRequest::parent].
2015        ///
2016        /// This is a **required** field for requests.
2017        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2018            self.0.request.parent = v.into();
2019            self
2020        }
2021
2022        /// Sets the value of [page_size][crate::model::ListAnywhereCachesRequest::page_size].
2023        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2024            self.0.request.page_size = v.into();
2025            self
2026        }
2027
2028        /// Sets the value of [page_token][crate::model::ListAnywhereCachesRequest::page_token].
2029        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2030            self.0.request.page_token = v.into();
2031            self
2032        }
2033
2034        /// Sets the value of [request_id][crate::model::ListAnywhereCachesRequest::request_id].
2035        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2036            self.0.request.request_id = v.into();
2037            self
2038        }
2039    }
2040
2041    #[doc(hidden)]
2042    impl gax::options::internal::RequestBuilder for ListAnywhereCaches {
2043        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2044            &mut self.0.options
2045        }
2046    }
2047
2048    /// The request builder for [StorageControl::get_project_intelligence_config][crate::client::StorageControl::get_project_intelligence_config] calls.
2049    ///
2050    /// # Example
2051    /// ```no_run
2052    /// # use google_cloud_storage::builder;
2053    /// use builder::storage_control::GetProjectIntelligenceConfig;
2054    /// # tokio_test::block_on(async {
2055    ///
2056    /// let builder = prepare_request_builder();
2057    /// let response = builder.send().await?;
2058    /// # gax::Result::<()>::Ok(()) });
2059    ///
2060    /// fn prepare_request_builder() -> GetProjectIntelligenceConfig {
2061    ///   # panic!();
2062    ///   // ... details omitted ...
2063    /// }
2064    /// ```
2065    #[derive(Clone, Debug)]
2066    pub struct GetProjectIntelligenceConfig(
2067        RequestBuilder<crate::model::GetProjectIntelligenceConfigRequest>,
2068    );
2069
2070    impl GetProjectIntelligenceConfig {
2071        pub(crate) fn new(
2072            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2073        ) -> Self {
2074            Self(RequestBuilder::new(stub))
2075        }
2076
2077        /// Sets the full request, replacing any prior values.
2078        pub fn with_request<V: Into<crate::model::GetProjectIntelligenceConfigRequest>>(
2079            mut self,
2080            v: V,
2081        ) -> Self {
2082            self.0.request = v.into();
2083            self
2084        }
2085
2086        /// Sets all the options, replacing any prior values.
2087        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2088            self.0.options = v.into();
2089            self
2090        }
2091
2092        /// Sends the request.
2093        pub async fn send(self) -> Result<crate::model::IntelligenceConfig> {
2094            (*self.0.stub)
2095                .get_project_intelligence_config(self.0.request, self.0.options)
2096                .await
2097                .map(gax::response::Response::into_body)
2098        }
2099
2100        /// Sets the value of [name][crate::model::GetProjectIntelligenceConfigRequest::name].
2101        ///
2102        /// This is a **required** field for requests.
2103        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2104            self.0.request.name = v.into();
2105            self
2106        }
2107    }
2108
2109    #[doc(hidden)]
2110    impl gax::options::internal::RequestBuilder for GetProjectIntelligenceConfig {
2111        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2112            &mut self.0.options
2113        }
2114    }
2115
2116    /// The request builder for [StorageControl::update_project_intelligence_config][crate::client::StorageControl::update_project_intelligence_config] calls.
2117    ///
2118    /// # Example
2119    /// ```no_run
2120    /// # use google_cloud_storage::builder;
2121    /// use builder::storage_control::UpdateProjectIntelligenceConfig;
2122    /// # tokio_test::block_on(async {
2123    ///
2124    /// let builder = prepare_request_builder();
2125    /// let response = builder.send().await?;
2126    /// # gax::Result::<()>::Ok(()) });
2127    ///
2128    /// fn prepare_request_builder() -> UpdateProjectIntelligenceConfig {
2129    ///   # panic!();
2130    ///   // ... details omitted ...
2131    /// }
2132    /// ```
2133    #[derive(Clone, Debug)]
2134    pub struct UpdateProjectIntelligenceConfig(
2135        RequestBuilder<crate::model::UpdateProjectIntelligenceConfigRequest>,
2136    );
2137
2138    impl UpdateProjectIntelligenceConfig {
2139        pub(crate) fn new(
2140            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2141        ) -> Self {
2142            Self(RequestBuilder::new(stub))
2143        }
2144
2145        /// Sets the full request, replacing any prior values.
2146        pub fn with_request<V: Into<crate::model::UpdateProjectIntelligenceConfigRequest>>(
2147            mut self,
2148            v: V,
2149        ) -> Self {
2150            self.0.request = v.into();
2151            self
2152        }
2153
2154        /// Sets all the options, replacing any prior values.
2155        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2156            self.0.options = v.into();
2157            self
2158        }
2159
2160        /// Sends the request.
2161        pub async fn send(self) -> Result<crate::model::IntelligenceConfig> {
2162            (*self.0.stub)
2163                .update_project_intelligence_config(self.0.request, self.0.options)
2164                .await
2165                .map(gax::response::Response::into_body)
2166        }
2167
2168        /// Sets the value of [intelligence_config][crate::model::UpdateProjectIntelligenceConfigRequest::intelligence_config].
2169        ///
2170        /// This is a **required** field for requests.
2171        pub fn set_intelligence_config<T>(mut self, v: T) -> Self
2172        where
2173            T: std::convert::Into<crate::model::IntelligenceConfig>,
2174        {
2175            self.0.request.intelligence_config = std::option::Option::Some(v.into());
2176            self
2177        }
2178
2179        /// Sets or clears the value of [intelligence_config][crate::model::UpdateProjectIntelligenceConfigRequest::intelligence_config].
2180        ///
2181        /// This is a **required** field for requests.
2182        pub fn set_or_clear_intelligence_config<T>(mut self, v: std::option::Option<T>) -> Self
2183        where
2184            T: std::convert::Into<crate::model::IntelligenceConfig>,
2185        {
2186            self.0.request.intelligence_config = v.map(|x| x.into());
2187            self
2188        }
2189
2190        /// Sets the value of [update_mask][crate::model::UpdateProjectIntelligenceConfigRequest::update_mask].
2191        ///
2192        /// This is a **required** field for requests.
2193        pub fn set_update_mask<T>(mut self, v: T) -> Self
2194        where
2195            T: std::convert::Into<wkt::FieldMask>,
2196        {
2197            self.0.request.update_mask = std::option::Option::Some(v.into());
2198            self
2199        }
2200
2201        /// Sets or clears the value of [update_mask][crate::model::UpdateProjectIntelligenceConfigRequest::update_mask].
2202        ///
2203        /// This is a **required** field for requests.
2204        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2205        where
2206            T: std::convert::Into<wkt::FieldMask>,
2207        {
2208            self.0.request.update_mask = v.map(|x| x.into());
2209            self
2210        }
2211
2212        /// Sets the value of [request_id][crate::model::UpdateProjectIntelligenceConfigRequest::request_id].
2213        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2214            self.0.request.request_id = v.into();
2215            self
2216        }
2217    }
2218
2219    #[doc(hidden)]
2220    impl gax::options::internal::RequestBuilder for UpdateProjectIntelligenceConfig {
2221        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2222            &mut self.0.options
2223        }
2224    }
2225
2226    /// The request builder for [StorageControl::get_folder_intelligence_config][crate::client::StorageControl::get_folder_intelligence_config] calls.
2227    ///
2228    /// # Example
2229    /// ```no_run
2230    /// # use google_cloud_storage::builder;
2231    /// use builder::storage_control::GetFolderIntelligenceConfig;
2232    /// # tokio_test::block_on(async {
2233    ///
2234    /// let builder = prepare_request_builder();
2235    /// let response = builder.send().await?;
2236    /// # gax::Result::<()>::Ok(()) });
2237    ///
2238    /// fn prepare_request_builder() -> GetFolderIntelligenceConfig {
2239    ///   # panic!();
2240    ///   // ... details omitted ...
2241    /// }
2242    /// ```
2243    #[derive(Clone, Debug)]
2244    pub struct GetFolderIntelligenceConfig(
2245        RequestBuilder<crate::model::GetFolderIntelligenceConfigRequest>,
2246    );
2247
2248    impl GetFolderIntelligenceConfig {
2249        pub(crate) fn new(
2250            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2251        ) -> Self {
2252            Self(RequestBuilder::new(stub))
2253        }
2254
2255        /// Sets the full request, replacing any prior values.
2256        pub fn with_request<V: Into<crate::model::GetFolderIntelligenceConfigRequest>>(
2257            mut self,
2258            v: V,
2259        ) -> Self {
2260            self.0.request = v.into();
2261            self
2262        }
2263
2264        /// Sets all the options, replacing any prior values.
2265        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2266            self.0.options = v.into();
2267            self
2268        }
2269
2270        /// Sends the request.
2271        pub async fn send(self) -> Result<crate::model::IntelligenceConfig> {
2272            (*self.0.stub)
2273                .get_folder_intelligence_config(self.0.request, self.0.options)
2274                .await
2275                .map(gax::response::Response::into_body)
2276        }
2277
2278        /// Sets the value of [name][crate::model::GetFolderIntelligenceConfigRequest::name].
2279        ///
2280        /// This is a **required** field for requests.
2281        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2282            self.0.request.name = v.into();
2283            self
2284        }
2285    }
2286
2287    #[doc(hidden)]
2288    impl gax::options::internal::RequestBuilder for GetFolderIntelligenceConfig {
2289        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2290            &mut self.0.options
2291        }
2292    }
2293
2294    /// The request builder for [StorageControl::update_folder_intelligence_config][crate::client::StorageControl::update_folder_intelligence_config] calls.
2295    ///
2296    /// # Example
2297    /// ```no_run
2298    /// # use google_cloud_storage::builder;
2299    /// use builder::storage_control::UpdateFolderIntelligenceConfig;
2300    /// # tokio_test::block_on(async {
2301    ///
2302    /// let builder = prepare_request_builder();
2303    /// let response = builder.send().await?;
2304    /// # gax::Result::<()>::Ok(()) });
2305    ///
2306    /// fn prepare_request_builder() -> UpdateFolderIntelligenceConfig {
2307    ///   # panic!();
2308    ///   // ... details omitted ...
2309    /// }
2310    /// ```
2311    #[derive(Clone, Debug)]
2312    pub struct UpdateFolderIntelligenceConfig(
2313        RequestBuilder<crate::model::UpdateFolderIntelligenceConfigRequest>,
2314    );
2315
2316    impl UpdateFolderIntelligenceConfig {
2317        pub(crate) fn new(
2318            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2319        ) -> Self {
2320            Self(RequestBuilder::new(stub))
2321        }
2322
2323        /// Sets the full request, replacing any prior values.
2324        pub fn with_request<V: Into<crate::model::UpdateFolderIntelligenceConfigRequest>>(
2325            mut self,
2326            v: V,
2327        ) -> Self {
2328            self.0.request = v.into();
2329            self
2330        }
2331
2332        /// Sets all the options, replacing any prior values.
2333        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2334            self.0.options = v.into();
2335            self
2336        }
2337
2338        /// Sends the request.
2339        pub async fn send(self) -> Result<crate::model::IntelligenceConfig> {
2340            (*self.0.stub)
2341                .update_folder_intelligence_config(self.0.request, self.0.options)
2342                .await
2343                .map(gax::response::Response::into_body)
2344        }
2345
2346        /// Sets the value of [intelligence_config][crate::model::UpdateFolderIntelligenceConfigRequest::intelligence_config].
2347        ///
2348        /// This is a **required** field for requests.
2349        pub fn set_intelligence_config<T>(mut self, v: T) -> Self
2350        where
2351            T: std::convert::Into<crate::model::IntelligenceConfig>,
2352        {
2353            self.0.request.intelligence_config = std::option::Option::Some(v.into());
2354            self
2355        }
2356
2357        /// Sets or clears the value of [intelligence_config][crate::model::UpdateFolderIntelligenceConfigRequest::intelligence_config].
2358        ///
2359        /// This is a **required** field for requests.
2360        pub fn set_or_clear_intelligence_config<T>(mut self, v: std::option::Option<T>) -> Self
2361        where
2362            T: std::convert::Into<crate::model::IntelligenceConfig>,
2363        {
2364            self.0.request.intelligence_config = v.map(|x| x.into());
2365            self
2366        }
2367
2368        /// Sets the value of [update_mask][crate::model::UpdateFolderIntelligenceConfigRequest::update_mask].
2369        ///
2370        /// This is a **required** field for requests.
2371        pub fn set_update_mask<T>(mut self, v: T) -> Self
2372        where
2373            T: std::convert::Into<wkt::FieldMask>,
2374        {
2375            self.0.request.update_mask = std::option::Option::Some(v.into());
2376            self
2377        }
2378
2379        /// Sets or clears the value of [update_mask][crate::model::UpdateFolderIntelligenceConfigRequest::update_mask].
2380        ///
2381        /// This is a **required** field for requests.
2382        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2383        where
2384            T: std::convert::Into<wkt::FieldMask>,
2385        {
2386            self.0.request.update_mask = v.map(|x| x.into());
2387            self
2388        }
2389
2390        /// Sets the value of [request_id][crate::model::UpdateFolderIntelligenceConfigRequest::request_id].
2391        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2392            self.0.request.request_id = v.into();
2393            self
2394        }
2395    }
2396
2397    #[doc(hidden)]
2398    impl gax::options::internal::RequestBuilder for UpdateFolderIntelligenceConfig {
2399        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2400            &mut self.0.options
2401        }
2402    }
2403
2404    /// The request builder for [StorageControl::get_organization_intelligence_config][crate::client::StorageControl::get_organization_intelligence_config] calls.
2405    ///
2406    /// # Example
2407    /// ```no_run
2408    /// # use google_cloud_storage::builder;
2409    /// use builder::storage_control::GetOrganizationIntelligenceConfig;
2410    /// # tokio_test::block_on(async {
2411    ///
2412    /// let builder = prepare_request_builder();
2413    /// let response = builder.send().await?;
2414    /// # gax::Result::<()>::Ok(()) });
2415    ///
2416    /// fn prepare_request_builder() -> GetOrganizationIntelligenceConfig {
2417    ///   # panic!();
2418    ///   // ... details omitted ...
2419    /// }
2420    /// ```
2421    #[derive(Clone, Debug)]
2422    pub struct GetOrganizationIntelligenceConfig(
2423        RequestBuilder<crate::model::GetOrganizationIntelligenceConfigRequest>,
2424    );
2425
2426    impl GetOrganizationIntelligenceConfig {
2427        pub(crate) fn new(
2428            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2429        ) -> Self {
2430            Self(RequestBuilder::new(stub))
2431        }
2432
2433        /// Sets the full request, replacing any prior values.
2434        pub fn with_request<V: Into<crate::model::GetOrganizationIntelligenceConfigRequest>>(
2435            mut self,
2436            v: V,
2437        ) -> Self {
2438            self.0.request = v.into();
2439            self
2440        }
2441
2442        /// Sets all the options, replacing any prior values.
2443        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2444            self.0.options = v.into();
2445            self
2446        }
2447
2448        /// Sends the request.
2449        pub async fn send(self) -> Result<crate::model::IntelligenceConfig> {
2450            (*self.0.stub)
2451                .get_organization_intelligence_config(self.0.request, self.0.options)
2452                .await
2453                .map(gax::response::Response::into_body)
2454        }
2455
2456        /// Sets the value of [name][crate::model::GetOrganizationIntelligenceConfigRequest::name].
2457        ///
2458        /// This is a **required** field for requests.
2459        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2460            self.0.request.name = v.into();
2461            self
2462        }
2463    }
2464
2465    #[doc(hidden)]
2466    impl gax::options::internal::RequestBuilder for GetOrganizationIntelligenceConfig {
2467        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2468            &mut self.0.options
2469        }
2470    }
2471
2472    /// The request builder for [StorageControl::update_organization_intelligence_config][crate::client::StorageControl::update_organization_intelligence_config] calls.
2473    ///
2474    /// # Example
2475    /// ```no_run
2476    /// # use google_cloud_storage::builder;
2477    /// use builder::storage_control::UpdateOrganizationIntelligenceConfig;
2478    /// # tokio_test::block_on(async {
2479    ///
2480    /// let builder = prepare_request_builder();
2481    /// let response = builder.send().await?;
2482    /// # gax::Result::<()>::Ok(()) });
2483    ///
2484    /// fn prepare_request_builder() -> UpdateOrganizationIntelligenceConfig {
2485    ///   # panic!();
2486    ///   // ... details omitted ...
2487    /// }
2488    /// ```
2489    #[derive(Clone, Debug)]
2490    pub struct UpdateOrganizationIntelligenceConfig(
2491        RequestBuilder<crate::model::UpdateOrganizationIntelligenceConfigRequest>,
2492    );
2493
2494    impl UpdateOrganizationIntelligenceConfig {
2495        pub(crate) fn new(
2496            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2497        ) -> Self {
2498            Self(RequestBuilder::new(stub))
2499        }
2500
2501        /// Sets the full request, replacing any prior values.
2502        pub fn with_request<V: Into<crate::model::UpdateOrganizationIntelligenceConfigRequest>>(
2503            mut self,
2504            v: V,
2505        ) -> Self {
2506            self.0.request = v.into();
2507            self
2508        }
2509
2510        /// Sets all the options, replacing any prior values.
2511        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2512            self.0.options = v.into();
2513            self
2514        }
2515
2516        /// Sends the request.
2517        pub async fn send(self) -> Result<crate::model::IntelligenceConfig> {
2518            (*self.0.stub)
2519                .update_organization_intelligence_config(self.0.request, self.0.options)
2520                .await
2521                .map(gax::response::Response::into_body)
2522        }
2523
2524        /// Sets the value of [intelligence_config][crate::model::UpdateOrganizationIntelligenceConfigRequest::intelligence_config].
2525        ///
2526        /// This is a **required** field for requests.
2527        pub fn set_intelligence_config<T>(mut self, v: T) -> Self
2528        where
2529            T: std::convert::Into<crate::model::IntelligenceConfig>,
2530        {
2531            self.0.request.intelligence_config = std::option::Option::Some(v.into());
2532            self
2533        }
2534
2535        /// Sets or clears the value of [intelligence_config][crate::model::UpdateOrganizationIntelligenceConfigRequest::intelligence_config].
2536        ///
2537        /// This is a **required** field for requests.
2538        pub fn set_or_clear_intelligence_config<T>(mut self, v: std::option::Option<T>) -> Self
2539        where
2540            T: std::convert::Into<crate::model::IntelligenceConfig>,
2541        {
2542            self.0.request.intelligence_config = v.map(|x| x.into());
2543            self
2544        }
2545
2546        /// Sets the value of [update_mask][crate::model::UpdateOrganizationIntelligenceConfigRequest::update_mask].
2547        ///
2548        /// This is a **required** field for requests.
2549        pub fn set_update_mask<T>(mut self, v: T) -> Self
2550        where
2551            T: std::convert::Into<wkt::FieldMask>,
2552        {
2553            self.0.request.update_mask = std::option::Option::Some(v.into());
2554            self
2555        }
2556
2557        /// Sets or clears the value of [update_mask][crate::model::UpdateOrganizationIntelligenceConfigRequest::update_mask].
2558        ///
2559        /// This is a **required** field for requests.
2560        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2561        where
2562            T: std::convert::Into<wkt::FieldMask>,
2563        {
2564            self.0.request.update_mask = v.map(|x| x.into());
2565            self
2566        }
2567
2568        /// Sets the value of [request_id][crate::model::UpdateOrganizationIntelligenceConfigRequest::request_id].
2569        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2570            self.0.request.request_id = v.into();
2571            self
2572        }
2573    }
2574
2575    #[doc(hidden)]
2576    impl gax::options::internal::RequestBuilder for UpdateOrganizationIntelligenceConfig {
2577        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2578            &mut self.0.options
2579        }
2580    }
2581
2582    /// The request builder for [StorageControl::get_iam_policy][crate::client::StorageControl::get_iam_policy] calls.
2583    ///
2584    /// # Example
2585    /// ```no_run
2586    /// # use google_cloud_storage::builder;
2587    /// use builder::storage_control::GetIamPolicy;
2588    /// # tokio_test::block_on(async {
2589    ///
2590    /// let builder = prepare_request_builder();
2591    /// let response = builder.send().await?;
2592    /// # gax::Result::<()>::Ok(()) });
2593    ///
2594    /// fn prepare_request_builder() -> GetIamPolicy {
2595    ///   # panic!();
2596    ///   // ... details omitted ...
2597    /// }
2598    /// ```
2599    #[derive(Clone, Debug)]
2600    pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
2601
2602    impl GetIamPolicy {
2603        pub(crate) fn new(
2604            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2605        ) -> Self {
2606            Self(RequestBuilder::new(stub))
2607        }
2608
2609        /// Sets the full request, replacing any prior values.
2610        pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
2611            self.0.request = v.into();
2612            self
2613        }
2614
2615        /// Sets all the options, replacing any prior values.
2616        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2617            self.0.options = v.into();
2618            self
2619        }
2620
2621        /// Sends the request.
2622        pub async fn send(self) -> Result<iam_v1::model::Policy> {
2623            (*self.0.stub)
2624                .get_iam_policy(self.0.request, self.0.options)
2625                .await
2626                .map(gax::response::Response::into_body)
2627        }
2628
2629        /// Sets the value of [resource][iam_v1::model::GetIamPolicyRequest::resource].
2630        ///
2631        /// This is a **required** field for requests.
2632        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2633            self.0.request.resource = v.into();
2634            self
2635        }
2636
2637        /// Sets the value of [options][iam_v1::model::GetIamPolicyRequest::options].
2638        pub fn set_options<T>(mut self, v: T) -> Self
2639        where
2640            T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
2641        {
2642            self.0.request.options = std::option::Option::Some(v.into());
2643            self
2644        }
2645
2646        /// Sets or clears the value of [options][iam_v1::model::GetIamPolicyRequest::options].
2647        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
2648        where
2649            T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
2650        {
2651            self.0.request.options = v.map(|x| x.into());
2652            self
2653        }
2654    }
2655
2656    #[doc(hidden)]
2657    impl gax::options::internal::RequestBuilder for GetIamPolicy {
2658        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2659            &mut self.0.options
2660        }
2661    }
2662
2663    /// The request builder for [StorageControl::set_iam_policy][crate::client::StorageControl::set_iam_policy] calls.
2664    ///
2665    /// # Example
2666    /// ```no_run
2667    /// # use google_cloud_storage::builder;
2668    /// use builder::storage_control::SetIamPolicy;
2669    /// # tokio_test::block_on(async {
2670    ///
2671    /// let builder = prepare_request_builder();
2672    /// let response = builder.send().await?;
2673    /// # gax::Result::<()>::Ok(()) });
2674    ///
2675    /// fn prepare_request_builder() -> SetIamPolicy {
2676    ///   # panic!();
2677    ///   // ... details omitted ...
2678    /// }
2679    /// ```
2680    #[derive(Clone, Debug)]
2681    pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
2682
2683    impl SetIamPolicy {
2684        pub(crate) fn new(
2685            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2686        ) -> Self {
2687            Self(RequestBuilder::new(stub))
2688        }
2689
2690        /// Sets the full request, replacing any prior values.
2691        pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
2692            self.0.request = v.into();
2693            self
2694        }
2695
2696        /// Sets all the options, replacing any prior values.
2697        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2698            self.0.options = v.into();
2699            self
2700        }
2701
2702        /// Sends the request.
2703        pub async fn send(self) -> Result<iam_v1::model::Policy> {
2704            (*self.0.stub)
2705                .set_iam_policy(self.0.request, self.0.options)
2706                .await
2707                .map(gax::response::Response::into_body)
2708        }
2709
2710        /// Sets the value of [resource][iam_v1::model::SetIamPolicyRequest::resource].
2711        ///
2712        /// This is a **required** field for requests.
2713        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2714            self.0.request.resource = v.into();
2715            self
2716        }
2717
2718        /// Sets the value of [policy][iam_v1::model::SetIamPolicyRequest::policy].
2719        ///
2720        /// This is a **required** field for requests.
2721        pub fn set_policy<T>(mut self, v: T) -> Self
2722        where
2723            T: std::convert::Into<iam_v1::model::Policy>,
2724        {
2725            self.0.request.policy = std::option::Option::Some(v.into());
2726            self
2727        }
2728
2729        /// Sets or clears the value of [policy][iam_v1::model::SetIamPolicyRequest::policy].
2730        ///
2731        /// This is a **required** field for requests.
2732        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
2733        where
2734            T: std::convert::Into<iam_v1::model::Policy>,
2735        {
2736            self.0.request.policy = v.map(|x| x.into());
2737            self
2738        }
2739
2740        /// Sets the value of [update_mask][iam_v1::model::SetIamPolicyRequest::update_mask].
2741        pub fn set_update_mask<T>(mut self, v: T) -> Self
2742        where
2743            T: std::convert::Into<wkt::FieldMask>,
2744        {
2745            self.0.request.update_mask = std::option::Option::Some(v.into());
2746            self
2747        }
2748
2749        /// Sets or clears the value of [update_mask][iam_v1::model::SetIamPolicyRequest::update_mask].
2750        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2751        where
2752            T: std::convert::Into<wkt::FieldMask>,
2753        {
2754            self.0.request.update_mask = v.map(|x| x.into());
2755            self
2756        }
2757    }
2758
2759    #[doc(hidden)]
2760    impl gax::options::internal::RequestBuilder for SetIamPolicy {
2761        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2762            &mut self.0.options
2763        }
2764    }
2765
2766    /// The request builder for [StorageControl::test_iam_permissions][crate::client::StorageControl::test_iam_permissions] calls.
2767    ///
2768    /// # Example
2769    /// ```no_run
2770    /// # use google_cloud_storage::builder;
2771    /// use builder::storage_control::TestIamPermissions;
2772    /// # tokio_test::block_on(async {
2773    ///
2774    /// let builder = prepare_request_builder();
2775    /// let response = builder.send().await?;
2776    /// # gax::Result::<()>::Ok(()) });
2777    ///
2778    /// fn prepare_request_builder() -> TestIamPermissions {
2779    ///   # panic!();
2780    ///   // ... details omitted ...
2781    /// }
2782    /// ```
2783    #[derive(Clone, Debug)]
2784    pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
2785
2786    impl TestIamPermissions {
2787        pub(crate) fn new(
2788            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2789        ) -> Self {
2790            Self(RequestBuilder::new(stub))
2791        }
2792
2793        /// Sets the full request, replacing any prior values.
2794        pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
2795            mut self,
2796            v: V,
2797        ) -> Self {
2798            self.0.request = v.into();
2799            self
2800        }
2801
2802        /// Sets all the options, replacing any prior values.
2803        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2804            self.0.options = v.into();
2805            self
2806        }
2807
2808        /// Sends the request.
2809        pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
2810            (*self.0.stub)
2811                .test_iam_permissions(self.0.request, self.0.options)
2812                .await
2813                .map(gax::response::Response::into_body)
2814        }
2815
2816        /// Sets the value of [resource][iam_v1::model::TestIamPermissionsRequest::resource].
2817        ///
2818        /// This is a **required** field for requests.
2819        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2820            self.0.request.resource = v.into();
2821            self
2822        }
2823
2824        /// Sets the value of [permissions][iam_v1::model::TestIamPermissionsRequest::permissions].
2825        ///
2826        /// This is a **required** field for requests.
2827        pub fn set_permissions<T, V>(mut self, v: T) -> Self
2828        where
2829            T: std::iter::IntoIterator<Item = V>,
2830            V: std::convert::Into<std::string::String>,
2831        {
2832            use std::iter::Iterator;
2833            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
2834            self
2835        }
2836    }
2837
2838    #[doc(hidden)]
2839    impl gax::options::internal::RequestBuilder for TestIamPermissions {
2840        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2841            &mut self.0.options
2842        }
2843    }
2844
2845    /// The request builder for [StorageControl::get_operation][crate::client::StorageControl::get_operation] calls.
2846    ///
2847    /// # Example
2848    /// ```no_run
2849    /// # use google_cloud_storage::builder;
2850    /// use builder::storage_control::GetOperation;
2851    /// # tokio_test::block_on(async {
2852    ///
2853    /// let builder = prepare_request_builder();
2854    /// let response = builder.send().await?;
2855    /// # gax::Result::<()>::Ok(()) });
2856    ///
2857    /// fn prepare_request_builder() -> GetOperation {
2858    ///   # panic!();
2859    ///   // ... details omitted ...
2860    /// }
2861    /// ```
2862    #[derive(Clone, Debug)]
2863    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
2864
2865    impl GetOperation {
2866        pub(crate) fn new(
2867            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2868        ) -> Self {
2869            Self(RequestBuilder::new(stub))
2870        }
2871
2872        /// Sets the full request, replacing any prior values.
2873        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
2874            mut self,
2875            v: V,
2876        ) -> Self {
2877            self.0.request = v.into();
2878            self
2879        }
2880
2881        /// Sets all the options, replacing any prior values.
2882        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2883            self.0.options = v.into();
2884            self
2885        }
2886
2887        /// Sends the request.
2888        pub async fn send(self) -> Result<longrunning::model::Operation> {
2889            (*self.0.stub)
2890                .get_operation(self.0.request, self.0.options)
2891                .await
2892                .map(gax::response::Response::into_body)
2893        }
2894
2895        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
2896        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2897            self.0.request.name = v.into();
2898            self
2899        }
2900    }
2901
2902    #[doc(hidden)]
2903    impl gax::options::internal::RequestBuilder for GetOperation {
2904        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2905            &mut self.0.options
2906        }
2907    }
2908}