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            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
594            if let Some(ref mut details) = poller_options.tracing {
595                details.method_name =
596                    "google_cloud_storage::client::StorageControl::rename_folder::until_done";
597            }
598
599            let stub = self.0.stub.clone();
600            let mut options = self.0.options.clone();
601            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
602            let query = move |name| {
603                let stub = stub.clone();
604                let options = options.clone();
605                async {
606                    let op = GetOperation::new(stub)
607                        .set_name(name)
608                        .with_options(options)
609                        .send()
610                        .await?;
611                    Ok(Operation::new(op))
612                }
613            };
614
615            let start = move || async {
616                let op = self.send().await?;
617                Ok(Operation::new(op))
618            };
619
620            use google_cloud_lro::internal::PollerExt;
621            {
622                google_cloud_lro::internal::new_poller(
623                    polling_error_policy,
624                    polling_backoff_policy,
625                    start,
626                    query,
627                )
628            }
629            .with_options(poller_options)
630        }
631
632        fn auto_populate(
633            mut req: crate::model::RenameFolderRequest,
634            force: bool,
635        ) -> crate::model::RenameFolderRequest {
636            if force || req.request_id.is_empty() {
637                req = req.set_request_id(uuid::Uuid::new_v4().to_string())
638            }
639            req
640        }
641
642        /// Sets the value of [name][crate::model::RenameFolderRequest::name].
643        ///
644        /// This is a **required** field for requests.
645        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
646            self.0.request.name = v.into();
647            self
648        }
649
650        /// Sets the value of [destination_folder_id][crate::model::RenameFolderRequest::destination_folder_id].
651        ///
652        /// This is a **required** field for requests.
653        pub fn set_destination_folder_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
654            self.0.request.destination_folder_id = v.into();
655            self
656        }
657
658        /// Sets the value of [if_metageneration_match][crate::model::RenameFolderRequest::if_metageneration_match].
659        pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
660        where
661            T: std::convert::Into<i64>,
662        {
663            self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
664            self
665        }
666
667        /// Sets or clears the value of [if_metageneration_match][crate::model::RenameFolderRequest::if_metageneration_match].
668        pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
669        where
670            T: std::convert::Into<i64>,
671        {
672            self.0.request.if_metageneration_match = v.map(|x| x.into());
673            self
674        }
675
676        /// Sets the value of [if_metageneration_not_match][crate::model::RenameFolderRequest::if_metageneration_not_match].
677        pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
678        where
679            T: std::convert::Into<i64>,
680        {
681            self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
682            self
683        }
684
685        /// Sets or clears the value of [if_metageneration_not_match][crate::model::RenameFolderRequest::if_metageneration_not_match].
686        pub fn set_or_clear_if_metageneration_not_match<T>(
687            mut self,
688            v: std::option::Option<T>,
689        ) -> Self
690        where
691            T: std::convert::Into<i64>,
692        {
693            self.0.request.if_metageneration_not_match = v.map(|x| x.into());
694            self
695        }
696
697        /// Sets the value of [request_id][crate::model::RenameFolderRequest::request_id].
698        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
699            self.0.request.request_id = v.into();
700            self
701        }
702    }
703
704    #[doc(hidden)]
705    impl crate::RequestBuilder for RenameFolder {
706        fn request_options(&mut self) -> &mut crate::RequestOptions {
707            &mut self.0.options
708        }
709    }
710
711    /// The request builder for [StorageControl::delete_folder_recursive][crate::client::StorageControl::delete_folder_recursive] calls.
712    ///
713    /// # Example
714    /// ```
715    /// # use google_cloud_storage::builder::storage_control::DeleteFolderRecursive;
716    /// # async fn sample() -> google_cloud_storage::Result<()> {
717    /// use google_cloud_lro::Poller;
718    ///
719    /// let builder = prepare_request_builder();
720    /// let response = builder.poller().until_done().await?;
721    /// # Ok(()) }
722    ///
723    /// fn prepare_request_builder() -> DeleteFolderRecursive {
724    ///   # panic!();
725    ///   // ... details omitted ...
726    /// }
727    /// ```
728    #[derive(Clone, Debug)]
729    pub struct DeleteFolderRecursive(RequestBuilder<crate::model::DeleteFolderRecursiveRequest>);
730
731    impl DeleteFolderRecursive {
732        pub(crate) fn new(
733            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
734        ) -> Self {
735            Self(RequestBuilder::new(stub))
736        }
737
738        /// Sets the full request, replacing any prior values.
739        pub fn with_request<V: Into<crate::model::DeleteFolderRecursiveRequest>>(
740            mut self,
741            v: V,
742        ) -> Self {
743            self.0.request = v.into();
744            self
745        }
746
747        /// Sets all the options, replacing any prior values.
748        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
749            self.0.options = v.into();
750            self
751        }
752
753        /// Sends the request.
754        ///
755        /// # Long running operations
756        ///
757        /// This starts, but does not poll, a longrunning operation. More information
758        /// on [delete_folder_recursive][crate::client::StorageControl::delete_folder_recursive].
759        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
760            let req = Self::auto_populate(self.0.request, false);
761            (*self.0.stub)
762                .delete_folder_recursive(req, self.0.options)
763                .await
764                .map(crate::Response::into_body)
765        }
766
767        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_folder_recursive`.
768        pub fn poller(
769            self,
770        ) -> impl google_cloud_lro::Poller<(), crate::model::DeleteFolderRecursiveMetadata>
771        {
772            type Operation = google_cloud_lro::internal::Operation<
773                wkt::Empty,
774                crate::model::DeleteFolderRecursiveMetadata,
775            >;
776            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
777            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
778            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
779            if let Some(ref mut details) = poller_options.tracing {
780                details.method_name = "google_cloud_storage::client::StorageControl::delete_folder_recursive::until_done";
781            }
782
783            let stub = self.0.stub.clone();
784            let mut options = self.0.options.clone();
785            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
786            let query = move |name| {
787                let stub = stub.clone();
788                let options = options.clone();
789                async {
790                    let op = GetOperation::new(stub)
791                        .set_name(name)
792                        .with_options(options)
793                        .send()
794                        .await?;
795                    Ok(Operation::new(op))
796                }
797            };
798
799            let start = move || async {
800                let op = self.send().await?;
801                Ok(Operation::new(op))
802            };
803
804            use google_cloud_lro::internal::PollerExt;
805            {
806                google_cloud_lro::internal::new_unit_response_poller(
807                    polling_error_policy,
808                    polling_backoff_policy,
809                    start,
810                    query,
811                )
812            }
813            .with_options(poller_options)
814        }
815
816        fn auto_populate(
817            mut req: crate::model::DeleteFolderRecursiveRequest,
818            force: bool,
819        ) -> crate::model::DeleteFolderRecursiveRequest {
820            if force || req.request_id.is_empty() {
821                req = req.set_request_id(uuid::Uuid::new_v4().to_string())
822            }
823            req
824        }
825
826        /// Sets the value of [name][crate::model::DeleteFolderRecursiveRequest::name].
827        ///
828        /// This is a **required** field for requests.
829        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
830            self.0.request.name = v.into();
831            self
832        }
833
834        /// Sets the value of [if_metageneration_match][crate::model::DeleteFolderRecursiveRequest::if_metageneration_match].
835        pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
836        where
837            T: std::convert::Into<i64>,
838        {
839            self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
840            self
841        }
842
843        /// Sets or clears the value of [if_metageneration_match][crate::model::DeleteFolderRecursiveRequest::if_metageneration_match].
844        pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
845        where
846            T: std::convert::Into<i64>,
847        {
848            self.0.request.if_metageneration_match = v.map(|x| x.into());
849            self
850        }
851
852        /// Sets the value of [if_metageneration_not_match][crate::model::DeleteFolderRecursiveRequest::if_metageneration_not_match].
853        pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
854        where
855            T: std::convert::Into<i64>,
856        {
857            self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
858            self
859        }
860
861        /// Sets or clears the value of [if_metageneration_not_match][crate::model::DeleteFolderRecursiveRequest::if_metageneration_not_match].
862        pub fn set_or_clear_if_metageneration_not_match<T>(
863            mut self,
864            v: std::option::Option<T>,
865        ) -> Self
866        where
867            T: std::convert::Into<i64>,
868        {
869            self.0.request.if_metageneration_not_match = v.map(|x| x.into());
870            self
871        }
872
873        /// Sets the value of [request_id][crate::model::DeleteFolderRecursiveRequest::request_id].
874        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
875            self.0.request.request_id = v.into();
876            self
877        }
878    }
879
880    #[doc(hidden)]
881    impl crate::RequestBuilder for DeleteFolderRecursive {
882        fn request_options(&mut self) -> &mut crate::RequestOptions {
883            &mut self.0.options
884        }
885    }
886
887    /// The request builder for [StorageControl::get_storage_layout][crate::client::StorageControl::get_storage_layout] calls.
888    ///
889    /// # Example
890    /// ```
891    /// # use google_cloud_storage::builder::storage_control::GetStorageLayout;
892    /// # async fn sample() -> google_cloud_storage::Result<()> {
893    ///
894    /// let builder = prepare_request_builder();
895    /// let response = builder.send().await?;
896    /// # Ok(()) }
897    ///
898    /// fn prepare_request_builder() -> GetStorageLayout {
899    ///   # panic!();
900    ///   // ... details omitted ...
901    /// }
902    /// ```
903    #[derive(Clone, Debug)]
904    pub struct GetStorageLayout(RequestBuilder<crate::model::GetStorageLayoutRequest>);
905
906    impl GetStorageLayout {
907        pub(crate) fn new(
908            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
909        ) -> Self {
910            Self(RequestBuilder::new(stub))
911        }
912
913        /// Sets the full request, replacing any prior values.
914        pub fn with_request<V: Into<crate::model::GetStorageLayoutRequest>>(
915            mut self,
916            v: V,
917        ) -> Self {
918            self.0.request = v.into();
919            self
920        }
921
922        /// Sets all the options, replacing any prior values.
923        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
924            self.0.options = v.into();
925            self
926        }
927
928        /// Sends the request.
929        pub async fn send(self) -> Result<crate::model::StorageLayout> {
930            let req = Self::auto_populate(self.0.request, false);
931            (*self.0.stub)
932                .get_storage_layout(req, self.0.options)
933                .await
934                .map(crate::Response::into_body)
935        }
936
937        fn auto_populate(
938            mut req: crate::model::GetStorageLayoutRequest,
939            force: bool,
940        ) -> crate::model::GetStorageLayoutRequest {
941            if force || req.request_id.is_empty() {
942                req = req.set_request_id(uuid::Uuid::new_v4().to_string())
943            }
944            req
945        }
946
947        /// Sets the value of [name][crate::model::GetStorageLayoutRequest::name].
948        ///
949        /// This is a **required** field for requests.
950        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
951            self.0.request.name = v.into();
952            self
953        }
954
955        /// Sets the value of [prefix][crate::model::GetStorageLayoutRequest::prefix].
956        pub fn set_prefix<T: Into<std::string::String>>(mut self, v: T) -> Self {
957            self.0.request.prefix = v.into();
958            self
959        }
960
961        /// Sets the value of [request_id][crate::model::GetStorageLayoutRequest::request_id].
962        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
963            self.0.request.request_id = v.into();
964            self
965        }
966    }
967
968    #[doc(hidden)]
969    impl crate::RequestBuilder for GetStorageLayout {
970        fn request_options(&mut self) -> &mut crate::RequestOptions {
971            &mut self.0.options
972        }
973    }
974
975    /// The request builder for [StorageControl::create_managed_folder][crate::client::StorageControl::create_managed_folder] calls.
976    ///
977    /// # Example
978    /// ```
979    /// # use google_cloud_storage::builder::storage_control::CreateManagedFolder;
980    /// # async fn sample() -> google_cloud_storage::Result<()> {
981    ///
982    /// let builder = prepare_request_builder();
983    /// let response = builder.send().await?;
984    /// # Ok(()) }
985    ///
986    /// fn prepare_request_builder() -> CreateManagedFolder {
987    ///   # panic!();
988    ///   // ... details omitted ...
989    /// }
990    /// ```
991    #[derive(Clone, Debug)]
992    pub struct CreateManagedFolder(RequestBuilder<crate::model::CreateManagedFolderRequest>);
993
994    impl CreateManagedFolder {
995        pub(crate) fn new(
996            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
997        ) -> Self {
998            Self(RequestBuilder::new(stub))
999        }
1000
1001        /// Sets the full request, replacing any prior values.
1002        pub fn with_request<V: Into<crate::model::CreateManagedFolderRequest>>(
1003            mut self,
1004            v: V,
1005        ) -> Self {
1006            self.0.request = v.into();
1007            self
1008        }
1009
1010        /// Sets all the options, replacing any prior values.
1011        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1012            self.0.options = v.into();
1013            self
1014        }
1015
1016        /// Sends the request.
1017        pub async fn send(self) -> Result<crate::model::ManagedFolder> {
1018            let req = Self::auto_populate(self.0.request, false);
1019            (*self.0.stub)
1020                .create_managed_folder(req, self.0.options)
1021                .await
1022                .map(crate::Response::into_body)
1023        }
1024
1025        fn auto_populate(
1026            mut req: crate::model::CreateManagedFolderRequest,
1027            force: bool,
1028        ) -> crate::model::CreateManagedFolderRequest {
1029            if force || req.request_id.is_empty() {
1030                req = req.set_request_id(uuid::Uuid::new_v4().to_string())
1031            }
1032            req
1033        }
1034
1035        /// Sets the value of [parent][crate::model::CreateManagedFolderRequest::parent].
1036        ///
1037        /// This is a **required** field for requests.
1038        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1039            self.0.request.parent = v.into();
1040            self
1041        }
1042
1043        /// Sets the value of [managed_folder][crate::model::CreateManagedFolderRequest::managed_folder].
1044        ///
1045        /// This is a **required** field for requests.
1046        pub fn set_managed_folder<T>(mut self, v: T) -> Self
1047        where
1048            T: std::convert::Into<crate::model::ManagedFolder>,
1049        {
1050            self.0.request.managed_folder = std::option::Option::Some(v.into());
1051            self
1052        }
1053
1054        /// Sets or clears the value of [managed_folder][crate::model::CreateManagedFolderRequest::managed_folder].
1055        ///
1056        /// This is a **required** field for requests.
1057        pub fn set_or_clear_managed_folder<T>(mut self, v: std::option::Option<T>) -> Self
1058        where
1059            T: std::convert::Into<crate::model::ManagedFolder>,
1060        {
1061            self.0.request.managed_folder = v.map(|x| x.into());
1062            self
1063        }
1064
1065        /// Sets the value of [managed_folder_id][crate::model::CreateManagedFolderRequest::managed_folder_id].
1066        ///
1067        /// This is a **required** field for requests.
1068        pub fn set_managed_folder_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1069            self.0.request.managed_folder_id = v.into();
1070            self
1071        }
1072
1073        /// Sets the value of [request_id][crate::model::CreateManagedFolderRequest::request_id].
1074        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1075            self.0.request.request_id = v.into();
1076            self
1077        }
1078    }
1079
1080    #[doc(hidden)]
1081    impl crate::RequestBuilder for CreateManagedFolder {
1082        fn request_options(&mut self) -> &mut crate::RequestOptions {
1083            &mut self.0.options
1084        }
1085    }
1086
1087    /// The request builder for [StorageControl::delete_managed_folder][crate::client::StorageControl::delete_managed_folder] calls.
1088    ///
1089    /// # Example
1090    /// ```
1091    /// # use google_cloud_storage::builder::storage_control::DeleteManagedFolder;
1092    /// # async fn sample() -> google_cloud_storage::Result<()> {
1093    ///
1094    /// let builder = prepare_request_builder();
1095    /// let response = builder.send().await?;
1096    /// # Ok(()) }
1097    ///
1098    /// fn prepare_request_builder() -> DeleteManagedFolder {
1099    ///   # panic!();
1100    ///   // ... details omitted ...
1101    /// }
1102    /// ```
1103    #[derive(Clone, Debug)]
1104    pub struct DeleteManagedFolder(RequestBuilder<crate::model::DeleteManagedFolderRequest>);
1105
1106    impl DeleteManagedFolder {
1107        pub(crate) fn new(
1108            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1109        ) -> Self {
1110            Self(RequestBuilder::new(stub))
1111        }
1112
1113        /// Sets the full request, replacing any prior values.
1114        pub fn with_request<V: Into<crate::model::DeleteManagedFolderRequest>>(
1115            mut self,
1116            v: V,
1117        ) -> Self {
1118            self.0.request = v.into();
1119            self
1120        }
1121
1122        /// Sets all the options, replacing any prior values.
1123        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1124            self.0.options = v.into();
1125            self
1126        }
1127
1128        /// Sends the request.
1129        pub async fn send(self) -> Result<()> {
1130            let req = Self::auto_populate(self.0.request, false);
1131            (*self.0.stub)
1132                .delete_managed_folder(req, self.0.options)
1133                .await
1134                .map(crate::Response::into_body)
1135        }
1136
1137        fn auto_populate(
1138            mut req: crate::model::DeleteManagedFolderRequest,
1139            force: bool,
1140        ) -> crate::model::DeleteManagedFolderRequest {
1141            if force || req.request_id.is_empty() {
1142                req = req.set_request_id(uuid::Uuid::new_v4().to_string())
1143            }
1144            req
1145        }
1146
1147        /// Sets the value of [name][crate::model::DeleteManagedFolderRequest::name].
1148        ///
1149        /// This is a **required** field for requests.
1150        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1151            self.0.request.name = v.into();
1152            self
1153        }
1154
1155        /// Sets the value of [if_metageneration_match][crate::model::DeleteManagedFolderRequest::if_metageneration_match].
1156        pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
1157        where
1158            T: std::convert::Into<i64>,
1159        {
1160            self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
1161            self
1162        }
1163
1164        /// Sets or clears the value of [if_metageneration_match][crate::model::DeleteManagedFolderRequest::if_metageneration_match].
1165        pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
1166        where
1167            T: std::convert::Into<i64>,
1168        {
1169            self.0.request.if_metageneration_match = v.map(|x| x.into());
1170            self
1171        }
1172
1173        /// Sets the value of [if_metageneration_not_match][crate::model::DeleteManagedFolderRequest::if_metageneration_not_match].
1174        pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
1175        where
1176            T: std::convert::Into<i64>,
1177        {
1178            self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
1179            self
1180        }
1181
1182        /// Sets or clears the value of [if_metageneration_not_match][crate::model::DeleteManagedFolderRequest::if_metageneration_not_match].
1183        pub fn set_or_clear_if_metageneration_not_match<T>(
1184            mut self,
1185            v: std::option::Option<T>,
1186        ) -> Self
1187        where
1188            T: std::convert::Into<i64>,
1189        {
1190            self.0.request.if_metageneration_not_match = v.map(|x| x.into());
1191            self
1192        }
1193
1194        /// Sets the value of [allow_non_empty][crate::model::DeleteManagedFolderRequest::allow_non_empty].
1195        pub fn set_allow_non_empty<T: Into<bool>>(mut self, v: T) -> Self {
1196            self.0.request.allow_non_empty = v.into();
1197            self
1198        }
1199
1200        /// Sets the value of [request_id][crate::model::DeleteManagedFolderRequest::request_id].
1201        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1202            self.0.request.request_id = v.into();
1203            self
1204        }
1205    }
1206
1207    #[doc(hidden)]
1208    impl crate::RequestBuilder for DeleteManagedFolder {
1209        fn request_options(&mut self) -> &mut crate::RequestOptions {
1210            &mut self.0.options
1211        }
1212    }
1213
1214    /// The request builder for [StorageControl::get_managed_folder][crate::client::StorageControl::get_managed_folder] calls.
1215    ///
1216    /// # Example
1217    /// ```
1218    /// # use google_cloud_storage::builder::storage_control::GetManagedFolder;
1219    /// # async fn sample() -> google_cloud_storage::Result<()> {
1220    ///
1221    /// let builder = prepare_request_builder();
1222    /// let response = builder.send().await?;
1223    /// # Ok(()) }
1224    ///
1225    /// fn prepare_request_builder() -> GetManagedFolder {
1226    ///   # panic!();
1227    ///   // ... details omitted ...
1228    /// }
1229    /// ```
1230    #[derive(Clone, Debug)]
1231    pub struct GetManagedFolder(RequestBuilder<crate::model::GetManagedFolderRequest>);
1232
1233    impl GetManagedFolder {
1234        pub(crate) fn new(
1235            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1236        ) -> Self {
1237            Self(RequestBuilder::new(stub))
1238        }
1239
1240        /// Sets the full request, replacing any prior values.
1241        pub fn with_request<V: Into<crate::model::GetManagedFolderRequest>>(
1242            mut self,
1243            v: V,
1244        ) -> Self {
1245            self.0.request = v.into();
1246            self
1247        }
1248
1249        /// Sets all the options, replacing any prior values.
1250        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1251            self.0.options = v.into();
1252            self
1253        }
1254
1255        /// Sends the request.
1256        pub async fn send(self) -> Result<crate::model::ManagedFolder> {
1257            let req = Self::auto_populate(self.0.request, false);
1258            (*self.0.stub)
1259                .get_managed_folder(req, self.0.options)
1260                .await
1261                .map(crate::Response::into_body)
1262        }
1263
1264        fn auto_populate(
1265            mut req: crate::model::GetManagedFolderRequest,
1266            force: bool,
1267        ) -> crate::model::GetManagedFolderRequest {
1268            if force || req.request_id.is_empty() {
1269                req = req.set_request_id(uuid::Uuid::new_v4().to_string())
1270            }
1271            req
1272        }
1273
1274        /// Sets the value of [name][crate::model::GetManagedFolderRequest::name].
1275        ///
1276        /// This is a **required** field for requests.
1277        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1278            self.0.request.name = v.into();
1279            self
1280        }
1281
1282        /// Sets the value of [if_metageneration_match][crate::model::GetManagedFolderRequest::if_metageneration_match].
1283        pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
1284        where
1285            T: std::convert::Into<i64>,
1286        {
1287            self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
1288            self
1289        }
1290
1291        /// Sets or clears the value of [if_metageneration_match][crate::model::GetManagedFolderRequest::if_metageneration_match].
1292        pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
1293        where
1294            T: std::convert::Into<i64>,
1295        {
1296            self.0.request.if_metageneration_match = v.map(|x| x.into());
1297            self
1298        }
1299
1300        /// Sets the value of [if_metageneration_not_match][crate::model::GetManagedFolderRequest::if_metageneration_not_match].
1301        pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
1302        where
1303            T: std::convert::Into<i64>,
1304        {
1305            self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
1306            self
1307        }
1308
1309        /// Sets or clears the value of [if_metageneration_not_match][crate::model::GetManagedFolderRequest::if_metageneration_not_match].
1310        pub fn set_or_clear_if_metageneration_not_match<T>(
1311            mut self,
1312            v: std::option::Option<T>,
1313        ) -> Self
1314        where
1315            T: std::convert::Into<i64>,
1316        {
1317            self.0.request.if_metageneration_not_match = v.map(|x| x.into());
1318            self
1319        }
1320
1321        /// Sets the value of [request_id][crate::model::GetManagedFolderRequest::request_id].
1322        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1323            self.0.request.request_id = v.into();
1324            self
1325        }
1326    }
1327
1328    #[doc(hidden)]
1329    impl crate::RequestBuilder for GetManagedFolder {
1330        fn request_options(&mut self) -> &mut crate::RequestOptions {
1331            &mut self.0.options
1332        }
1333    }
1334
1335    /// The request builder for [StorageControl::list_managed_folders][crate::client::StorageControl::list_managed_folders] calls.
1336    ///
1337    /// # Example
1338    /// ```
1339    /// # use google_cloud_storage::builder::storage_control::ListManagedFolders;
1340    /// # async fn sample() -> google_cloud_storage::Result<()> {
1341    /// use google_cloud_gax::paginator::ItemPaginator;
1342    ///
1343    /// let builder = prepare_request_builder();
1344    /// let mut items = builder.by_item();
1345    /// while let Some(result) = items.next().await {
1346    ///   let item = result?;
1347    /// }
1348    /// # Ok(()) }
1349    ///
1350    /// fn prepare_request_builder() -> ListManagedFolders {
1351    ///   # panic!();
1352    ///   // ... details omitted ...
1353    /// }
1354    /// ```
1355    #[derive(Clone, Debug)]
1356    pub struct ListManagedFolders(RequestBuilder<crate::model::ListManagedFoldersRequest>);
1357
1358    impl ListManagedFolders {
1359        pub(crate) fn new(
1360            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1361        ) -> Self {
1362            Self(RequestBuilder::new(stub))
1363        }
1364
1365        /// Sets the full request, replacing any prior values.
1366        pub fn with_request<V: Into<crate::model::ListManagedFoldersRequest>>(
1367            mut self,
1368            v: V,
1369        ) -> Self {
1370            self.0.request = v.into();
1371            self
1372        }
1373
1374        /// Sets all the options, replacing any prior values.
1375        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1376            self.0.options = v.into();
1377            self
1378        }
1379
1380        /// Sends the request.
1381        pub async fn send(self) -> Result<crate::model::ListManagedFoldersResponse> {
1382            let req = Self::auto_populate(self.0.request, false);
1383            (*self.0.stub)
1384                .list_managed_folders(req, self.0.options)
1385                .await
1386                .map(crate::Response::into_body)
1387        }
1388
1389        /// Streams each page in the collection.
1390        pub fn by_page(
1391            self,
1392        ) -> impl google_cloud_gax::paginator::Paginator<
1393            crate::model::ListManagedFoldersResponse,
1394            crate::Error,
1395        > {
1396            use std::clone::Clone;
1397            let token = self.0.request.page_token.clone();
1398            let execute = move |token: String| {
1399                let mut builder = self.clone();
1400                let initial = builder.0.request.page_token == token;
1401                builder.0.request = Self::auto_populate(builder.0.request, !initial);
1402                builder.0.request = builder.0.request.set_page_token(token);
1403                builder.send()
1404            };
1405            google_cloud_gax::paginator::internal::new_paginator(token, execute)
1406        }
1407
1408        /// Streams each item in the collection.
1409        pub fn by_item(
1410            self,
1411        ) -> impl google_cloud_gax::paginator::ItemPaginator<
1412            crate::model::ListManagedFoldersResponse,
1413            crate::Error,
1414        > {
1415            use google_cloud_gax::paginator::Paginator;
1416            self.by_page().items()
1417        }
1418
1419        fn auto_populate(
1420            mut req: crate::model::ListManagedFoldersRequest,
1421            force: bool,
1422        ) -> crate::model::ListManagedFoldersRequest {
1423            if force || req.request_id.is_empty() {
1424                req = req.set_request_id(uuid::Uuid::new_v4().to_string())
1425            }
1426            req
1427        }
1428
1429        /// Sets the value of [parent][crate::model::ListManagedFoldersRequest::parent].
1430        ///
1431        /// This is a **required** field for requests.
1432        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1433            self.0.request.parent = v.into();
1434            self
1435        }
1436
1437        /// Sets the value of [page_size][crate::model::ListManagedFoldersRequest::page_size].
1438        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1439            self.0.request.page_size = v.into();
1440            self
1441        }
1442
1443        /// Sets the value of [page_token][crate::model::ListManagedFoldersRequest::page_token].
1444        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1445            self.0.request.page_token = v.into();
1446            self
1447        }
1448
1449        /// Sets the value of [prefix][crate::model::ListManagedFoldersRequest::prefix].
1450        pub fn set_prefix<T: Into<std::string::String>>(mut self, v: T) -> Self {
1451            self.0.request.prefix = v.into();
1452            self
1453        }
1454
1455        /// Sets the value of [request_id][crate::model::ListManagedFoldersRequest::request_id].
1456        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1457            self.0.request.request_id = v.into();
1458            self
1459        }
1460    }
1461
1462    #[doc(hidden)]
1463    impl crate::RequestBuilder for ListManagedFolders {
1464        fn request_options(&mut self) -> &mut crate::RequestOptions {
1465            &mut self.0.options
1466        }
1467    }
1468
1469    /// The request builder for [StorageControl::update_managed_folder][crate::client::StorageControl::update_managed_folder] calls.
1470    ///
1471    /// # Example
1472    /// ```
1473    /// # use google_cloud_storage::builder::storage_control::UpdateManagedFolder;
1474    /// # async fn sample() -> google_cloud_storage::Result<()> {
1475    ///
1476    /// let builder = prepare_request_builder();
1477    /// let response = builder.send().await?;
1478    /// # Ok(()) }
1479    ///
1480    /// fn prepare_request_builder() -> UpdateManagedFolder {
1481    ///   # panic!();
1482    ///   // ... details omitted ...
1483    /// }
1484    /// ```
1485    #[derive(Clone, Debug)]
1486    pub struct UpdateManagedFolder(RequestBuilder<crate::model::UpdateManagedFolderRequest>);
1487
1488    impl UpdateManagedFolder {
1489        pub(crate) fn new(
1490            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1491        ) -> Self {
1492            Self(RequestBuilder::new(stub))
1493        }
1494
1495        /// Sets the full request, replacing any prior values.
1496        pub fn with_request<V: Into<crate::model::UpdateManagedFolderRequest>>(
1497            mut self,
1498            v: V,
1499        ) -> Self {
1500            self.0.request = v.into();
1501            self
1502        }
1503
1504        /// Sets all the options, replacing any prior values.
1505        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1506            self.0.options = v.into();
1507            self
1508        }
1509
1510        /// Sends the request.
1511        pub async fn send(self) -> Result<crate::model::ManagedFolder> {
1512            (*self.0.stub)
1513                .update_managed_folder(self.0.request, self.0.options)
1514                .await
1515                .map(crate::Response::into_body)
1516        }
1517
1518        /// Sets the value of [managed_folder][crate::model::UpdateManagedFolderRequest::managed_folder].
1519        ///
1520        /// This is a **required** field for requests.
1521        pub fn set_managed_folder<T>(mut self, v: T) -> Self
1522        where
1523            T: std::convert::Into<crate::model::ManagedFolder>,
1524        {
1525            self.0.request.managed_folder = std::option::Option::Some(v.into());
1526            self
1527        }
1528
1529        /// Sets or clears the value of [managed_folder][crate::model::UpdateManagedFolderRequest::managed_folder].
1530        ///
1531        /// This is a **required** field for requests.
1532        pub fn set_or_clear_managed_folder<T>(mut self, v: std::option::Option<T>) -> Self
1533        where
1534            T: std::convert::Into<crate::model::ManagedFolder>,
1535        {
1536            self.0.request.managed_folder = v.map(|x| x.into());
1537            self
1538        }
1539
1540        /// Sets the value of [update_mask][crate::model::UpdateManagedFolderRequest::update_mask].
1541        pub fn set_update_mask<T>(mut self, v: T) -> Self
1542        where
1543            T: std::convert::Into<wkt::FieldMask>,
1544        {
1545            self.0.request.update_mask = std::option::Option::Some(v.into());
1546            self
1547        }
1548
1549        /// Sets or clears the value of [update_mask][crate::model::UpdateManagedFolderRequest::update_mask].
1550        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1551        where
1552            T: std::convert::Into<wkt::FieldMask>,
1553        {
1554            self.0.request.update_mask = v.map(|x| x.into());
1555            self
1556        }
1557
1558        /// Sets the value of [if_metageneration_match][crate::model::UpdateManagedFolderRequest::if_metageneration_match].
1559        pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
1560        where
1561            T: std::convert::Into<i64>,
1562        {
1563            self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
1564            self
1565        }
1566
1567        /// Sets or clears the value of [if_metageneration_match][crate::model::UpdateManagedFolderRequest::if_metageneration_match].
1568        pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
1569        where
1570            T: std::convert::Into<i64>,
1571        {
1572            self.0.request.if_metageneration_match = v.map(|x| x.into());
1573            self
1574        }
1575
1576        /// Sets the value of [if_metageneration_not_match][crate::model::UpdateManagedFolderRequest::if_metageneration_not_match].
1577        pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
1578        where
1579            T: std::convert::Into<i64>,
1580        {
1581            self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
1582            self
1583        }
1584
1585        /// Sets or clears the value of [if_metageneration_not_match][crate::model::UpdateManagedFolderRequest::if_metageneration_not_match].
1586        pub fn set_or_clear_if_metageneration_not_match<T>(
1587            mut self,
1588            v: std::option::Option<T>,
1589        ) -> Self
1590        where
1591            T: std::convert::Into<i64>,
1592        {
1593            self.0.request.if_metageneration_not_match = v.map(|x| x.into());
1594            self
1595        }
1596
1597        /// Sets the value of [request_id][crate::model::UpdateManagedFolderRequest::request_id].
1598        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1599            self.0.request.request_id = v.into();
1600            self
1601        }
1602    }
1603
1604    #[doc(hidden)]
1605    impl crate::RequestBuilder for UpdateManagedFolder {
1606        fn request_options(&mut self) -> &mut crate::RequestOptions {
1607            &mut self.0.options
1608        }
1609    }
1610
1611    /// The request builder for [StorageControl::create_anywhere_cache][crate::client::StorageControl::create_anywhere_cache] calls.
1612    ///
1613    /// # Example
1614    /// ```
1615    /// # use google_cloud_storage::builder::storage_control::CreateAnywhereCache;
1616    /// # async fn sample() -> google_cloud_storage::Result<()> {
1617    /// use google_cloud_lro::Poller;
1618    ///
1619    /// let builder = prepare_request_builder();
1620    /// let response = builder.poller().until_done().await?;
1621    /// # Ok(()) }
1622    ///
1623    /// fn prepare_request_builder() -> CreateAnywhereCache {
1624    ///   # panic!();
1625    ///   // ... details omitted ...
1626    /// }
1627    /// ```
1628    #[derive(Clone, Debug)]
1629    pub struct CreateAnywhereCache(RequestBuilder<crate::model::CreateAnywhereCacheRequest>);
1630
1631    impl CreateAnywhereCache {
1632        pub(crate) fn new(
1633            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1634        ) -> Self {
1635            Self(RequestBuilder::new(stub))
1636        }
1637
1638        /// Sets the full request, replacing any prior values.
1639        pub fn with_request<V: Into<crate::model::CreateAnywhereCacheRequest>>(
1640            mut self,
1641            v: V,
1642        ) -> Self {
1643            self.0.request = v.into();
1644            self
1645        }
1646
1647        /// Sets all the options, replacing any prior values.
1648        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1649            self.0.options = v.into();
1650            self
1651        }
1652
1653        /// Sends the request.
1654        ///
1655        /// # Long running operations
1656        ///
1657        /// This starts, but does not poll, a longrunning operation. More information
1658        /// on [create_anywhere_cache][crate::client::StorageControl::create_anywhere_cache].
1659        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1660            let req = Self::auto_populate(self.0.request, false);
1661            (*self.0.stub)
1662                .create_anywhere_cache(req, self.0.options)
1663                .await
1664                .map(crate::Response::into_body)
1665        }
1666
1667        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_anywhere_cache`.
1668        pub fn poller(
1669            self,
1670        ) -> impl google_cloud_lro::Poller<
1671            crate::model::AnywhereCache,
1672            crate::model::CreateAnywhereCacheMetadata,
1673        > {
1674            type Operation = google_cloud_lro::internal::Operation<
1675                crate::model::AnywhereCache,
1676                crate::model::CreateAnywhereCacheMetadata,
1677            >;
1678            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1679            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1680            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1681            if let Some(ref mut details) = poller_options.tracing {
1682                details.method_name = "google_cloud_storage::client::StorageControl::create_anywhere_cache::until_done";
1683            }
1684
1685            let stub = self.0.stub.clone();
1686            let mut options = self.0.options.clone();
1687            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1688            let query = move |name| {
1689                let stub = stub.clone();
1690                let options = options.clone();
1691                async {
1692                    let op = GetOperation::new(stub)
1693                        .set_name(name)
1694                        .with_options(options)
1695                        .send()
1696                        .await?;
1697                    Ok(Operation::new(op))
1698                }
1699            };
1700
1701            let start = move || async {
1702                let op = self.send().await?;
1703                Ok(Operation::new(op))
1704            };
1705
1706            use google_cloud_lro::internal::PollerExt;
1707            {
1708                google_cloud_lro::internal::new_poller(
1709                    polling_error_policy,
1710                    polling_backoff_policy,
1711                    start,
1712                    query,
1713                )
1714            }
1715            .with_options(poller_options)
1716        }
1717
1718        fn auto_populate(
1719            mut req: crate::model::CreateAnywhereCacheRequest,
1720            force: bool,
1721        ) -> crate::model::CreateAnywhereCacheRequest {
1722            if force || req.request_id.is_empty() {
1723                req = req.set_request_id(uuid::Uuid::new_v4().to_string())
1724            }
1725            req
1726        }
1727
1728        /// Sets the value of [parent][crate::model::CreateAnywhereCacheRequest::parent].
1729        ///
1730        /// This is a **required** field for requests.
1731        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1732            self.0.request.parent = v.into();
1733            self
1734        }
1735
1736        /// Sets the value of [anywhere_cache][crate::model::CreateAnywhereCacheRequest::anywhere_cache].
1737        ///
1738        /// This is a **required** field for requests.
1739        pub fn set_anywhere_cache<T>(mut self, v: T) -> Self
1740        where
1741            T: std::convert::Into<crate::model::AnywhereCache>,
1742        {
1743            self.0.request.anywhere_cache = std::option::Option::Some(v.into());
1744            self
1745        }
1746
1747        /// Sets or clears the value of [anywhere_cache][crate::model::CreateAnywhereCacheRequest::anywhere_cache].
1748        ///
1749        /// This is a **required** field for requests.
1750        pub fn set_or_clear_anywhere_cache<T>(mut self, v: std::option::Option<T>) -> Self
1751        where
1752            T: std::convert::Into<crate::model::AnywhereCache>,
1753        {
1754            self.0.request.anywhere_cache = v.map(|x| x.into());
1755            self
1756        }
1757
1758        /// Sets the value of [request_id][crate::model::CreateAnywhereCacheRequest::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 CreateAnywhereCache {
1767        fn request_options(&mut self) -> &mut crate::RequestOptions {
1768            &mut self.0.options
1769        }
1770    }
1771
1772    /// The request builder for [StorageControl::update_anywhere_cache][crate::client::StorageControl::update_anywhere_cache] calls.
1773    ///
1774    /// # Example
1775    /// ```
1776    /// # use google_cloud_storage::builder::storage_control::UpdateAnywhereCache;
1777    /// # async fn sample() -> google_cloud_storage::Result<()> {
1778    /// use google_cloud_lro::Poller;
1779    ///
1780    /// let builder = prepare_request_builder();
1781    /// let response = builder.poller().until_done().await?;
1782    /// # Ok(()) }
1783    ///
1784    /// fn prepare_request_builder() -> UpdateAnywhereCache {
1785    ///   # panic!();
1786    ///   // ... details omitted ...
1787    /// }
1788    /// ```
1789    #[derive(Clone, Debug)]
1790    pub struct UpdateAnywhereCache(RequestBuilder<crate::model::UpdateAnywhereCacheRequest>);
1791
1792    impl UpdateAnywhereCache {
1793        pub(crate) fn new(
1794            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1795        ) -> Self {
1796            Self(RequestBuilder::new(stub))
1797        }
1798
1799        /// Sets the full request, replacing any prior values.
1800        pub fn with_request<V: Into<crate::model::UpdateAnywhereCacheRequest>>(
1801            mut self,
1802            v: V,
1803        ) -> Self {
1804            self.0.request = v.into();
1805            self
1806        }
1807
1808        /// Sets all the options, replacing any prior values.
1809        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1810            self.0.options = v.into();
1811            self
1812        }
1813
1814        /// Sends the request.
1815        ///
1816        /// # Long running operations
1817        ///
1818        /// This starts, but does not poll, a longrunning operation. More information
1819        /// on [update_anywhere_cache][crate::client::StorageControl::update_anywhere_cache].
1820        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1821            let req = Self::auto_populate(self.0.request, false);
1822            (*self.0.stub)
1823                .update_anywhere_cache(req, self.0.options)
1824                .await
1825                .map(crate::Response::into_body)
1826        }
1827
1828        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_anywhere_cache`.
1829        pub fn poller(
1830            self,
1831        ) -> impl google_cloud_lro::Poller<
1832            crate::model::AnywhereCache,
1833            crate::model::UpdateAnywhereCacheMetadata,
1834        > {
1835            type Operation = google_cloud_lro::internal::Operation<
1836                crate::model::AnywhereCache,
1837                crate::model::UpdateAnywhereCacheMetadata,
1838            >;
1839            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1840            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1841            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1842            if let Some(ref mut details) = poller_options.tracing {
1843                details.method_name = "google_cloud_storage::client::StorageControl::update_anywhere_cache::until_done";
1844            }
1845
1846            let stub = self.0.stub.clone();
1847            let mut options = self.0.options.clone();
1848            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1849            let query = move |name| {
1850                let stub = stub.clone();
1851                let options = options.clone();
1852                async {
1853                    let op = GetOperation::new(stub)
1854                        .set_name(name)
1855                        .with_options(options)
1856                        .send()
1857                        .await?;
1858                    Ok(Operation::new(op))
1859                }
1860            };
1861
1862            let start = move || async {
1863                let op = self.send().await?;
1864                Ok(Operation::new(op))
1865            };
1866
1867            use google_cloud_lro::internal::PollerExt;
1868            {
1869                google_cloud_lro::internal::new_poller(
1870                    polling_error_policy,
1871                    polling_backoff_policy,
1872                    start,
1873                    query,
1874                )
1875            }
1876            .with_options(poller_options)
1877        }
1878
1879        fn auto_populate(
1880            mut req: crate::model::UpdateAnywhereCacheRequest,
1881            force: bool,
1882        ) -> crate::model::UpdateAnywhereCacheRequest {
1883            if force || req.request_id.is_empty() {
1884                req = req.set_request_id(uuid::Uuid::new_v4().to_string())
1885            }
1886            req
1887        }
1888
1889        /// Sets the value of [anywhere_cache][crate::model::UpdateAnywhereCacheRequest::anywhere_cache].
1890        ///
1891        /// This is a **required** field for requests.
1892        pub fn set_anywhere_cache<T>(mut self, v: T) -> Self
1893        where
1894            T: std::convert::Into<crate::model::AnywhereCache>,
1895        {
1896            self.0.request.anywhere_cache = std::option::Option::Some(v.into());
1897            self
1898        }
1899
1900        /// Sets or clears the value of [anywhere_cache][crate::model::UpdateAnywhereCacheRequest::anywhere_cache].
1901        ///
1902        /// This is a **required** field for requests.
1903        pub fn set_or_clear_anywhere_cache<T>(mut self, v: std::option::Option<T>) -> Self
1904        where
1905            T: std::convert::Into<crate::model::AnywhereCache>,
1906        {
1907            self.0.request.anywhere_cache = v.map(|x| x.into());
1908            self
1909        }
1910
1911        /// Sets the value of [update_mask][crate::model::UpdateAnywhereCacheRequest::update_mask].
1912        ///
1913        /// This is a **required** field for requests.
1914        pub fn set_update_mask<T>(mut self, v: T) -> Self
1915        where
1916            T: std::convert::Into<wkt::FieldMask>,
1917        {
1918            self.0.request.update_mask = std::option::Option::Some(v.into());
1919            self
1920        }
1921
1922        /// Sets or clears the value of [update_mask][crate::model::UpdateAnywhereCacheRequest::update_mask].
1923        ///
1924        /// This is a **required** field for requests.
1925        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1926        where
1927            T: std::convert::Into<wkt::FieldMask>,
1928        {
1929            self.0.request.update_mask = v.map(|x| x.into());
1930            self
1931        }
1932
1933        /// Sets the value of [request_id][crate::model::UpdateAnywhereCacheRequest::request_id].
1934        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1935            self.0.request.request_id = v.into();
1936            self
1937        }
1938    }
1939
1940    #[doc(hidden)]
1941    impl crate::RequestBuilder for UpdateAnywhereCache {
1942        fn request_options(&mut self) -> &mut crate::RequestOptions {
1943            &mut self.0.options
1944        }
1945    }
1946
1947    /// The request builder for [StorageControl::disable_anywhere_cache][crate::client::StorageControl::disable_anywhere_cache] calls.
1948    ///
1949    /// # Example
1950    /// ```
1951    /// # use google_cloud_storage::builder::storage_control::DisableAnywhereCache;
1952    /// # async fn sample() -> google_cloud_storage::Result<()> {
1953    ///
1954    /// let builder = prepare_request_builder();
1955    /// let response = builder.send().await?;
1956    /// # Ok(()) }
1957    ///
1958    /// fn prepare_request_builder() -> DisableAnywhereCache {
1959    ///   # panic!();
1960    ///   // ... details omitted ...
1961    /// }
1962    /// ```
1963    #[derive(Clone, Debug)]
1964    pub struct DisableAnywhereCache(RequestBuilder<crate::model::DisableAnywhereCacheRequest>);
1965
1966    impl DisableAnywhereCache {
1967        pub(crate) fn new(
1968            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1969        ) -> Self {
1970            Self(RequestBuilder::new(stub))
1971        }
1972
1973        /// Sets the full request, replacing any prior values.
1974        pub fn with_request<V: Into<crate::model::DisableAnywhereCacheRequest>>(
1975            mut self,
1976            v: V,
1977        ) -> Self {
1978            self.0.request = v.into();
1979            self
1980        }
1981
1982        /// Sets all the options, replacing any prior values.
1983        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1984            self.0.options = v.into();
1985            self
1986        }
1987
1988        /// Sends the request.
1989        pub async fn send(self) -> Result<crate::model::AnywhereCache> {
1990            let req = Self::auto_populate(self.0.request, false);
1991            (*self.0.stub)
1992                .disable_anywhere_cache(req, self.0.options)
1993                .await
1994                .map(crate::Response::into_body)
1995        }
1996
1997        fn auto_populate(
1998            mut req: crate::model::DisableAnywhereCacheRequest,
1999            force: bool,
2000        ) -> crate::model::DisableAnywhereCacheRequest {
2001            if force || req.request_id.is_empty() {
2002                req = req.set_request_id(uuid::Uuid::new_v4().to_string())
2003            }
2004            req
2005        }
2006
2007        /// Sets the value of [name][crate::model::DisableAnywhereCacheRequest::name].
2008        ///
2009        /// This is a **required** field for requests.
2010        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2011            self.0.request.name = v.into();
2012            self
2013        }
2014
2015        /// Sets the value of [request_id][crate::model::DisableAnywhereCacheRequest::request_id].
2016        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2017            self.0.request.request_id = v.into();
2018            self
2019        }
2020    }
2021
2022    #[doc(hidden)]
2023    impl crate::RequestBuilder for DisableAnywhereCache {
2024        fn request_options(&mut self) -> &mut crate::RequestOptions {
2025            &mut self.0.options
2026        }
2027    }
2028
2029    /// The request builder for [StorageControl::pause_anywhere_cache][crate::client::StorageControl::pause_anywhere_cache] calls.
2030    ///
2031    /// # Example
2032    /// ```
2033    /// # use google_cloud_storage::builder::storage_control::PauseAnywhereCache;
2034    /// # async fn sample() -> google_cloud_storage::Result<()> {
2035    ///
2036    /// let builder = prepare_request_builder();
2037    /// let response = builder.send().await?;
2038    /// # Ok(()) }
2039    ///
2040    /// fn prepare_request_builder() -> PauseAnywhereCache {
2041    ///   # panic!();
2042    ///   // ... details omitted ...
2043    /// }
2044    /// ```
2045    #[derive(Clone, Debug)]
2046    pub struct PauseAnywhereCache(RequestBuilder<crate::model::PauseAnywhereCacheRequest>);
2047
2048    impl PauseAnywhereCache {
2049        pub(crate) fn new(
2050            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2051        ) -> Self {
2052            Self(RequestBuilder::new(stub))
2053        }
2054
2055        /// Sets the full request, replacing any prior values.
2056        pub fn with_request<V: Into<crate::model::PauseAnywhereCacheRequest>>(
2057            mut self,
2058            v: V,
2059        ) -> Self {
2060            self.0.request = v.into();
2061            self
2062        }
2063
2064        /// Sets all the options, replacing any prior values.
2065        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2066            self.0.options = v.into();
2067            self
2068        }
2069
2070        /// Sends the request.
2071        pub async fn send(self) -> Result<crate::model::AnywhereCache> {
2072            let req = Self::auto_populate(self.0.request, false);
2073            (*self.0.stub)
2074                .pause_anywhere_cache(req, self.0.options)
2075                .await
2076                .map(crate::Response::into_body)
2077        }
2078
2079        fn auto_populate(
2080            mut req: crate::model::PauseAnywhereCacheRequest,
2081            force: bool,
2082        ) -> crate::model::PauseAnywhereCacheRequest {
2083            if force || req.request_id.is_empty() {
2084                req = req.set_request_id(uuid::Uuid::new_v4().to_string())
2085            }
2086            req
2087        }
2088
2089        /// Sets the value of [name][crate::model::PauseAnywhereCacheRequest::name].
2090        ///
2091        /// This is a **required** field for requests.
2092        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2093            self.0.request.name = v.into();
2094            self
2095        }
2096
2097        /// Sets the value of [request_id][crate::model::PauseAnywhereCacheRequest::request_id].
2098        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2099            self.0.request.request_id = v.into();
2100            self
2101        }
2102    }
2103
2104    #[doc(hidden)]
2105    impl crate::RequestBuilder for PauseAnywhereCache {
2106        fn request_options(&mut self) -> &mut crate::RequestOptions {
2107            &mut self.0.options
2108        }
2109    }
2110
2111    /// The request builder for [StorageControl::resume_anywhere_cache][crate::client::StorageControl::resume_anywhere_cache] calls.
2112    ///
2113    /// # Example
2114    /// ```
2115    /// # use google_cloud_storage::builder::storage_control::ResumeAnywhereCache;
2116    /// # async fn sample() -> google_cloud_storage::Result<()> {
2117    ///
2118    /// let builder = prepare_request_builder();
2119    /// let response = builder.send().await?;
2120    /// # Ok(()) }
2121    ///
2122    /// fn prepare_request_builder() -> ResumeAnywhereCache {
2123    ///   # panic!();
2124    ///   // ... details omitted ...
2125    /// }
2126    /// ```
2127    #[derive(Clone, Debug)]
2128    pub struct ResumeAnywhereCache(RequestBuilder<crate::model::ResumeAnywhereCacheRequest>);
2129
2130    impl ResumeAnywhereCache {
2131        pub(crate) fn new(
2132            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2133        ) -> Self {
2134            Self(RequestBuilder::new(stub))
2135        }
2136
2137        /// Sets the full request, replacing any prior values.
2138        pub fn with_request<V: Into<crate::model::ResumeAnywhereCacheRequest>>(
2139            mut self,
2140            v: V,
2141        ) -> Self {
2142            self.0.request = v.into();
2143            self
2144        }
2145
2146        /// Sets all the options, replacing any prior values.
2147        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2148            self.0.options = v.into();
2149            self
2150        }
2151
2152        /// Sends the request.
2153        pub async fn send(self) -> Result<crate::model::AnywhereCache> {
2154            let req = Self::auto_populate(self.0.request, false);
2155            (*self.0.stub)
2156                .resume_anywhere_cache(req, self.0.options)
2157                .await
2158                .map(crate::Response::into_body)
2159        }
2160
2161        fn auto_populate(
2162            mut req: crate::model::ResumeAnywhereCacheRequest,
2163            force: bool,
2164        ) -> crate::model::ResumeAnywhereCacheRequest {
2165            if force || req.request_id.is_empty() {
2166                req = req.set_request_id(uuid::Uuid::new_v4().to_string())
2167            }
2168            req
2169        }
2170
2171        /// Sets the value of [name][crate::model::ResumeAnywhereCacheRequest::name].
2172        ///
2173        /// This is a **required** field for requests.
2174        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2175            self.0.request.name = v.into();
2176            self
2177        }
2178
2179        /// Sets the value of [request_id][crate::model::ResumeAnywhereCacheRequest::request_id].
2180        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2181            self.0.request.request_id = v.into();
2182            self
2183        }
2184    }
2185
2186    #[doc(hidden)]
2187    impl crate::RequestBuilder for ResumeAnywhereCache {
2188        fn request_options(&mut self) -> &mut crate::RequestOptions {
2189            &mut self.0.options
2190        }
2191    }
2192
2193    /// The request builder for [StorageControl::get_anywhere_cache][crate::client::StorageControl::get_anywhere_cache] calls.
2194    ///
2195    /// # Example
2196    /// ```
2197    /// # use google_cloud_storage::builder::storage_control::GetAnywhereCache;
2198    /// # async fn sample() -> google_cloud_storage::Result<()> {
2199    ///
2200    /// let builder = prepare_request_builder();
2201    /// let response = builder.send().await?;
2202    /// # Ok(()) }
2203    ///
2204    /// fn prepare_request_builder() -> GetAnywhereCache {
2205    ///   # panic!();
2206    ///   // ... details omitted ...
2207    /// }
2208    /// ```
2209    #[derive(Clone, Debug)]
2210    pub struct GetAnywhereCache(RequestBuilder<crate::model::GetAnywhereCacheRequest>);
2211
2212    impl GetAnywhereCache {
2213        pub(crate) fn new(
2214            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2215        ) -> Self {
2216            Self(RequestBuilder::new(stub))
2217        }
2218
2219        /// Sets the full request, replacing any prior values.
2220        pub fn with_request<V: Into<crate::model::GetAnywhereCacheRequest>>(
2221            mut self,
2222            v: V,
2223        ) -> Self {
2224            self.0.request = v.into();
2225            self
2226        }
2227
2228        /// Sets all the options, replacing any prior values.
2229        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2230            self.0.options = v.into();
2231            self
2232        }
2233
2234        /// Sends the request.
2235        pub async fn send(self) -> Result<crate::model::AnywhereCache> {
2236            let req = Self::auto_populate(self.0.request, false);
2237            (*self.0.stub)
2238                .get_anywhere_cache(req, self.0.options)
2239                .await
2240                .map(crate::Response::into_body)
2241        }
2242
2243        fn auto_populate(
2244            mut req: crate::model::GetAnywhereCacheRequest,
2245            force: bool,
2246        ) -> crate::model::GetAnywhereCacheRequest {
2247            if force || req.request_id.is_empty() {
2248                req = req.set_request_id(uuid::Uuid::new_v4().to_string())
2249            }
2250            req
2251        }
2252
2253        /// Sets the value of [name][crate::model::GetAnywhereCacheRequest::name].
2254        ///
2255        /// This is a **required** field for requests.
2256        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2257            self.0.request.name = v.into();
2258            self
2259        }
2260
2261        /// Sets the value of [request_id][crate::model::GetAnywhereCacheRequest::request_id].
2262        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2263            self.0.request.request_id = v.into();
2264            self
2265        }
2266    }
2267
2268    #[doc(hidden)]
2269    impl crate::RequestBuilder for GetAnywhereCache {
2270        fn request_options(&mut self) -> &mut crate::RequestOptions {
2271            &mut self.0.options
2272        }
2273    }
2274
2275    /// The request builder for [StorageControl::list_anywhere_caches][crate::client::StorageControl::list_anywhere_caches] calls.
2276    ///
2277    /// # Example
2278    /// ```
2279    /// # use google_cloud_storage::builder::storage_control::ListAnywhereCaches;
2280    /// # async fn sample() -> google_cloud_storage::Result<()> {
2281    /// use google_cloud_gax::paginator::ItemPaginator;
2282    ///
2283    /// let builder = prepare_request_builder();
2284    /// let mut items = builder.by_item();
2285    /// while let Some(result) = items.next().await {
2286    ///   let item = result?;
2287    /// }
2288    /// # Ok(()) }
2289    ///
2290    /// fn prepare_request_builder() -> ListAnywhereCaches {
2291    ///   # panic!();
2292    ///   // ... details omitted ...
2293    /// }
2294    /// ```
2295    #[derive(Clone, Debug)]
2296    pub struct ListAnywhereCaches(RequestBuilder<crate::model::ListAnywhereCachesRequest>);
2297
2298    impl ListAnywhereCaches {
2299        pub(crate) fn new(
2300            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2301        ) -> Self {
2302            Self(RequestBuilder::new(stub))
2303        }
2304
2305        /// Sets the full request, replacing any prior values.
2306        pub fn with_request<V: Into<crate::model::ListAnywhereCachesRequest>>(
2307            mut self,
2308            v: V,
2309        ) -> Self {
2310            self.0.request = v.into();
2311            self
2312        }
2313
2314        /// Sets all the options, replacing any prior values.
2315        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2316            self.0.options = v.into();
2317            self
2318        }
2319
2320        /// Sends the request.
2321        pub async fn send(self) -> Result<crate::model::ListAnywhereCachesResponse> {
2322            let req = Self::auto_populate(self.0.request, false);
2323            (*self.0.stub)
2324                .list_anywhere_caches(req, self.0.options)
2325                .await
2326                .map(crate::Response::into_body)
2327        }
2328
2329        /// Streams each page in the collection.
2330        pub fn by_page(
2331            self,
2332        ) -> impl google_cloud_gax::paginator::Paginator<
2333            crate::model::ListAnywhereCachesResponse,
2334            crate::Error,
2335        > {
2336            use std::clone::Clone;
2337            let token = self.0.request.page_token.clone();
2338            let execute = move |token: String| {
2339                let mut builder = self.clone();
2340                let initial = builder.0.request.page_token == token;
2341                builder.0.request = Self::auto_populate(builder.0.request, !initial);
2342                builder.0.request = builder.0.request.set_page_token(token);
2343                builder.send()
2344            };
2345            google_cloud_gax::paginator::internal::new_paginator(token, execute)
2346        }
2347
2348        /// Streams each item in the collection.
2349        pub fn by_item(
2350            self,
2351        ) -> impl google_cloud_gax::paginator::ItemPaginator<
2352            crate::model::ListAnywhereCachesResponse,
2353            crate::Error,
2354        > {
2355            use google_cloud_gax::paginator::Paginator;
2356            self.by_page().items()
2357        }
2358
2359        fn auto_populate(
2360            mut req: crate::model::ListAnywhereCachesRequest,
2361            force: bool,
2362        ) -> crate::model::ListAnywhereCachesRequest {
2363            if force || req.request_id.is_empty() {
2364                req = req.set_request_id(uuid::Uuid::new_v4().to_string())
2365            }
2366            req
2367        }
2368
2369        /// Sets the value of [parent][crate::model::ListAnywhereCachesRequest::parent].
2370        ///
2371        /// This is a **required** field for requests.
2372        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2373            self.0.request.parent = v.into();
2374            self
2375        }
2376
2377        /// Sets the value of [page_size][crate::model::ListAnywhereCachesRequest::page_size].
2378        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2379            self.0.request.page_size = v.into();
2380            self
2381        }
2382
2383        /// Sets the value of [page_token][crate::model::ListAnywhereCachesRequest::page_token].
2384        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2385            self.0.request.page_token = v.into();
2386            self
2387        }
2388
2389        /// Sets the value of [request_id][crate::model::ListAnywhereCachesRequest::request_id].
2390        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2391            self.0.request.request_id = v.into();
2392            self
2393        }
2394    }
2395
2396    #[doc(hidden)]
2397    impl crate::RequestBuilder for ListAnywhereCaches {
2398        fn request_options(&mut self) -> &mut crate::RequestOptions {
2399            &mut self.0.options
2400        }
2401    }
2402
2403    /// The request builder for [StorageControl::create_rapid_cache][crate::client::StorageControl::create_rapid_cache] calls.
2404    ///
2405    /// # Example
2406    /// ```
2407    /// # use google_cloud_storage::builder::storage_control::CreateRapidCache;
2408    /// # async fn sample() -> google_cloud_storage::Result<()> {
2409    /// use google_cloud_lro::Poller;
2410    ///
2411    /// let builder = prepare_request_builder();
2412    /// let response = builder.poller().until_done().await?;
2413    /// # Ok(()) }
2414    ///
2415    /// fn prepare_request_builder() -> CreateRapidCache {
2416    ///   # panic!();
2417    ///   // ... details omitted ...
2418    /// }
2419    /// ```
2420    #[derive(Clone, Debug)]
2421    pub struct CreateRapidCache(RequestBuilder<crate::model::CreateRapidCacheRequest>);
2422
2423    impl CreateRapidCache {
2424        pub(crate) fn new(
2425            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2426        ) -> Self {
2427            Self(RequestBuilder::new(stub))
2428        }
2429
2430        /// Sets the full request, replacing any prior values.
2431        pub fn with_request<V: Into<crate::model::CreateRapidCacheRequest>>(
2432            mut self,
2433            v: V,
2434        ) -> Self {
2435            self.0.request = v.into();
2436            self
2437        }
2438
2439        /// Sets all the options, replacing any prior values.
2440        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2441            self.0.options = v.into();
2442            self
2443        }
2444
2445        /// Sends the request.
2446        ///
2447        /// # Long running operations
2448        ///
2449        /// This starts, but does not poll, a longrunning operation. More information
2450        /// on [create_rapid_cache][crate::client::StorageControl::create_rapid_cache].
2451        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2452            (*self.0.stub)
2453                .create_rapid_cache(self.0.request, self.0.options)
2454                .await
2455                .map(crate::Response::into_body)
2456        }
2457
2458        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_rapid_cache`.
2459        pub fn poller(
2460            self,
2461        ) -> impl google_cloud_lro::Poller<
2462            crate::model::RapidCache,
2463            crate::model::CreateRapidCacheMetadata,
2464        > {
2465            type Operation = google_cloud_lro::internal::Operation<
2466                crate::model::RapidCache,
2467                crate::model::CreateRapidCacheMetadata,
2468            >;
2469            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2470            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2471            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
2472            if let Some(ref mut details) = poller_options.tracing {
2473                details.method_name =
2474                    "google_cloud_storage::client::StorageControl::create_rapid_cache::until_done";
2475            }
2476
2477            let stub = self.0.stub.clone();
2478            let mut options = self.0.options.clone();
2479            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2480            let query = move |name| {
2481                let stub = stub.clone();
2482                let options = options.clone();
2483                async {
2484                    let op = GetOperation::new(stub)
2485                        .set_name(name)
2486                        .with_options(options)
2487                        .send()
2488                        .await?;
2489                    Ok(Operation::new(op))
2490                }
2491            };
2492
2493            let start = move || async {
2494                let op = self.send().await?;
2495                Ok(Operation::new(op))
2496            };
2497
2498            use google_cloud_lro::internal::PollerExt;
2499            {
2500                google_cloud_lro::internal::new_poller(
2501                    polling_error_policy,
2502                    polling_backoff_policy,
2503                    start,
2504                    query,
2505                )
2506            }
2507            .with_options(poller_options)
2508        }
2509
2510        /// Sets the value of [parent][crate::model::CreateRapidCacheRequest::parent].
2511        ///
2512        /// This is a **required** field for requests.
2513        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2514            self.0.request.parent = v.into();
2515            self
2516        }
2517
2518        /// Sets the value of [rapid_cache][crate::model::CreateRapidCacheRequest::rapid_cache].
2519        ///
2520        /// This is a **required** field for requests.
2521        pub fn set_rapid_cache<T>(mut self, v: T) -> Self
2522        where
2523            T: std::convert::Into<crate::model::RapidCache>,
2524        {
2525            self.0.request.rapid_cache = std::option::Option::Some(v.into());
2526            self
2527        }
2528
2529        /// Sets or clears the value of [rapid_cache][crate::model::CreateRapidCacheRequest::rapid_cache].
2530        ///
2531        /// This is a **required** field for requests.
2532        pub fn set_or_clear_rapid_cache<T>(mut self, v: std::option::Option<T>) -> Self
2533        where
2534            T: std::convert::Into<crate::model::RapidCache>,
2535        {
2536            self.0.request.rapid_cache = v.map(|x| x.into());
2537            self
2538        }
2539
2540        /// Sets the value of [request_id][crate::model::CreateRapidCacheRequest::request_id].
2541        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2542            self.0.request.request_id = v.into();
2543            self
2544        }
2545    }
2546
2547    #[doc(hidden)]
2548    impl crate::RequestBuilder for CreateRapidCache {
2549        fn request_options(&mut self) -> &mut crate::RequestOptions {
2550            &mut self.0.options
2551        }
2552    }
2553
2554    /// The request builder for [StorageControl::update_rapid_cache][crate::client::StorageControl::update_rapid_cache] calls.
2555    ///
2556    /// # Example
2557    /// ```
2558    /// # use google_cloud_storage::builder::storage_control::UpdateRapidCache;
2559    /// # async fn sample() -> google_cloud_storage::Result<()> {
2560    /// use google_cloud_lro::Poller;
2561    ///
2562    /// let builder = prepare_request_builder();
2563    /// let response = builder.poller().until_done().await?;
2564    /// # Ok(()) }
2565    ///
2566    /// fn prepare_request_builder() -> UpdateRapidCache {
2567    ///   # panic!();
2568    ///   // ... details omitted ...
2569    /// }
2570    /// ```
2571    #[derive(Clone, Debug)]
2572    pub struct UpdateRapidCache(RequestBuilder<crate::model::UpdateRapidCacheRequest>);
2573
2574    impl UpdateRapidCache {
2575        pub(crate) fn new(
2576            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2577        ) -> Self {
2578            Self(RequestBuilder::new(stub))
2579        }
2580
2581        /// Sets the full request, replacing any prior values.
2582        pub fn with_request<V: Into<crate::model::UpdateRapidCacheRequest>>(
2583            mut self,
2584            v: V,
2585        ) -> Self {
2586            self.0.request = v.into();
2587            self
2588        }
2589
2590        /// Sets all the options, replacing any prior values.
2591        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2592            self.0.options = v.into();
2593            self
2594        }
2595
2596        /// Sends the request.
2597        ///
2598        /// # Long running operations
2599        ///
2600        /// This starts, but does not poll, a longrunning operation. More information
2601        /// on [update_rapid_cache][crate::client::StorageControl::update_rapid_cache].
2602        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2603            (*self.0.stub)
2604                .update_rapid_cache(self.0.request, self.0.options)
2605                .await
2606                .map(crate::Response::into_body)
2607        }
2608
2609        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_rapid_cache`.
2610        pub fn poller(
2611            self,
2612        ) -> impl google_cloud_lro::Poller<
2613            crate::model::RapidCache,
2614            crate::model::UpdateRapidCacheMetadata,
2615        > {
2616            type Operation = google_cloud_lro::internal::Operation<
2617                crate::model::RapidCache,
2618                crate::model::UpdateRapidCacheMetadata,
2619            >;
2620            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2621            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2622            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
2623            if let Some(ref mut details) = poller_options.tracing {
2624                details.method_name =
2625                    "google_cloud_storage::client::StorageControl::update_rapid_cache::until_done";
2626            }
2627
2628            let stub = self.0.stub.clone();
2629            let mut options = self.0.options.clone();
2630            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2631            let query = move |name| {
2632                let stub = stub.clone();
2633                let options = options.clone();
2634                async {
2635                    let op = GetOperation::new(stub)
2636                        .set_name(name)
2637                        .with_options(options)
2638                        .send()
2639                        .await?;
2640                    Ok(Operation::new(op))
2641                }
2642            };
2643
2644            let start = move || async {
2645                let op = self.send().await?;
2646                Ok(Operation::new(op))
2647            };
2648
2649            use google_cloud_lro::internal::PollerExt;
2650            {
2651                google_cloud_lro::internal::new_poller(
2652                    polling_error_policy,
2653                    polling_backoff_policy,
2654                    start,
2655                    query,
2656                )
2657            }
2658            .with_options(poller_options)
2659        }
2660
2661        /// Sets the value of [rapid_cache][crate::model::UpdateRapidCacheRequest::rapid_cache].
2662        ///
2663        /// This is a **required** field for requests.
2664        pub fn set_rapid_cache<T>(mut self, v: T) -> Self
2665        where
2666            T: std::convert::Into<crate::model::RapidCache>,
2667        {
2668            self.0.request.rapid_cache = std::option::Option::Some(v.into());
2669            self
2670        }
2671
2672        /// Sets or clears the value of [rapid_cache][crate::model::UpdateRapidCacheRequest::rapid_cache].
2673        ///
2674        /// This is a **required** field for requests.
2675        pub fn set_or_clear_rapid_cache<T>(mut self, v: std::option::Option<T>) -> Self
2676        where
2677            T: std::convert::Into<crate::model::RapidCache>,
2678        {
2679            self.0.request.rapid_cache = v.map(|x| x.into());
2680            self
2681        }
2682
2683        /// Sets the value of [update_mask][crate::model::UpdateRapidCacheRequest::update_mask].
2684        ///
2685        /// This is a **required** field for requests.
2686        pub fn set_update_mask<T>(mut self, v: T) -> Self
2687        where
2688            T: std::convert::Into<wkt::FieldMask>,
2689        {
2690            self.0.request.update_mask = std::option::Option::Some(v.into());
2691            self
2692        }
2693
2694        /// Sets or clears the value of [update_mask][crate::model::UpdateRapidCacheRequest::update_mask].
2695        ///
2696        /// This is a **required** field for requests.
2697        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2698        where
2699            T: std::convert::Into<wkt::FieldMask>,
2700        {
2701            self.0.request.update_mask = v.map(|x| x.into());
2702            self
2703        }
2704
2705        /// Sets the value of [request_id][crate::model::UpdateRapidCacheRequest::request_id].
2706        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2707            self.0.request.request_id = v.into();
2708            self
2709        }
2710    }
2711
2712    #[doc(hidden)]
2713    impl crate::RequestBuilder for UpdateRapidCache {
2714        fn request_options(&mut self) -> &mut crate::RequestOptions {
2715            &mut self.0.options
2716        }
2717    }
2718
2719    /// The request builder for [StorageControl::get_rapid_cache][crate::client::StorageControl::get_rapid_cache] calls.
2720    ///
2721    /// # Example
2722    /// ```
2723    /// # use google_cloud_storage::builder::storage_control::GetRapidCache;
2724    /// # async fn sample() -> google_cloud_storage::Result<()> {
2725    ///
2726    /// let builder = prepare_request_builder();
2727    /// let response = builder.send().await?;
2728    /// # Ok(()) }
2729    ///
2730    /// fn prepare_request_builder() -> GetRapidCache {
2731    ///   # panic!();
2732    ///   // ... details omitted ...
2733    /// }
2734    /// ```
2735    #[derive(Clone, Debug)]
2736    pub struct GetRapidCache(RequestBuilder<crate::model::GetRapidCacheRequest>);
2737
2738    impl GetRapidCache {
2739        pub(crate) fn new(
2740            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2741        ) -> Self {
2742            Self(RequestBuilder::new(stub))
2743        }
2744
2745        /// Sets the full request, replacing any prior values.
2746        pub fn with_request<V: Into<crate::model::GetRapidCacheRequest>>(mut self, v: V) -> Self {
2747            self.0.request = v.into();
2748            self
2749        }
2750
2751        /// Sets all the options, replacing any prior values.
2752        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2753            self.0.options = v.into();
2754            self
2755        }
2756
2757        /// Sends the request.
2758        pub async fn send(self) -> Result<crate::model::RapidCache> {
2759            (*self.0.stub)
2760                .get_rapid_cache(self.0.request, self.0.options)
2761                .await
2762                .map(crate::Response::into_body)
2763        }
2764
2765        /// Sets the value of [name][crate::model::GetRapidCacheRequest::name].
2766        ///
2767        /// This is a **required** field for requests.
2768        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2769            self.0.request.name = v.into();
2770            self
2771        }
2772
2773        /// Sets the value of [request_id][crate::model::GetRapidCacheRequest::request_id].
2774        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2775            self.0.request.request_id = v.into();
2776            self
2777        }
2778    }
2779
2780    #[doc(hidden)]
2781    impl crate::RequestBuilder for GetRapidCache {
2782        fn request_options(&mut self) -> &mut crate::RequestOptions {
2783            &mut self.0.options
2784        }
2785    }
2786
2787    /// The request builder for [StorageControl::list_rapid_caches][crate::client::StorageControl::list_rapid_caches] calls.
2788    ///
2789    /// # Example
2790    /// ```
2791    /// # use google_cloud_storage::builder::storage_control::ListRapidCaches;
2792    /// # async fn sample() -> google_cloud_storage::Result<()> {
2793    /// use google_cloud_gax::paginator::ItemPaginator;
2794    ///
2795    /// let builder = prepare_request_builder();
2796    /// let mut items = builder.by_item();
2797    /// while let Some(result) = items.next().await {
2798    ///   let item = result?;
2799    /// }
2800    /// # Ok(()) }
2801    ///
2802    /// fn prepare_request_builder() -> ListRapidCaches {
2803    ///   # panic!();
2804    ///   // ... details omitted ...
2805    /// }
2806    /// ```
2807    #[derive(Clone, Debug)]
2808    pub struct ListRapidCaches(RequestBuilder<crate::model::ListRapidCachesRequest>);
2809
2810    impl ListRapidCaches {
2811        pub(crate) fn new(
2812            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2813        ) -> Self {
2814            Self(RequestBuilder::new(stub))
2815        }
2816
2817        /// Sets the full request, replacing any prior values.
2818        pub fn with_request<V: Into<crate::model::ListRapidCachesRequest>>(mut self, v: V) -> Self {
2819            self.0.request = v.into();
2820            self
2821        }
2822
2823        /// Sets all the options, replacing any prior values.
2824        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2825            self.0.options = v.into();
2826            self
2827        }
2828
2829        /// Sends the request.
2830        pub async fn send(self) -> Result<crate::model::ListRapidCachesResponse> {
2831            (*self.0.stub)
2832                .list_rapid_caches(self.0.request, self.0.options)
2833                .await
2834                .map(crate::Response::into_body)
2835        }
2836
2837        /// Streams each page in the collection.
2838        pub fn by_page(
2839            self,
2840        ) -> impl google_cloud_gax::paginator::Paginator<
2841            crate::model::ListRapidCachesResponse,
2842            crate::Error,
2843        > {
2844            use std::clone::Clone;
2845            let token = self.0.request.page_token.clone();
2846            let execute = move |token: String| {
2847                let mut builder = self.clone();
2848                builder.0.request = builder.0.request.set_page_token(token);
2849                builder.send()
2850            };
2851            google_cloud_gax::paginator::internal::new_paginator(token, execute)
2852        }
2853
2854        /// Streams each item in the collection.
2855        pub fn by_item(
2856            self,
2857        ) -> impl google_cloud_gax::paginator::ItemPaginator<
2858            crate::model::ListRapidCachesResponse,
2859            crate::Error,
2860        > {
2861            use google_cloud_gax::paginator::Paginator;
2862            self.by_page().items()
2863        }
2864
2865        /// Sets the value of [parent][crate::model::ListRapidCachesRequest::parent].
2866        ///
2867        /// This is a **required** field for requests.
2868        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2869            self.0.request.parent = v.into();
2870            self
2871        }
2872
2873        /// Sets the value of [page_size][crate::model::ListRapidCachesRequest::page_size].
2874        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2875            self.0.request.page_size = v.into();
2876            self
2877        }
2878
2879        /// Sets the value of [page_token][crate::model::ListRapidCachesRequest::page_token].
2880        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2881            self.0.request.page_token = v.into();
2882            self
2883        }
2884
2885        /// Sets the value of [request_id][crate::model::ListRapidCachesRequest::request_id].
2886        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2887            self.0.request.request_id = v.into();
2888            self
2889        }
2890    }
2891
2892    #[doc(hidden)]
2893    impl crate::RequestBuilder for ListRapidCaches {
2894        fn request_options(&mut self) -> &mut crate::RequestOptions {
2895            &mut self.0.options
2896        }
2897    }
2898
2899    /// The request builder for [StorageControl::get_project_intelligence_config][crate::client::StorageControl::get_project_intelligence_config] calls.
2900    ///
2901    /// # Example
2902    /// ```
2903    /// # use google_cloud_storage::builder::storage_control::GetProjectIntelligenceConfig;
2904    /// # async fn sample() -> google_cloud_storage::Result<()> {
2905    ///
2906    /// let builder = prepare_request_builder();
2907    /// let response = builder.send().await?;
2908    /// # Ok(()) }
2909    ///
2910    /// fn prepare_request_builder() -> GetProjectIntelligenceConfig {
2911    ///   # panic!();
2912    ///   // ... details omitted ...
2913    /// }
2914    /// ```
2915    #[derive(Clone, Debug)]
2916    pub struct GetProjectIntelligenceConfig(
2917        RequestBuilder<crate::model::GetProjectIntelligenceConfigRequest>,
2918    );
2919
2920    impl GetProjectIntelligenceConfig {
2921        pub(crate) fn new(
2922            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2923        ) -> Self {
2924            Self(RequestBuilder::new(stub))
2925        }
2926
2927        /// Sets the full request, replacing any prior values.
2928        pub fn with_request<V: Into<crate::model::GetProjectIntelligenceConfigRequest>>(
2929            mut self,
2930            v: V,
2931        ) -> Self {
2932            self.0.request = v.into();
2933            self
2934        }
2935
2936        /// Sets all the options, replacing any prior values.
2937        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2938            self.0.options = v.into();
2939            self
2940        }
2941
2942        /// Sends the request.
2943        pub async fn send(self) -> Result<crate::model::IntelligenceConfig> {
2944            (*self.0.stub)
2945                .get_project_intelligence_config(self.0.request, self.0.options)
2946                .await
2947                .map(crate::Response::into_body)
2948        }
2949
2950        /// Sets the value of [name][crate::model::GetProjectIntelligenceConfigRequest::name].
2951        ///
2952        /// This is a **required** field for requests.
2953        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2954            self.0.request.name = v.into();
2955            self
2956        }
2957    }
2958
2959    #[doc(hidden)]
2960    impl crate::RequestBuilder for GetProjectIntelligenceConfig {
2961        fn request_options(&mut self) -> &mut crate::RequestOptions {
2962            &mut self.0.options
2963        }
2964    }
2965
2966    /// The request builder for [StorageControl::update_project_intelligence_config][crate::client::StorageControl::update_project_intelligence_config] calls.
2967    ///
2968    /// # Example
2969    /// ```
2970    /// # use google_cloud_storage::builder::storage_control::UpdateProjectIntelligenceConfig;
2971    /// # async fn sample() -> google_cloud_storage::Result<()> {
2972    ///
2973    /// let builder = prepare_request_builder();
2974    /// let response = builder.send().await?;
2975    /// # Ok(()) }
2976    ///
2977    /// fn prepare_request_builder() -> UpdateProjectIntelligenceConfig {
2978    ///   # panic!();
2979    ///   // ... details omitted ...
2980    /// }
2981    /// ```
2982    #[derive(Clone, Debug)]
2983    pub struct UpdateProjectIntelligenceConfig(
2984        RequestBuilder<crate::model::UpdateProjectIntelligenceConfigRequest>,
2985    );
2986
2987    impl UpdateProjectIntelligenceConfig {
2988        pub(crate) fn new(
2989            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2990        ) -> Self {
2991            Self(RequestBuilder::new(stub))
2992        }
2993
2994        /// Sets the full request, replacing any prior values.
2995        pub fn with_request<V: Into<crate::model::UpdateProjectIntelligenceConfigRequest>>(
2996            mut self,
2997            v: V,
2998        ) -> Self {
2999            self.0.request = v.into();
3000            self
3001        }
3002
3003        /// Sets all the options, replacing any prior values.
3004        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3005            self.0.options = v.into();
3006            self
3007        }
3008
3009        /// Sends the request.
3010        pub async fn send(self) -> Result<crate::model::IntelligenceConfig> {
3011            (*self.0.stub)
3012                .update_project_intelligence_config(self.0.request, self.0.options)
3013                .await
3014                .map(crate::Response::into_body)
3015        }
3016
3017        /// Sets the value of [intelligence_config][crate::model::UpdateProjectIntelligenceConfigRequest::intelligence_config].
3018        ///
3019        /// This is a **required** field for requests.
3020        pub fn set_intelligence_config<T>(mut self, v: T) -> Self
3021        where
3022            T: std::convert::Into<crate::model::IntelligenceConfig>,
3023        {
3024            self.0.request.intelligence_config = std::option::Option::Some(v.into());
3025            self
3026        }
3027
3028        /// Sets or clears the value of [intelligence_config][crate::model::UpdateProjectIntelligenceConfigRequest::intelligence_config].
3029        ///
3030        /// This is a **required** field for requests.
3031        pub fn set_or_clear_intelligence_config<T>(mut self, v: std::option::Option<T>) -> Self
3032        where
3033            T: std::convert::Into<crate::model::IntelligenceConfig>,
3034        {
3035            self.0.request.intelligence_config = v.map(|x| x.into());
3036            self
3037        }
3038
3039        /// Sets the value of [update_mask][crate::model::UpdateProjectIntelligenceConfigRequest::update_mask].
3040        ///
3041        /// This is a **required** field for requests.
3042        pub fn set_update_mask<T>(mut self, v: T) -> Self
3043        where
3044            T: std::convert::Into<wkt::FieldMask>,
3045        {
3046            self.0.request.update_mask = std::option::Option::Some(v.into());
3047            self
3048        }
3049
3050        /// Sets or clears the value of [update_mask][crate::model::UpdateProjectIntelligenceConfigRequest::update_mask].
3051        ///
3052        /// This is a **required** field for requests.
3053        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3054        where
3055            T: std::convert::Into<wkt::FieldMask>,
3056        {
3057            self.0.request.update_mask = v.map(|x| x.into());
3058            self
3059        }
3060
3061        /// Sets the value of [request_id][crate::model::UpdateProjectIntelligenceConfigRequest::request_id].
3062        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3063            self.0.request.request_id = v.into();
3064            self
3065        }
3066    }
3067
3068    #[doc(hidden)]
3069    impl crate::RequestBuilder for UpdateProjectIntelligenceConfig {
3070        fn request_options(&mut self) -> &mut crate::RequestOptions {
3071            &mut self.0.options
3072        }
3073    }
3074
3075    /// The request builder for [StorageControl::get_folder_intelligence_config][crate::client::StorageControl::get_folder_intelligence_config] calls.
3076    ///
3077    /// # Example
3078    /// ```
3079    /// # use google_cloud_storage::builder::storage_control::GetFolderIntelligenceConfig;
3080    /// # async fn sample() -> google_cloud_storage::Result<()> {
3081    ///
3082    /// let builder = prepare_request_builder();
3083    /// let response = builder.send().await?;
3084    /// # Ok(()) }
3085    ///
3086    /// fn prepare_request_builder() -> GetFolderIntelligenceConfig {
3087    ///   # panic!();
3088    ///   // ... details omitted ...
3089    /// }
3090    /// ```
3091    #[derive(Clone, Debug)]
3092    pub struct GetFolderIntelligenceConfig(
3093        RequestBuilder<crate::model::GetFolderIntelligenceConfigRequest>,
3094    );
3095
3096    impl GetFolderIntelligenceConfig {
3097        pub(crate) fn new(
3098            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
3099        ) -> Self {
3100            Self(RequestBuilder::new(stub))
3101        }
3102
3103        /// Sets the full request, replacing any prior values.
3104        pub fn with_request<V: Into<crate::model::GetFolderIntelligenceConfigRequest>>(
3105            mut self,
3106            v: V,
3107        ) -> Self {
3108            self.0.request = v.into();
3109            self
3110        }
3111
3112        /// Sets all the options, replacing any prior values.
3113        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3114            self.0.options = v.into();
3115            self
3116        }
3117
3118        /// Sends the request.
3119        pub async fn send(self) -> Result<crate::model::IntelligenceConfig> {
3120            (*self.0.stub)
3121                .get_folder_intelligence_config(self.0.request, self.0.options)
3122                .await
3123                .map(crate::Response::into_body)
3124        }
3125
3126        /// Sets the value of [name][crate::model::GetFolderIntelligenceConfigRequest::name].
3127        ///
3128        /// This is a **required** field for requests.
3129        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3130            self.0.request.name = v.into();
3131            self
3132        }
3133    }
3134
3135    #[doc(hidden)]
3136    impl crate::RequestBuilder for GetFolderIntelligenceConfig {
3137        fn request_options(&mut self) -> &mut crate::RequestOptions {
3138            &mut self.0.options
3139        }
3140    }
3141
3142    /// The request builder for [StorageControl::update_folder_intelligence_config][crate::client::StorageControl::update_folder_intelligence_config] calls.
3143    ///
3144    /// # Example
3145    /// ```
3146    /// # use google_cloud_storage::builder::storage_control::UpdateFolderIntelligenceConfig;
3147    /// # async fn sample() -> google_cloud_storage::Result<()> {
3148    ///
3149    /// let builder = prepare_request_builder();
3150    /// let response = builder.send().await?;
3151    /// # Ok(()) }
3152    ///
3153    /// fn prepare_request_builder() -> UpdateFolderIntelligenceConfig {
3154    ///   # panic!();
3155    ///   // ... details omitted ...
3156    /// }
3157    /// ```
3158    #[derive(Clone, Debug)]
3159    pub struct UpdateFolderIntelligenceConfig(
3160        RequestBuilder<crate::model::UpdateFolderIntelligenceConfigRequest>,
3161    );
3162
3163    impl UpdateFolderIntelligenceConfig {
3164        pub(crate) fn new(
3165            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
3166        ) -> Self {
3167            Self(RequestBuilder::new(stub))
3168        }
3169
3170        /// Sets the full request, replacing any prior values.
3171        pub fn with_request<V: Into<crate::model::UpdateFolderIntelligenceConfigRequest>>(
3172            mut self,
3173            v: V,
3174        ) -> Self {
3175            self.0.request = v.into();
3176            self
3177        }
3178
3179        /// Sets all the options, replacing any prior values.
3180        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3181            self.0.options = v.into();
3182            self
3183        }
3184
3185        /// Sends the request.
3186        pub async fn send(self) -> Result<crate::model::IntelligenceConfig> {
3187            (*self.0.stub)
3188                .update_folder_intelligence_config(self.0.request, self.0.options)
3189                .await
3190                .map(crate::Response::into_body)
3191        }
3192
3193        /// Sets the value of [intelligence_config][crate::model::UpdateFolderIntelligenceConfigRequest::intelligence_config].
3194        ///
3195        /// This is a **required** field for requests.
3196        pub fn set_intelligence_config<T>(mut self, v: T) -> Self
3197        where
3198            T: std::convert::Into<crate::model::IntelligenceConfig>,
3199        {
3200            self.0.request.intelligence_config = std::option::Option::Some(v.into());
3201            self
3202        }
3203
3204        /// Sets or clears the value of [intelligence_config][crate::model::UpdateFolderIntelligenceConfigRequest::intelligence_config].
3205        ///
3206        /// This is a **required** field for requests.
3207        pub fn set_or_clear_intelligence_config<T>(mut self, v: std::option::Option<T>) -> Self
3208        where
3209            T: std::convert::Into<crate::model::IntelligenceConfig>,
3210        {
3211            self.0.request.intelligence_config = v.map(|x| x.into());
3212            self
3213        }
3214
3215        /// Sets the value of [update_mask][crate::model::UpdateFolderIntelligenceConfigRequest::update_mask].
3216        ///
3217        /// This is a **required** field for requests.
3218        pub fn set_update_mask<T>(mut self, v: T) -> Self
3219        where
3220            T: std::convert::Into<wkt::FieldMask>,
3221        {
3222            self.0.request.update_mask = std::option::Option::Some(v.into());
3223            self
3224        }
3225
3226        /// Sets or clears the value of [update_mask][crate::model::UpdateFolderIntelligenceConfigRequest::update_mask].
3227        ///
3228        /// This is a **required** field for requests.
3229        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3230        where
3231            T: std::convert::Into<wkt::FieldMask>,
3232        {
3233            self.0.request.update_mask = v.map(|x| x.into());
3234            self
3235        }
3236
3237        /// Sets the value of [request_id][crate::model::UpdateFolderIntelligenceConfigRequest::request_id].
3238        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3239            self.0.request.request_id = v.into();
3240            self
3241        }
3242    }
3243
3244    #[doc(hidden)]
3245    impl crate::RequestBuilder for UpdateFolderIntelligenceConfig {
3246        fn request_options(&mut self) -> &mut crate::RequestOptions {
3247            &mut self.0.options
3248        }
3249    }
3250
3251    /// The request builder for [StorageControl::get_organization_intelligence_config][crate::client::StorageControl::get_organization_intelligence_config] calls.
3252    ///
3253    /// # Example
3254    /// ```
3255    /// # use google_cloud_storage::builder::storage_control::GetOrganizationIntelligenceConfig;
3256    /// # async fn sample() -> google_cloud_storage::Result<()> {
3257    ///
3258    /// let builder = prepare_request_builder();
3259    /// let response = builder.send().await?;
3260    /// # Ok(()) }
3261    ///
3262    /// fn prepare_request_builder() -> GetOrganizationIntelligenceConfig {
3263    ///   # panic!();
3264    ///   // ... details omitted ...
3265    /// }
3266    /// ```
3267    #[derive(Clone, Debug)]
3268    pub struct GetOrganizationIntelligenceConfig(
3269        RequestBuilder<crate::model::GetOrganizationIntelligenceConfigRequest>,
3270    );
3271
3272    impl GetOrganizationIntelligenceConfig {
3273        pub(crate) fn new(
3274            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
3275        ) -> Self {
3276            Self(RequestBuilder::new(stub))
3277        }
3278
3279        /// Sets the full request, replacing any prior values.
3280        pub fn with_request<V: Into<crate::model::GetOrganizationIntelligenceConfigRequest>>(
3281            mut self,
3282            v: V,
3283        ) -> Self {
3284            self.0.request = v.into();
3285            self
3286        }
3287
3288        /// Sets all the options, replacing any prior values.
3289        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3290            self.0.options = v.into();
3291            self
3292        }
3293
3294        /// Sends the request.
3295        pub async fn send(self) -> Result<crate::model::IntelligenceConfig> {
3296            (*self.0.stub)
3297                .get_organization_intelligence_config(self.0.request, self.0.options)
3298                .await
3299                .map(crate::Response::into_body)
3300        }
3301
3302        /// Sets the value of [name][crate::model::GetOrganizationIntelligenceConfigRequest::name].
3303        ///
3304        /// This is a **required** field for requests.
3305        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3306            self.0.request.name = v.into();
3307            self
3308        }
3309    }
3310
3311    #[doc(hidden)]
3312    impl crate::RequestBuilder for GetOrganizationIntelligenceConfig {
3313        fn request_options(&mut self) -> &mut crate::RequestOptions {
3314            &mut self.0.options
3315        }
3316    }
3317
3318    /// The request builder for [StorageControl::update_organization_intelligence_config][crate::client::StorageControl::update_organization_intelligence_config] calls.
3319    ///
3320    /// # Example
3321    /// ```
3322    /// # use google_cloud_storage::builder::storage_control::UpdateOrganizationIntelligenceConfig;
3323    /// # async fn sample() -> google_cloud_storage::Result<()> {
3324    ///
3325    /// let builder = prepare_request_builder();
3326    /// let response = builder.send().await?;
3327    /// # Ok(()) }
3328    ///
3329    /// fn prepare_request_builder() -> UpdateOrganizationIntelligenceConfig {
3330    ///   # panic!();
3331    ///   // ... details omitted ...
3332    /// }
3333    /// ```
3334    #[derive(Clone, Debug)]
3335    pub struct UpdateOrganizationIntelligenceConfig(
3336        RequestBuilder<crate::model::UpdateOrganizationIntelligenceConfigRequest>,
3337    );
3338
3339    impl UpdateOrganizationIntelligenceConfig {
3340        pub(crate) fn new(
3341            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
3342        ) -> Self {
3343            Self(RequestBuilder::new(stub))
3344        }
3345
3346        /// Sets the full request, replacing any prior values.
3347        pub fn with_request<V: Into<crate::model::UpdateOrganizationIntelligenceConfigRequest>>(
3348            mut self,
3349            v: V,
3350        ) -> Self {
3351            self.0.request = v.into();
3352            self
3353        }
3354
3355        /// Sets all the options, replacing any prior values.
3356        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3357            self.0.options = v.into();
3358            self
3359        }
3360
3361        /// Sends the request.
3362        pub async fn send(self) -> Result<crate::model::IntelligenceConfig> {
3363            (*self.0.stub)
3364                .update_organization_intelligence_config(self.0.request, self.0.options)
3365                .await
3366                .map(crate::Response::into_body)
3367        }
3368
3369        /// Sets the value of [intelligence_config][crate::model::UpdateOrganizationIntelligenceConfigRequest::intelligence_config].
3370        ///
3371        /// This is a **required** field for requests.
3372        pub fn set_intelligence_config<T>(mut self, v: T) -> Self
3373        where
3374            T: std::convert::Into<crate::model::IntelligenceConfig>,
3375        {
3376            self.0.request.intelligence_config = std::option::Option::Some(v.into());
3377            self
3378        }
3379
3380        /// Sets or clears the value of [intelligence_config][crate::model::UpdateOrganizationIntelligenceConfigRequest::intelligence_config].
3381        ///
3382        /// This is a **required** field for requests.
3383        pub fn set_or_clear_intelligence_config<T>(mut self, v: std::option::Option<T>) -> Self
3384        where
3385            T: std::convert::Into<crate::model::IntelligenceConfig>,
3386        {
3387            self.0.request.intelligence_config = v.map(|x| x.into());
3388            self
3389        }
3390
3391        /// Sets the value of [update_mask][crate::model::UpdateOrganizationIntelligenceConfigRequest::update_mask].
3392        ///
3393        /// This is a **required** field for requests.
3394        pub fn set_update_mask<T>(mut self, v: T) -> Self
3395        where
3396            T: std::convert::Into<wkt::FieldMask>,
3397        {
3398            self.0.request.update_mask = std::option::Option::Some(v.into());
3399            self
3400        }
3401
3402        /// Sets or clears the value of [update_mask][crate::model::UpdateOrganizationIntelligenceConfigRequest::update_mask].
3403        ///
3404        /// This is a **required** field for requests.
3405        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3406        where
3407            T: std::convert::Into<wkt::FieldMask>,
3408        {
3409            self.0.request.update_mask = v.map(|x| x.into());
3410            self
3411        }
3412
3413        /// Sets the value of [request_id][crate::model::UpdateOrganizationIntelligenceConfigRequest::request_id].
3414        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3415            self.0.request.request_id = v.into();
3416            self
3417        }
3418    }
3419
3420    #[doc(hidden)]
3421    impl crate::RequestBuilder for UpdateOrganizationIntelligenceConfig {
3422        fn request_options(&mut self) -> &mut crate::RequestOptions {
3423            &mut self.0.options
3424        }
3425    }
3426
3427    /// The request builder for [StorageControl::get_iam_policy][crate::client::StorageControl::get_iam_policy] calls.
3428    ///
3429    /// # Example
3430    /// ```
3431    /// # use google_cloud_storage::builder::storage_control::GetIamPolicy;
3432    /// # async fn sample() -> google_cloud_storage::Result<()> {
3433    ///
3434    /// let builder = prepare_request_builder();
3435    /// let response = builder.send().await?;
3436    /// # Ok(()) }
3437    ///
3438    /// fn prepare_request_builder() -> GetIamPolicy {
3439    ///   # panic!();
3440    ///   // ... details omitted ...
3441    /// }
3442    /// ```
3443    #[derive(Clone, Debug)]
3444    pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
3445
3446    impl GetIamPolicy {
3447        pub(crate) fn new(
3448            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
3449        ) -> Self {
3450            Self(RequestBuilder::new(stub))
3451        }
3452
3453        /// Sets the full request, replacing any prior values.
3454        pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
3455            mut self,
3456            v: V,
3457        ) -> Self {
3458            self.0.request = v.into();
3459            self
3460        }
3461
3462        /// Sets all the options, replacing any prior values.
3463        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3464            self.0.options = v.into();
3465            self
3466        }
3467
3468        /// Sends the request.
3469        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
3470            (*self.0.stub)
3471                .get_iam_policy(self.0.request, self.0.options)
3472                .await
3473                .map(crate::Response::into_body)
3474        }
3475
3476        /// Sets the value of [resource][google_cloud_iam_v1::model::GetIamPolicyRequest::resource].
3477        ///
3478        /// This is a **required** field for requests.
3479        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
3480            self.0.request.resource = v.into();
3481            self
3482        }
3483
3484        /// Sets the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
3485        pub fn set_options<T>(mut self, v: T) -> Self
3486        where
3487            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
3488        {
3489            self.0.request.options = std::option::Option::Some(v.into());
3490            self
3491        }
3492
3493        /// Sets or clears the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
3494        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
3495        where
3496            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
3497        {
3498            self.0.request.options = v.map(|x| x.into());
3499            self
3500        }
3501    }
3502
3503    #[doc(hidden)]
3504    impl crate::RequestBuilder for GetIamPolicy {
3505        fn request_options(&mut self) -> &mut crate::RequestOptions {
3506            &mut self.0.options
3507        }
3508    }
3509
3510    /// The request builder for [StorageControl::set_iam_policy][crate::client::StorageControl::set_iam_policy] calls.
3511    ///
3512    /// # Example
3513    /// ```
3514    /// # use google_cloud_storage::builder::storage_control::SetIamPolicy;
3515    /// # async fn sample() -> google_cloud_storage::Result<()> {
3516    ///
3517    /// let builder = prepare_request_builder();
3518    /// let response = builder.send().await?;
3519    /// # Ok(()) }
3520    ///
3521    /// fn prepare_request_builder() -> SetIamPolicy {
3522    ///   # panic!();
3523    ///   // ... details omitted ...
3524    /// }
3525    /// ```
3526    #[derive(Clone, Debug)]
3527    pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
3528
3529    impl SetIamPolicy {
3530        pub(crate) fn new(
3531            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
3532        ) -> Self {
3533            Self(RequestBuilder::new(stub))
3534        }
3535
3536        /// Sets the full request, replacing any prior values.
3537        pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
3538            mut self,
3539            v: V,
3540        ) -> Self {
3541            self.0.request = v.into();
3542            self
3543        }
3544
3545        /// Sets all the options, replacing any prior values.
3546        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3547            self.0.options = v.into();
3548            self
3549        }
3550
3551        /// Sends the request.
3552        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
3553            (*self.0.stub)
3554                .set_iam_policy(self.0.request, self.0.options)
3555                .await
3556                .map(crate::Response::into_body)
3557        }
3558
3559        /// Sets the value of [resource][google_cloud_iam_v1::model::SetIamPolicyRequest::resource].
3560        ///
3561        /// This is a **required** field for requests.
3562        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
3563            self.0.request.resource = v.into();
3564            self
3565        }
3566
3567        /// Sets the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
3568        ///
3569        /// This is a **required** field for requests.
3570        pub fn set_policy<T>(mut self, v: T) -> Self
3571        where
3572            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
3573        {
3574            self.0.request.policy = std::option::Option::Some(v.into());
3575            self
3576        }
3577
3578        /// Sets or clears the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
3579        ///
3580        /// This is a **required** field for requests.
3581        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
3582        where
3583            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
3584        {
3585            self.0.request.policy = v.map(|x| x.into());
3586            self
3587        }
3588
3589        /// Sets the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
3590        pub fn set_update_mask<T>(mut self, v: T) -> Self
3591        where
3592            T: std::convert::Into<wkt::FieldMask>,
3593        {
3594            self.0.request.update_mask = std::option::Option::Some(v.into());
3595            self
3596        }
3597
3598        /// Sets or clears the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
3599        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3600        where
3601            T: std::convert::Into<wkt::FieldMask>,
3602        {
3603            self.0.request.update_mask = v.map(|x| x.into());
3604            self
3605        }
3606    }
3607
3608    #[doc(hidden)]
3609    impl crate::RequestBuilder for SetIamPolicy {
3610        fn request_options(&mut self) -> &mut crate::RequestOptions {
3611            &mut self.0.options
3612        }
3613    }
3614
3615    /// The request builder for [StorageControl::test_iam_permissions][crate::client::StorageControl::test_iam_permissions] calls.
3616    ///
3617    /// # Example
3618    /// ```
3619    /// # use google_cloud_storage::builder::storage_control::TestIamPermissions;
3620    /// # async fn sample() -> google_cloud_storage::Result<()> {
3621    ///
3622    /// let builder = prepare_request_builder();
3623    /// let response = builder.send().await?;
3624    /// # Ok(()) }
3625    ///
3626    /// fn prepare_request_builder() -> TestIamPermissions {
3627    ///   # panic!();
3628    ///   // ... details omitted ...
3629    /// }
3630    /// ```
3631    #[derive(Clone, Debug)]
3632    pub struct TestIamPermissions(
3633        RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
3634    );
3635
3636    impl TestIamPermissions {
3637        pub(crate) fn new(
3638            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
3639        ) -> Self {
3640            Self(RequestBuilder::new(stub))
3641        }
3642
3643        /// Sets the full request, replacing any prior values.
3644        pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
3645            mut self,
3646            v: V,
3647        ) -> Self {
3648            self.0.request = v.into();
3649            self
3650        }
3651
3652        /// Sets all the options, replacing any prior values.
3653        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3654            self.0.options = v.into();
3655            self
3656        }
3657
3658        /// Sends the request.
3659        pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
3660            (*self.0.stub)
3661                .test_iam_permissions(self.0.request, self.0.options)
3662                .await
3663                .map(crate::Response::into_body)
3664        }
3665
3666        /// Sets the value of [resource][google_cloud_iam_v1::model::TestIamPermissionsRequest::resource].
3667        ///
3668        /// This is a **required** field for requests.
3669        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
3670            self.0.request.resource = v.into();
3671            self
3672        }
3673
3674        /// Sets the value of [permissions][google_cloud_iam_v1::model::TestIamPermissionsRequest::permissions].
3675        ///
3676        /// This is a **required** field for requests.
3677        pub fn set_permissions<T, V>(mut self, v: T) -> Self
3678        where
3679            T: std::iter::IntoIterator<Item = V>,
3680            V: std::convert::Into<std::string::String>,
3681        {
3682            use std::iter::Iterator;
3683            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
3684            self
3685        }
3686    }
3687
3688    #[doc(hidden)]
3689    impl crate::RequestBuilder for TestIamPermissions {
3690        fn request_options(&mut self) -> &mut crate::RequestOptions {
3691            &mut self.0.options
3692        }
3693    }
3694
3695    /// The request builder for [StorageControl::get_intelligence_finding][crate::client::StorageControl::get_intelligence_finding] calls.
3696    ///
3697    /// # Example
3698    /// ```
3699    /// # use google_cloud_storage::builder::storage_control::GetIntelligenceFinding;
3700    /// # async fn sample() -> google_cloud_storage::Result<()> {
3701    ///
3702    /// let builder = prepare_request_builder();
3703    /// let response = builder.send().await?;
3704    /// # Ok(()) }
3705    ///
3706    /// fn prepare_request_builder() -> GetIntelligenceFinding {
3707    ///   # panic!();
3708    ///   // ... details omitted ...
3709    /// }
3710    /// ```
3711    #[derive(Clone, Debug)]
3712    pub struct GetIntelligenceFinding(RequestBuilder<crate::model::GetIntelligenceFindingRequest>);
3713
3714    impl GetIntelligenceFinding {
3715        pub(crate) fn new(
3716            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
3717        ) -> Self {
3718            Self(RequestBuilder::new(stub))
3719        }
3720
3721        /// Sets the full request, replacing any prior values.
3722        pub fn with_request<V: Into<crate::model::GetIntelligenceFindingRequest>>(
3723            mut self,
3724            v: V,
3725        ) -> Self {
3726            self.0.request = v.into();
3727            self
3728        }
3729
3730        /// Sets all the options, replacing any prior values.
3731        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3732            self.0.options = v.into();
3733            self
3734        }
3735
3736        /// Sends the request.
3737        pub async fn send(self) -> Result<crate::model::IntelligenceFinding> {
3738            (*self.0.stub)
3739                .get_intelligence_finding(self.0.request, self.0.options)
3740                .await
3741                .map(crate::Response::into_body)
3742        }
3743
3744        /// Sets the value of [name][crate::model::GetIntelligenceFindingRequest::name].
3745        ///
3746        /// This is a **required** field for requests.
3747        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3748            self.0.request.name = v.into();
3749            self
3750        }
3751    }
3752
3753    #[doc(hidden)]
3754    impl crate::RequestBuilder for GetIntelligenceFinding {
3755        fn request_options(&mut self) -> &mut crate::RequestOptions {
3756            &mut self.0.options
3757        }
3758    }
3759
3760    /// The request builder for [StorageControl::list_intelligence_findings][crate::client::StorageControl::list_intelligence_findings] calls.
3761    ///
3762    /// # Example
3763    /// ```
3764    /// # use google_cloud_storage::builder::storage_control::ListIntelligenceFindings;
3765    /// # async fn sample() -> google_cloud_storage::Result<()> {
3766    /// use google_cloud_gax::paginator::ItemPaginator;
3767    ///
3768    /// let builder = prepare_request_builder();
3769    /// let mut items = builder.by_item();
3770    /// while let Some(result) = items.next().await {
3771    ///   let item = result?;
3772    /// }
3773    /// # Ok(()) }
3774    ///
3775    /// fn prepare_request_builder() -> ListIntelligenceFindings {
3776    ///   # panic!();
3777    ///   // ... details omitted ...
3778    /// }
3779    /// ```
3780    #[derive(Clone, Debug)]
3781    pub struct ListIntelligenceFindings(
3782        RequestBuilder<crate::model::ListIntelligenceFindingsRequest>,
3783    );
3784
3785    impl ListIntelligenceFindings {
3786        pub(crate) fn new(
3787            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
3788        ) -> Self {
3789            Self(RequestBuilder::new(stub))
3790        }
3791
3792        /// Sets the full request, replacing any prior values.
3793        pub fn with_request<V: Into<crate::model::ListIntelligenceFindingsRequest>>(
3794            mut self,
3795            v: V,
3796        ) -> Self {
3797            self.0.request = v.into();
3798            self
3799        }
3800
3801        /// Sets all the options, replacing any prior values.
3802        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3803            self.0.options = v.into();
3804            self
3805        }
3806
3807        /// Sends the request.
3808        pub async fn send(self) -> Result<crate::model::ListIntelligenceFindingsResponse> {
3809            (*self.0.stub)
3810                .list_intelligence_findings(self.0.request, self.0.options)
3811                .await
3812                .map(crate::Response::into_body)
3813        }
3814
3815        /// Streams each page in the collection.
3816        pub fn by_page(
3817            self,
3818        ) -> impl google_cloud_gax::paginator::Paginator<
3819            crate::model::ListIntelligenceFindingsResponse,
3820            crate::Error,
3821        > {
3822            use std::clone::Clone;
3823            let token = self.0.request.page_token.clone();
3824            let execute = move |token: String| {
3825                let mut builder = self.clone();
3826                builder.0.request = builder.0.request.set_page_token(token);
3827                builder.send()
3828            };
3829            google_cloud_gax::paginator::internal::new_paginator(token, execute)
3830        }
3831
3832        /// Streams each item in the collection.
3833        pub fn by_item(
3834            self,
3835        ) -> impl google_cloud_gax::paginator::ItemPaginator<
3836            crate::model::ListIntelligenceFindingsResponse,
3837            crate::Error,
3838        > {
3839            use google_cloud_gax::paginator::Paginator;
3840            self.by_page().items()
3841        }
3842
3843        /// Sets the value of [parent][crate::model::ListIntelligenceFindingsRequest::parent].
3844        ///
3845        /// This is a **required** field for requests.
3846        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3847            self.0.request.parent = v.into();
3848            self
3849        }
3850
3851        /// Sets the value of [filter][crate::model::ListIntelligenceFindingsRequest::filter].
3852        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3853            self.0.request.filter = v.into();
3854            self
3855        }
3856
3857        /// Sets the value of [page_size][crate::model::ListIntelligenceFindingsRequest::page_size].
3858        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3859            self.0.request.page_size = v.into();
3860            self
3861        }
3862
3863        /// Sets the value of [page_token][crate::model::ListIntelligenceFindingsRequest::page_token].
3864        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3865            self.0.request.page_token = v.into();
3866            self
3867        }
3868    }
3869
3870    #[doc(hidden)]
3871    impl crate::RequestBuilder for ListIntelligenceFindings {
3872        fn request_options(&mut self) -> &mut crate::RequestOptions {
3873            &mut self.0.options
3874        }
3875    }
3876
3877    /// The request builder for [StorageControl::summarize_intelligence_findings][crate::client::StorageControl::summarize_intelligence_findings] calls.
3878    ///
3879    /// # Example
3880    /// ```
3881    /// # use google_cloud_storage::builder::storage_control::SummarizeIntelligenceFindings;
3882    /// # async fn sample() -> google_cloud_storage::Result<()> {
3883    /// use google_cloud_gax::paginator::ItemPaginator;
3884    ///
3885    /// let builder = prepare_request_builder();
3886    /// let mut items = builder.by_item();
3887    /// while let Some(result) = items.next().await {
3888    ///   let item = result?;
3889    /// }
3890    /// # Ok(()) }
3891    ///
3892    /// fn prepare_request_builder() -> SummarizeIntelligenceFindings {
3893    ///   # panic!();
3894    ///   // ... details omitted ...
3895    /// }
3896    /// ```
3897    #[derive(Clone, Debug)]
3898    pub struct SummarizeIntelligenceFindings(
3899        RequestBuilder<crate::model::SummarizeIntelligenceFindingsRequest>,
3900    );
3901
3902    impl SummarizeIntelligenceFindings {
3903        pub(crate) fn new(
3904            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
3905        ) -> Self {
3906            Self(RequestBuilder::new(stub))
3907        }
3908
3909        /// Sets the full request, replacing any prior values.
3910        pub fn with_request<V: Into<crate::model::SummarizeIntelligenceFindingsRequest>>(
3911            mut self,
3912            v: V,
3913        ) -> Self {
3914            self.0.request = v.into();
3915            self
3916        }
3917
3918        /// Sets all the options, replacing any prior values.
3919        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3920            self.0.options = v.into();
3921            self
3922        }
3923
3924        /// Sends the request.
3925        pub async fn send(self) -> Result<crate::model::SummarizeIntelligenceFindingsResponse> {
3926            (*self.0.stub)
3927                .summarize_intelligence_findings(self.0.request, self.0.options)
3928                .await
3929                .map(crate::Response::into_body)
3930        }
3931
3932        /// Streams each page in the collection.
3933        pub fn by_page(
3934            self,
3935        ) -> impl google_cloud_gax::paginator::Paginator<
3936            crate::model::SummarizeIntelligenceFindingsResponse,
3937            crate::Error,
3938        > {
3939            use std::clone::Clone;
3940            let token = self.0.request.page_token.clone();
3941            let execute = move |token: String| {
3942                let mut builder = self.clone();
3943                builder.0.request = builder.0.request.set_page_token(token);
3944                builder.send()
3945            };
3946            google_cloud_gax::paginator::internal::new_paginator(token, execute)
3947        }
3948
3949        /// Streams each item in the collection.
3950        pub fn by_item(
3951            self,
3952        ) -> impl google_cloud_gax::paginator::ItemPaginator<
3953            crate::model::SummarizeIntelligenceFindingsResponse,
3954            crate::Error,
3955        > {
3956            use google_cloud_gax::paginator::Paginator;
3957            self.by_page().items()
3958        }
3959
3960        /// Sets the value of [parent][crate::model::SummarizeIntelligenceFindingsRequest::parent].
3961        ///
3962        /// This is a **required** field for requests.
3963        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3964            self.0.request.parent = v.into();
3965            self
3966        }
3967
3968        /// Sets the value of [resource_scope][crate::model::SummarizeIntelligenceFindingsRequest::resource_scope].
3969        pub fn set_resource_scope<
3970            T: Into<crate::model::summarize_intelligence_findings_request::ResourceScope>,
3971        >(
3972            mut self,
3973            v: T,
3974        ) -> Self {
3975            self.0.request.resource_scope = v.into();
3976            self
3977        }
3978
3979        /// Sets the value of [filter][crate::model::SummarizeIntelligenceFindingsRequest::filter].
3980        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3981            self.0.request.filter = v.into();
3982            self
3983        }
3984
3985        /// Sets the value of [page_size][crate::model::SummarizeIntelligenceFindingsRequest::page_size].
3986        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3987            self.0.request.page_size = v.into();
3988            self
3989        }
3990
3991        /// Sets the value of [page_token][crate::model::SummarizeIntelligenceFindingsRequest::page_token].
3992        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3993            self.0.request.page_token = v.into();
3994            self
3995        }
3996    }
3997
3998    #[doc(hidden)]
3999    impl crate::RequestBuilder for SummarizeIntelligenceFindings {
4000        fn request_options(&mut self) -> &mut crate::RequestOptions {
4001            &mut self.0.options
4002        }
4003    }
4004
4005    /// The request builder for [StorageControl::get_intelligence_finding_revision][crate::client::StorageControl::get_intelligence_finding_revision] calls.
4006    ///
4007    /// # Example
4008    /// ```
4009    /// # use google_cloud_storage::builder::storage_control::GetIntelligenceFindingRevision;
4010    /// # async fn sample() -> google_cloud_storage::Result<()> {
4011    ///
4012    /// let builder = prepare_request_builder();
4013    /// let response = builder.send().await?;
4014    /// # Ok(()) }
4015    ///
4016    /// fn prepare_request_builder() -> GetIntelligenceFindingRevision {
4017    ///   # panic!();
4018    ///   // ... details omitted ...
4019    /// }
4020    /// ```
4021    #[derive(Clone, Debug)]
4022    pub struct GetIntelligenceFindingRevision(
4023        RequestBuilder<crate::model::GetIntelligenceFindingRevisionRequest>,
4024    );
4025
4026    impl GetIntelligenceFindingRevision {
4027        pub(crate) fn new(
4028            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
4029        ) -> Self {
4030            Self(RequestBuilder::new(stub))
4031        }
4032
4033        /// Sets the full request, replacing any prior values.
4034        pub fn with_request<V: Into<crate::model::GetIntelligenceFindingRevisionRequest>>(
4035            mut self,
4036            v: V,
4037        ) -> Self {
4038            self.0.request = v.into();
4039            self
4040        }
4041
4042        /// Sets all the options, replacing any prior values.
4043        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4044            self.0.options = v.into();
4045            self
4046        }
4047
4048        /// Sends the request.
4049        pub async fn send(self) -> Result<crate::model::IntelligenceFindingRevision> {
4050            (*self.0.stub)
4051                .get_intelligence_finding_revision(self.0.request, self.0.options)
4052                .await
4053                .map(crate::Response::into_body)
4054        }
4055
4056        /// Sets the value of [name][crate::model::GetIntelligenceFindingRevisionRequest::name].
4057        ///
4058        /// This is a **required** field for requests.
4059        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4060            self.0.request.name = v.into();
4061            self
4062        }
4063    }
4064
4065    #[doc(hidden)]
4066    impl crate::RequestBuilder for GetIntelligenceFindingRevision {
4067        fn request_options(&mut self) -> &mut crate::RequestOptions {
4068            &mut self.0.options
4069        }
4070    }
4071
4072    /// The request builder for [StorageControl::list_intelligence_finding_revisions][crate::client::StorageControl::list_intelligence_finding_revisions] calls.
4073    ///
4074    /// # Example
4075    /// ```
4076    /// # use google_cloud_storage::builder::storage_control::ListIntelligenceFindingRevisions;
4077    /// # async fn sample() -> google_cloud_storage::Result<()> {
4078    /// use google_cloud_gax::paginator::ItemPaginator;
4079    ///
4080    /// let builder = prepare_request_builder();
4081    /// let mut items = builder.by_item();
4082    /// while let Some(result) = items.next().await {
4083    ///   let item = result?;
4084    /// }
4085    /// # Ok(()) }
4086    ///
4087    /// fn prepare_request_builder() -> ListIntelligenceFindingRevisions {
4088    ///   # panic!();
4089    ///   // ... details omitted ...
4090    /// }
4091    /// ```
4092    #[derive(Clone, Debug)]
4093    pub struct ListIntelligenceFindingRevisions(
4094        RequestBuilder<crate::model::ListIntelligenceFindingRevisionsRequest>,
4095    );
4096
4097    impl ListIntelligenceFindingRevisions {
4098        pub(crate) fn new(
4099            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
4100        ) -> Self {
4101            Self(RequestBuilder::new(stub))
4102        }
4103
4104        /// Sets the full request, replacing any prior values.
4105        pub fn with_request<V: Into<crate::model::ListIntelligenceFindingRevisionsRequest>>(
4106            mut self,
4107            v: V,
4108        ) -> Self {
4109            self.0.request = v.into();
4110            self
4111        }
4112
4113        /// Sets all the options, replacing any prior values.
4114        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4115            self.0.options = v.into();
4116            self
4117        }
4118
4119        /// Sends the request.
4120        pub async fn send(self) -> Result<crate::model::ListIntelligenceFindingRevisionsResponse> {
4121            (*self.0.stub)
4122                .list_intelligence_finding_revisions(self.0.request, self.0.options)
4123                .await
4124                .map(crate::Response::into_body)
4125        }
4126
4127        /// Streams each page in the collection.
4128        pub fn by_page(
4129            self,
4130        ) -> impl google_cloud_gax::paginator::Paginator<
4131            crate::model::ListIntelligenceFindingRevisionsResponse,
4132            crate::Error,
4133        > {
4134            use std::clone::Clone;
4135            let token = self.0.request.page_token.clone();
4136            let execute = move |token: String| {
4137                let mut builder = self.clone();
4138                builder.0.request = builder.0.request.set_page_token(token);
4139                builder.send()
4140            };
4141            google_cloud_gax::paginator::internal::new_paginator(token, execute)
4142        }
4143
4144        /// Streams each item in the collection.
4145        pub fn by_item(
4146            self,
4147        ) -> impl google_cloud_gax::paginator::ItemPaginator<
4148            crate::model::ListIntelligenceFindingRevisionsResponse,
4149            crate::Error,
4150        > {
4151            use google_cloud_gax::paginator::Paginator;
4152            self.by_page().items()
4153        }
4154
4155        /// Sets the value of [parent][crate::model::ListIntelligenceFindingRevisionsRequest::parent].
4156        ///
4157        /// This is a **required** field for requests.
4158        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4159            self.0.request.parent = v.into();
4160            self
4161        }
4162
4163        /// Sets the value of [page_size][crate::model::ListIntelligenceFindingRevisionsRequest::page_size].
4164        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4165            self.0.request.page_size = v.into();
4166            self
4167        }
4168
4169        /// Sets the value of [page_token][crate::model::ListIntelligenceFindingRevisionsRequest::page_token].
4170        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4171            self.0.request.page_token = v.into();
4172            self
4173        }
4174    }
4175
4176    #[doc(hidden)]
4177    impl crate::RequestBuilder for ListIntelligenceFindingRevisions {
4178        fn request_options(&mut self) -> &mut crate::RequestOptions {
4179            &mut self.0.options
4180        }
4181    }
4182
4183    /// The request builder for [StorageControl::get_operation][crate::client::StorageControl::get_operation] calls.
4184    ///
4185    /// # Example
4186    /// ```
4187    /// # use google_cloud_storage::builder::storage_control::GetOperation;
4188    /// # async fn sample() -> google_cloud_storage::Result<()> {
4189    ///
4190    /// let builder = prepare_request_builder();
4191    /// let response = builder.send().await?;
4192    /// # Ok(()) }
4193    ///
4194    /// fn prepare_request_builder() -> GetOperation {
4195    ///   # panic!();
4196    ///   // ... details omitted ...
4197    /// }
4198    /// ```
4199    #[derive(Clone, Debug)]
4200    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
4201
4202    impl GetOperation {
4203        pub(crate) fn new(
4204            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
4205        ) -> Self {
4206            Self(RequestBuilder::new(stub))
4207        }
4208
4209        /// Sets the full request, replacing any prior values.
4210        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
4211            mut self,
4212            v: V,
4213        ) -> Self {
4214            self.0.request = v.into();
4215            self
4216        }
4217
4218        /// Sets all the options, replacing any prior values.
4219        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4220            self.0.options = v.into();
4221            self
4222        }
4223
4224        /// Sends the request.
4225        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4226            (*self.0.stub)
4227                .get_operation(self.0.request, self.0.options)
4228                .await
4229                .map(crate::Response::into_body)
4230        }
4231
4232        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
4233        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4234            self.0.request.name = v.into();
4235            self
4236        }
4237    }
4238
4239    #[doc(hidden)]
4240    impl crate::RequestBuilder for GetOperation {
4241        fn request_options(&mut self) -> &mut crate::RequestOptions {
4242            &mut self.0.options
4243        }
4244    }
4245}