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