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