Skip to main content

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