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::disable_rapid_cache][crate::client::StorageControl::disable_rapid_cache] calls.
2720    ///
2721    /// # Example
2722    /// ```
2723    /// # use google_cloud_storage::builder::storage_control::DisableRapidCache;
2724    /// # async fn sample() -> google_cloud_storage::Result<()> {
2725    /// use google_cloud_lro::Poller;
2726    ///
2727    /// let builder = prepare_request_builder();
2728    /// let response = builder.poller().until_done().await?;
2729    /// # Ok(()) }
2730    ///
2731    /// fn prepare_request_builder() -> DisableRapidCache {
2732    ///   # panic!();
2733    ///   // ... details omitted ...
2734    /// }
2735    /// ```
2736    #[derive(Clone, Debug)]
2737    pub struct DisableRapidCache(RequestBuilder<crate::model::DisableRapidCacheRequest>);
2738
2739    impl DisableRapidCache {
2740        pub(crate) fn new(
2741            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2742        ) -> Self {
2743            Self(RequestBuilder::new(stub))
2744        }
2745
2746        /// Sets the full request, replacing any prior values.
2747        pub fn with_request<V: Into<crate::model::DisableRapidCacheRequest>>(
2748            mut self,
2749            v: V,
2750        ) -> Self {
2751            self.0.request = v.into();
2752            self
2753        }
2754
2755        /// Sets all the options, replacing any prior values.
2756        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2757            self.0.options = v.into();
2758            self
2759        }
2760
2761        /// Sends the request.
2762        ///
2763        /// # Long running operations
2764        ///
2765        /// This starts, but does not poll, a longrunning operation. More information
2766        /// on [disable_rapid_cache][crate::client::StorageControl::disable_rapid_cache].
2767        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2768            (*self.0.stub)
2769                .disable_rapid_cache(self.0.request, self.0.options)
2770                .await
2771                .map(crate::Response::into_body)
2772        }
2773
2774        /// Creates a [Poller][google_cloud_lro::Poller] to work with `disable_rapid_cache`.
2775        pub fn poller(
2776            self,
2777        ) -> impl google_cloud_lro::Poller<
2778            crate::model::RapidCache,
2779            crate::model::DisableRapidCacheMetadata,
2780        > {
2781            type Operation = google_cloud_lro::internal::Operation<
2782                crate::model::RapidCache,
2783                crate::model::DisableRapidCacheMetadata,
2784            >;
2785            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2786            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2787            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
2788            if let Some(ref mut details) = poller_options.tracing {
2789                details.method_name =
2790                    "google_cloud_storage::client::StorageControl::disable_rapid_cache::until_done";
2791            }
2792
2793            let stub = self.0.stub.clone();
2794            let mut options = self.0.options.clone();
2795            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2796            let query = move |name| {
2797                let stub = stub.clone();
2798                let options = options.clone();
2799                async {
2800                    let op = GetOperation::new(stub)
2801                        .set_name(name)
2802                        .with_options(options)
2803                        .send()
2804                        .await?;
2805                    Ok(Operation::new(op))
2806                }
2807            };
2808
2809            let start = move || async {
2810                let op = self.send().await?;
2811                Ok(Operation::new(op))
2812            };
2813
2814            use google_cloud_lro::internal::PollerExt;
2815            {
2816                google_cloud_lro::internal::new_poller(
2817                    polling_error_policy,
2818                    polling_backoff_policy,
2819                    start,
2820                    query,
2821                )
2822            }
2823            .with_options(poller_options)
2824        }
2825
2826        /// Sets the value of [name][crate::model::DisableRapidCacheRequest::name].
2827        ///
2828        /// This is a **required** field for requests.
2829        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2830            self.0.request.name = v.into();
2831            self
2832        }
2833
2834        /// Sets the value of [request_id][crate::model::DisableRapidCacheRequest::request_id].
2835        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2836            self.0.request.request_id = v.into();
2837            self
2838        }
2839    }
2840
2841    #[doc(hidden)]
2842    impl crate::RequestBuilder for DisableRapidCache {
2843        fn request_options(&mut self) -> &mut crate::RequestOptions {
2844            &mut self.0.options
2845        }
2846    }
2847
2848    /// The request builder for [StorageControl::get_rapid_cache][crate::client::StorageControl::get_rapid_cache] calls.
2849    ///
2850    /// # Example
2851    /// ```
2852    /// # use google_cloud_storage::builder::storage_control::GetRapidCache;
2853    /// # async fn sample() -> google_cloud_storage::Result<()> {
2854    ///
2855    /// let builder = prepare_request_builder();
2856    /// let response = builder.send().await?;
2857    /// # Ok(()) }
2858    ///
2859    /// fn prepare_request_builder() -> GetRapidCache {
2860    ///   # panic!();
2861    ///   // ... details omitted ...
2862    /// }
2863    /// ```
2864    #[derive(Clone, Debug)]
2865    pub struct GetRapidCache(RequestBuilder<crate::model::GetRapidCacheRequest>);
2866
2867    impl GetRapidCache {
2868        pub(crate) fn new(
2869            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2870        ) -> Self {
2871            Self(RequestBuilder::new(stub))
2872        }
2873
2874        /// Sets the full request, replacing any prior values.
2875        pub fn with_request<V: Into<crate::model::GetRapidCacheRequest>>(mut self, v: V) -> Self {
2876            self.0.request = v.into();
2877            self
2878        }
2879
2880        /// Sets all the options, replacing any prior values.
2881        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2882            self.0.options = v.into();
2883            self
2884        }
2885
2886        /// Sends the request.
2887        pub async fn send(self) -> Result<crate::model::RapidCache> {
2888            (*self.0.stub)
2889                .get_rapid_cache(self.0.request, self.0.options)
2890                .await
2891                .map(crate::Response::into_body)
2892        }
2893
2894        /// Sets the value of [name][crate::model::GetRapidCacheRequest::name].
2895        ///
2896        /// This is a **required** field for requests.
2897        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2898            self.0.request.name = v.into();
2899            self
2900        }
2901
2902        /// Sets the value of [request_id][crate::model::GetRapidCacheRequest::request_id].
2903        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2904            self.0.request.request_id = v.into();
2905            self
2906        }
2907    }
2908
2909    #[doc(hidden)]
2910    impl crate::RequestBuilder for GetRapidCache {
2911        fn request_options(&mut self) -> &mut crate::RequestOptions {
2912            &mut self.0.options
2913        }
2914    }
2915
2916    /// The request builder for [StorageControl::list_rapid_caches][crate::client::StorageControl::list_rapid_caches] calls.
2917    ///
2918    /// # Example
2919    /// ```
2920    /// # use google_cloud_storage::builder::storage_control::ListRapidCaches;
2921    /// # async fn sample() -> google_cloud_storage::Result<()> {
2922    /// use google_cloud_gax::paginator::ItemPaginator;
2923    ///
2924    /// let builder = prepare_request_builder();
2925    /// let mut items = builder.by_item();
2926    /// while let Some(result) = items.next().await {
2927    ///   let item = result?;
2928    /// }
2929    /// # Ok(()) }
2930    ///
2931    /// fn prepare_request_builder() -> ListRapidCaches {
2932    ///   # panic!();
2933    ///   // ... details omitted ...
2934    /// }
2935    /// ```
2936    #[derive(Clone, Debug)]
2937    pub struct ListRapidCaches(RequestBuilder<crate::model::ListRapidCachesRequest>);
2938
2939    impl ListRapidCaches {
2940        pub(crate) fn new(
2941            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2942        ) -> Self {
2943            Self(RequestBuilder::new(stub))
2944        }
2945
2946        /// Sets the full request, replacing any prior values.
2947        pub fn with_request<V: Into<crate::model::ListRapidCachesRequest>>(mut self, v: V) -> Self {
2948            self.0.request = v.into();
2949            self
2950        }
2951
2952        /// Sets all the options, replacing any prior values.
2953        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2954            self.0.options = v.into();
2955            self
2956        }
2957
2958        /// Sends the request.
2959        pub async fn send(self) -> Result<crate::model::ListRapidCachesResponse> {
2960            (*self.0.stub)
2961                .list_rapid_caches(self.0.request, self.0.options)
2962                .await
2963                .map(crate::Response::into_body)
2964        }
2965
2966        /// Streams each page in the collection.
2967        pub fn by_page(
2968            self,
2969        ) -> impl google_cloud_gax::paginator::Paginator<
2970            crate::model::ListRapidCachesResponse,
2971            crate::Error,
2972        > {
2973            use std::clone::Clone;
2974            let token = self.0.request.page_token.clone();
2975            let execute = move |token: String| {
2976                let mut builder = self.clone();
2977                builder.0.request = builder.0.request.set_page_token(token);
2978                builder.send()
2979            };
2980            google_cloud_gax::paginator::internal::new_paginator(token, execute)
2981        }
2982
2983        /// Streams each item in the collection.
2984        pub fn by_item(
2985            self,
2986        ) -> impl google_cloud_gax::paginator::ItemPaginator<
2987            crate::model::ListRapidCachesResponse,
2988            crate::Error,
2989        > {
2990            use google_cloud_gax::paginator::Paginator;
2991            self.by_page().items()
2992        }
2993
2994        /// Sets the value of [parent][crate::model::ListRapidCachesRequest::parent].
2995        ///
2996        /// This is a **required** field for requests.
2997        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2998            self.0.request.parent = v.into();
2999            self
3000        }
3001
3002        /// Sets the value of [page_size][crate::model::ListRapidCachesRequest::page_size].
3003        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3004            self.0.request.page_size = v.into();
3005            self
3006        }
3007
3008        /// Sets the value of [page_token][crate::model::ListRapidCachesRequest::page_token].
3009        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3010            self.0.request.page_token = v.into();
3011            self
3012        }
3013
3014        /// Sets the value of [request_id][crate::model::ListRapidCachesRequest::request_id].
3015        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3016            self.0.request.request_id = v.into();
3017            self
3018        }
3019    }
3020
3021    #[doc(hidden)]
3022    impl crate::RequestBuilder for ListRapidCaches {
3023        fn request_options(&mut self) -> &mut crate::RequestOptions {
3024            &mut self.0.options
3025        }
3026    }
3027
3028    /// The request builder for [StorageControl::get_project_intelligence_config][crate::client::StorageControl::get_project_intelligence_config] calls.
3029    ///
3030    /// # Example
3031    /// ```
3032    /// # use google_cloud_storage::builder::storage_control::GetProjectIntelligenceConfig;
3033    /// # async fn sample() -> google_cloud_storage::Result<()> {
3034    ///
3035    /// let builder = prepare_request_builder();
3036    /// let response = builder.send().await?;
3037    /// # Ok(()) }
3038    ///
3039    /// fn prepare_request_builder() -> GetProjectIntelligenceConfig {
3040    ///   # panic!();
3041    ///   // ... details omitted ...
3042    /// }
3043    /// ```
3044    #[derive(Clone, Debug)]
3045    pub struct GetProjectIntelligenceConfig(
3046        RequestBuilder<crate::model::GetProjectIntelligenceConfigRequest>,
3047    );
3048
3049    impl GetProjectIntelligenceConfig {
3050        pub(crate) fn new(
3051            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
3052        ) -> Self {
3053            Self(RequestBuilder::new(stub))
3054        }
3055
3056        /// Sets the full request, replacing any prior values.
3057        pub fn with_request<V: Into<crate::model::GetProjectIntelligenceConfigRequest>>(
3058            mut self,
3059            v: V,
3060        ) -> Self {
3061            self.0.request = v.into();
3062            self
3063        }
3064
3065        /// Sets all the options, replacing any prior values.
3066        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3067            self.0.options = v.into();
3068            self
3069        }
3070
3071        /// Sends the request.
3072        pub async fn send(self) -> Result<crate::model::IntelligenceConfig> {
3073            (*self.0.stub)
3074                .get_project_intelligence_config(self.0.request, self.0.options)
3075                .await
3076                .map(crate::Response::into_body)
3077        }
3078
3079        /// Sets the value of [name][crate::model::GetProjectIntelligenceConfigRequest::name].
3080        ///
3081        /// This is a **required** field for requests.
3082        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3083            self.0.request.name = v.into();
3084            self
3085        }
3086    }
3087
3088    #[doc(hidden)]
3089    impl crate::RequestBuilder for GetProjectIntelligenceConfig {
3090        fn request_options(&mut self) -> &mut crate::RequestOptions {
3091            &mut self.0.options
3092        }
3093    }
3094
3095    /// The request builder for [StorageControl::update_project_intelligence_config][crate::client::StorageControl::update_project_intelligence_config] calls.
3096    ///
3097    /// # Example
3098    /// ```
3099    /// # use google_cloud_storage::builder::storage_control::UpdateProjectIntelligenceConfig;
3100    /// # async fn sample() -> google_cloud_storage::Result<()> {
3101    ///
3102    /// let builder = prepare_request_builder();
3103    /// let response = builder.send().await?;
3104    /// # Ok(()) }
3105    ///
3106    /// fn prepare_request_builder() -> UpdateProjectIntelligenceConfig {
3107    ///   # panic!();
3108    ///   // ... details omitted ...
3109    /// }
3110    /// ```
3111    #[derive(Clone, Debug)]
3112    pub struct UpdateProjectIntelligenceConfig(
3113        RequestBuilder<crate::model::UpdateProjectIntelligenceConfigRequest>,
3114    );
3115
3116    impl UpdateProjectIntelligenceConfig {
3117        pub(crate) fn new(
3118            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
3119        ) -> Self {
3120            Self(RequestBuilder::new(stub))
3121        }
3122
3123        /// Sets the full request, replacing any prior values.
3124        pub fn with_request<V: Into<crate::model::UpdateProjectIntelligenceConfigRequest>>(
3125            mut self,
3126            v: V,
3127        ) -> Self {
3128            self.0.request = v.into();
3129            self
3130        }
3131
3132        /// Sets all the options, replacing any prior values.
3133        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3134            self.0.options = v.into();
3135            self
3136        }
3137
3138        /// Sends the request.
3139        pub async fn send(self) -> Result<crate::model::IntelligenceConfig> {
3140            (*self.0.stub)
3141                .update_project_intelligence_config(self.0.request, self.0.options)
3142                .await
3143                .map(crate::Response::into_body)
3144        }
3145
3146        /// Sets the value of [intelligence_config][crate::model::UpdateProjectIntelligenceConfigRequest::intelligence_config].
3147        ///
3148        /// This is a **required** field for requests.
3149        pub fn set_intelligence_config<T>(mut self, v: T) -> Self
3150        where
3151            T: std::convert::Into<crate::model::IntelligenceConfig>,
3152        {
3153            self.0.request.intelligence_config = std::option::Option::Some(v.into());
3154            self
3155        }
3156
3157        /// Sets or clears the value of [intelligence_config][crate::model::UpdateProjectIntelligenceConfigRequest::intelligence_config].
3158        ///
3159        /// This is a **required** field for requests.
3160        pub fn set_or_clear_intelligence_config<T>(mut self, v: std::option::Option<T>) -> Self
3161        where
3162            T: std::convert::Into<crate::model::IntelligenceConfig>,
3163        {
3164            self.0.request.intelligence_config = v.map(|x| x.into());
3165            self
3166        }
3167
3168        /// Sets the value of [update_mask][crate::model::UpdateProjectIntelligenceConfigRequest::update_mask].
3169        ///
3170        /// This is a **required** field for requests.
3171        pub fn set_update_mask<T>(mut self, v: T) -> Self
3172        where
3173            T: std::convert::Into<wkt::FieldMask>,
3174        {
3175            self.0.request.update_mask = std::option::Option::Some(v.into());
3176            self
3177        }
3178
3179        /// Sets or clears the value of [update_mask][crate::model::UpdateProjectIntelligenceConfigRequest::update_mask].
3180        ///
3181        /// This is a **required** field for requests.
3182        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3183        where
3184            T: std::convert::Into<wkt::FieldMask>,
3185        {
3186            self.0.request.update_mask = v.map(|x| x.into());
3187            self
3188        }
3189
3190        /// Sets the value of [request_id][crate::model::UpdateProjectIntelligenceConfigRequest::request_id].
3191        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3192            self.0.request.request_id = v.into();
3193            self
3194        }
3195    }
3196
3197    #[doc(hidden)]
3198    impl crate::RequestBuilder for UpdateProjectIntelligenceConfig {
3199        fn request_options(&mut self) -> &mut crate::RequestOptions {
3200            &mut self.0.options
3201        }
3202    }
3203
3204    /// The request builder for [StorageControl::get_folder_intelligence_config][crate::client::StorageControl::get_folder_intelligence_config] calls.
3205    ///
3206    /// # Example
3207    /// ```
3208    /// # use google_cloud_storage::builder::storage_control::GetFolderIntelligenceConfig;
3209    /// # async fn sample() -> google_cloud_storage::Result<()> {
3210    ///
3211    /// let builder = prepare_request_builder();
3212    /// let response = builder.send().await?;
3213    /// # Ok(()) }
3214    ///
3215    /// fn prepare_request_builder() -> GetFolderIntelligenceConfig {
3216    ///   # panic!();
3217    ///   // ... details omitted ...
3218    /// }
3219    /// ```
3220    #[derive(Clone, Debug)]
3221    pub struct GetFolderIntelligenceConfig(
3222        RequestBuilder<crate::model::GetFolderIntelligenceConfigRequest>,
3223    );
3224
3225    impl GetFolderIntelligenceConfig {
3226        pub(crate) fn new(
3227            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
3228        ) -> Self {
3229            Self(RequestBuilder::new(stub))
3230        }
3231
3232        /// Sets the full request, replacing any prior values.
3233        pub fn with_request<V: Into<crate::model::GetFolderIntelligenceConfigRequest>>(
3234            mut self,
3235            v: V,
3236        ) -> Self {
3237            self.0.request = v.into();
3238            self
3239        }
3240
3241        /// Sets all the options, replacing any prior values.
3242        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3243            self.0.options = v.into();
3244            self
3245        }
3246
3247        /// Sends the request.
3248        pub async fn send(self) -> Result<crate::model::IntelligenceConfig> {
3249            (*self.0.stub)
3250                .get_folder_intelligence_config(self.0.request, self.0.options)
3251                .await
3252                .map(crate::Response::into_body)
3253        }
3254
3255        /// Sets the value of [name][crate::model::GetFolderIntelligenceConfigRequest::name].
3256        ///
3257        /// This is a **required** field for requests.
3258        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3259            self.0.request.name = v.into();
3260            self
3261        }
3262    }
3263
3264    #[doc(hidden)]
3265    impl crate::RequestBuilder for GetFolderIntelligenceConfig {
3266        fn request_options(&mut self) -> &mut crate::RequestOptions {
3267            &mut self.0.options
3268        }
3269    }
3270
3271    /// The request builder for [StorageControl::update_folder_intelligence_config][crate::client::StorageControl::update_folder_intelligence_config] calls.
3272    ///
3273    /// # Example
3274    /// ```
3275    /// # use google_cloud_storage::builder::storage_control::UpdateFolderIntelligenceConfig;
3276    /// # async fn sample() -> google_cloud_storage::Result<()> {
3277    ///
3278    /// let builder = prepare_request_builder();
3279    /// let response = builder.send().await?;
3280    /// # Ok(()) }
3281    ///
3282    /// fn prepare_request_builder() -> UpdateFolderIntelligenceConfig {
3283    ///   # panic!();
3284    ///   // ... details omitted ...
3285    /// }
3286    /// ```
3287    #[derive(Clone, Debug)]
3288    pub struct UpdateFolderIntelligenceConfig(
3289        RequestBuilder<crate::model::UpdateFolderIntelligenceConfigRequest>,
3290    );
3291
3292    impl UpdateFolderIntelligenceConfig {
3293        pub(crate) fn new(
3294            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
3295        ) -> Self {
3296            Self(RequestBuilder::new(stub))
3297        }
3298
3299        /// Sets the full request, replacing any prior values.
3300        pub fn with_request<V: Into<crate::model::UpdateFolderIntelligenceConfigRequest>>(
3301            mut self,
3302            v: V,
3303        ) -> Self {
3304            self.0.request = v.into();
3305            self
3306        }
3307
3308        /// Sets all the options, replacing any prior values.
3309        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3310            self.0.options = v.into();
3311            self
3312        }
3313
3314        /// Sends the request.
3315        pub async fn send(self) -> Result<crate::model::IntelligenceConfig> {
3316            (*self.0.stub)
3317                .update_folder_intelligence_config(self.0.request, self.0.options)
3318                .await
3319                .map(crate::Response::into_body)
3320        }
3321
3322        /// Sets the value of [intelligence_config][crate::model::UpdateFolderIntelligenceConfigRequest::intelligence_config].
3323        ///
3324        /// This is a **required** field for requests.
3325        pub fn set_intelligence_config<T>(mut self, v: T) -> Self
3326        where
3327            T: std::convert::Into<crate::model::IntelligenceConfig>,
3328        {
3329            self.0.request.intelligence_config = std::option::Option::Some(v.into());
3330            self
3331        }
3332
3333        /// Sets or clears the value of [intelligence_config][crate::model::UpdateFolderIntelligenceConfigRequest::intelligence_config].
3334        ///
3335        /// This is a **required** field for requests.
3336        pub fn set_or_clear_intelligence_config<T>(mut self, v: std::option::Option<T>) -> Self
3337        where
3338            T: std::convert::Into<crate::model::IntelligenceConfig>,
3339        {
3340            self.0.request.intelligence_config = v.map(|x| x.into());
3341            self
3342        }
3343
3344        /// Sets the value of [update_mask][crate::model::UpdateFolderIntelligenceConfigRequest::update_mask].
3345        ///
3346        /// This is a **required** field for requests.
3347        pub fn set_update_mask<T>(mut self, v: T) -> Self
3348        where
3349            T: std::convert::Into<wkt::FieldMask>,
3350        {
3351            self.0.request.update_mask = std::option::Option::Some(v.into());
3352            self
3353        }
3354
3355        /// Sets or clears the value of [update_mask][crate::model::UpdateFolderIntelligenceConfigRequest::update_mask].
3356        ///
3357        /// This is a **required** field for requests.
3358        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3359        where
3360            T: std::convert::Into<wkt::FieldMask>,
3361        {
3362            self.0.request.update_mask = v.map(|x| x.into());
3363            self
3364        }
3365
3366        /// Sets the value of [request_id][crate::model::UpdateFolderIntelligenceConfigRequest::request_id].
3367        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3368            self.0.request.request_id = v.into();
3369            self
3370        }
3371    }
3372
3373    #[doc(hidden)]
3374    impl crate::RequestBuilder for UpdateFolderIntelligenceConfig {
3375        fn request_options(&mut self) -> &mut crate::RequestOptions {
3376            &mut self.0.options
3377        }
3378    }
3379
3380    /// The request builder for [StorageControl::get_organization_intelligence_config][crate::client::StorageControl::get_organization_intelligence_config] calls.
3381    ///
3382    /// # Example
3383    /// ```
3384    /// # use google_cloud_storage::builder::storage_control::GetOrganizationIntelligenceConfig;
3385    /// # async fn sample() -> google_cloud_storage::Result<()> {
3386    ///
3387    /// let builder = prepare_request_builder();
3388    /// let response = builder.send().await?;
3389    /// # Ok(()) }
3390    ///
3391    /// fn prepare_request_builder() -> GetOrganizationIntelligenceConfig {
3392    ///   # panic!();
3393    ///   // ... details omitted ...
3394    /// }
3395    /// ```
3396    #[derive(Clone, Debug)]
3397    pub struct GetOrganizationIntelligenceConfig(
3398        RequestBuilder<crate::model::GetOrganizationIntelligenceConfigRequest>,
3399    );
3400
3401    impl GetOrganizationIntelligenceConfig {
3402        pub(crate) fn new(
3403            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
3404        ) -> Self {
3405            Self(RequestBuilder::new(stub))
3406        }
3407
3408        /// Sets the full request, replacing any prior values.
3409        pub fn with_request<V: Into<crate::model::GetOrganizationIntelligenceConfigRequest>>(
3410            mut self,
3411            v: V,
3412        ) -> Self {
3413            self.0.request = v.into();
3414            self
3415        }
3416
3417        /// Sets all the options, replacing any prior values.
3418        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3419            self.0.options = v.into();
3420            self
3421        }
3422
3423        /// Sends the request.
3424        pub async fn send(self) -> Result<crate::model::IntelligenceConfig> {
3425            (*self.0.stub)
3426                .get_organization_intelligence_config(self.0.request, self.0.options)
3427                .await
3428                .map(crate::Response::into_body)
3429        }
3430
3431        /// Sets the value of [name][crate::model::GetOrganizationIntelligenceConfigRequest::name].
3432        ///
3433        /// This is a **required** field for requests.
3434        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3435            self.0.request.name = v.into();
3436            self
3437        }
3438    }
3439
3440    #[doc(hidden)]
3441    impl crate::RequestBuilder for GetOrganizationIntelligenceConfig {
3442        fn request_options(&mut self) -> &mut crate::RequestOptions {
3443            &mut self.0.options
3444        }
3445    }
3446
3447    /// The request builder for [StorageControl::update_organization_intelligence_config][crate::client::StorageControl::update_organization_intelligence_config] calls.
3448    ///
3449    /// # Example
3450    /// ```
3451    /// # use google_cloud_storage::builder::storage_control::UpdateOrganizationIntelligenceConfig;
3452    /// # async fn sample() -> google_cloud_storage::Result<()> {
3453    ///
3454    /// let builder = prepare_request_builder();
3455    /// let response = builder.send().await?;
3456    /// # Ok(()) }
3457    ///
3458    /// fn prepare_request_builder() -> UpdateOrganizationIntelligenceConfig {
3459    ///   # panic!();
3460    ///   // ... details omitted ...
3461    /// }
3462    /// ```
3463    #[derive(Clone, Debug)]
3464    pub struct UpdateOrganizationIntelligenceConfig(
3465        RequestBuilder<crate::model::UpdateOrganizationIntelligenceConfigRequest>,
3466    );
3467
3468    impl UpdateOrganizationIntelligenceConfig {
3469        pub(crate) fn new(
3470            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
3471        ) -> Self {
3472            Self(RequestBuilder::new(stub))
3473        }
3474
3475        /// Sets the full request, replacing any prior values.
3476        pub fn with_request<V: Into<crate::model::UpdateOrganizationIntelligenceConfigRequest>>(
3477            mut self,
3478            v: V,
3479        ) -> Self {
3480            self.0.request = v.into();
3481            self
3482        }
3483
3484        /// Sets all the options, replacing any prior values.
3485        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3486            self.0.options = v.into();
3487            self
3488        }
3489
3490        /// Sends the request.
3491        pub async fn send(self) -> Result<crate::model::IntelligenceConfig> {
3492            (*self.0.stub)
3493                .update_organization_intelligence_config(self.0.request, self.0.options)
3494                .await
3495                .map(crate::Response::into_body)
3496        }
3497
3498        /// Sets the value of [intelligence_config][crate::model::UpdateOrganizationIntelligenceConfigRequest::intelligence_config].
3499        ///
3500        /// This is a **required** field for requests.
3501        pub fn set_intelligence_config<T>(mut self, v: T) -> Self
3502        where
3503            T: std::convert::Into<crate::model::IntelligenceConfig>,
3504        {
3505            self.0.request.intelligence_config = std::option::Option::Some(v.into());
3506            self
3507        }
3508
3509        /// Sets or clears the value of [intelligence_config][crate::model::UpdateOrganizationIntelligenceConfigRequest::intelligence_config].
3510        ///
3511        /// This is a **required** field for requests.
3512        pub fn set_or_clear_intelligence_config<T>(mut self, v: std::option::Option<T>) -> Self
3513        where
3514            T: std::convert::Into<crate::model::IntelligenceConfig>,
3515        {
3516            self.0.request.intelligence_config = v.map(|x| x.into());
3517            self
3518        }
3519
3520        /// Sets the value of [update_mask][crate::model::UpdateOrganizationIntelligenceConfigRequest::update_mask].
3521        ///
3522        /// This is a **required** field for requests.
3523        pub fn set_update_mask<T>(mut self, v: T) -> Self
3524        where
3525            T: std::convert::Into<wkt::FieldMask>,
3526        {
3527            self.0.request.update_mask = std::option::Option::Some(v.into());
3528            self
3529        }
3530
3531        /// Sets or clears the value of [update_mask][crate::model::UpdateOrganizationIntelligenceConfigRequest::update_mask].
3532        ///
3533        /// This is a **required** field for requests.
3534        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3535        where
3536            T: std::convert::Into<wkt::FieldMask>,
3537        {
3538            self.0.request.update_mask = v.map(|x| x.into());
3539            self
3540        }
3541
3542        /// Sets the value of [request_id][crate::model::UpdateOrganizationIntelligenceConfigRequest::request_id].
3543        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3544            self.0.request.request_id = v.into();
3545            self
3546        }
3547    }
3548
3549    #[doc(hidden)]
3550    impl crate::RequestBuilder for UpdateOrganizationIntelligenceConfig {
3551        fn request_options(&mut self) -> &mut crate::RequestOptions {
3552            &mut self.0.options
3553        }
3554    }
3555
3556    /// The request builder for [StorageControl::get_iam_policy][crate::client::StorageControl::get_iam_policy] calls.
3557    ///
3558    /// # Example
3559    /// ```
3560    /// # use google_cloud_storage::builder::storage_control::GetIamPolicy;
3561    /// # async fn sample() -> google_cloud_storage::Result<()> {
3562    ///
3563    /// let builder = prepare_request_builder();
3564    /// let response = builder.send().await?;
3565    /// # Ok(()) }
3566    ///
3567    /// fn prepare_request_builder() -> GetIamPolicy {
3568    ///   # panic!();
3569    ///   // ... details omitted ...
3570    /// }
3571    /// ```
3572    #[derive(Clone, Debug)]
3573    pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
3574
3575    impl GetIamPolicy {
3576        pub(crate) fn new(
3577            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
3578        ) -> Self {
3579            Self(RequestBuilder::new(stub))
3580        }
3581
3582        /// Sets the full request, replacing any prior values.
3583        pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
3584            mut self,
3585            v: V,
3586        ) -> Self {
3587            self.0.request = v.into();
3588            self
3589        }
3590
3591        /// Sets all the options, replacing any prior values.
3592        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3593            self.0.options = v.into();
3594            self
3595        }
3596
3597        /// Sends the request.
3598        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
3599            (*self.0.stub)
3600                .get_iam_policy(self.0.request, self.0.options)
3601                .await
3602                .map(crate::Response::into_body)
3603        }
3604
3605        /// Sets the value of [resource][google_cloud_iam_v1::model::GetIamPolicyRequest::resource].
3606        ///
3607        /// This is a **required** field for requests.
3608        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
3609            self.0.request.resource = v.into();
3610            self
3611        }
3612
3613        /// Sets the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
3614        pub fn set_options<T>(mut self, v: T) -> Self
3615        where
3616            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
3617        {
3618            self.0.request.options = std::option::Option::Some(v.into());
3619            self
3620        }
3621
3622        /// Sets or clears the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
3623        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
3624        where
3625            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
3626        {
3627            self.0.request.options = v.map(|x| x.into());
3628            self
3629        }
3630    }
3631
3632    #[doc(hidden)]
3633    impl crate::RequestBuilder for GetIamPolicy {
3634        fn request_options(&mut self) -> &mut crate::RequestOptions {
3635            &mut self.0.options
3636        }
3637    }
3638
3639    /// The request builder for [StorageControl::set_iam_policy][crate::client::StorageControl::set_iam_policy] calls.
3640    ///
3641    /// # Example
3642    /// ```
3643    /// # use google_cloud_storage::builder::storage_control::SetIamPolicy;
3644    /// # async fn sample() -> google_cloud_storage::Result<()> {
3645    ///
3646    /// let builder = prepare_request_builder();
3647    /// let response = builder.send().await?;
3648    /// # Ok(()) }
3649    ///
3650    /// fn prepare_request_builder() -> SetIamPolicy {
3651    ///   # panic!();
3652    ///   // ... details omitted ...
3653    /// }
3654    /// ```
3655    #[derive(Clone, Debug)]
3656    pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
3657
3658    impl SetIamPolicy {
3659        pub(crate) fn new(
3660            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
3661        ) -> Self {
3662            Self(RequestBuilder::new(stub))
3663        }
3664
3665        /// Sets the full request, replacing any prior values.
3666        pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
3667            mut self,
3668            v: V,
3669        ) -> Self {
3670            self.0.request = v.into();
3671            self
3672        }
3673
3674        /// Sets all the options, replacing any prior values.
3675        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3676            self.0.options = v.into();
3677            self
3678        }
3679
3680        /// Sends the request.
3681        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
3682            (*self.0.stub)
3683                .set_iam_policy(self.0.request, self.0.options)
3684                .await
3685                .map(crate::Response::into_body)
3686        }
3687
3688        /// Sets the value of [resource][google_cloud_iam_v1::model::SetIamPolicyRequest::resource].
3689        ///
3690        /// This is a **required** field for requests.
3691        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
3692            self.0.request.resource = v.into();
3693            self
3694        }
3695
3696        /// Sets the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
3697        ///
3698        /// This is a **required** field for requests.
3699        pub fn set_policy<T>(mut self, v: T) -> Self
3700        where
3701            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
3702        {
3703            self.0.request.policy = std::option::Option::Some(v.into());
3704            self
3705        }
3706
3707        /// Sets or clears the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
3708        ///
3709        /// This is a **required** field for requests.
3710        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
3711        where
3712            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
3713        {
3714            self.0.request.policy = v.map(|x| x.into());
3715            self
3716        }
3717
3718        /// Sets the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
3719        pub fn set_update_mask<T>(mut self, v: T) -> Self
3720        where
3721            T: std::convert::Into<wkt::FieldMask>,
3722        {
3723            self.0.request.update_mask = std::option::Option::Some(v.into());
3724            self
3725        }
3726
3727        /// Sets or clears the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
3728        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3729        where
3730            T: std::convert::Into<wkt::FieldMask>,
3731        {
3732            self.0.request.update_mask = v.map(|x| x.into());
3733            self
3734        }
3735    }
3736
3737    #[doc(hidden)]
3738    impl crate::RequestBuilder for SetIamPolicy {
3739        fn request_options(&mut self) -> &mut crate::RequestOptions {
3740            &mut self.0.options
3741        }
3742    }
3743
3744    /// The request builder for [StorageControl::test_iam_permissions][crate::client::StorageControl::test_iam_permissions] calls.
3745    ///
3746    /// # Example
3747    /// ```
3748    /// # use google_cloud_storage::builder::storage_control::TestIamPermissions;
3749    /// # async fn sample() -> google_cloud_storage::Result<()> {
3750    ///
3751    /// let builder = prepare_request_builder();
3752    /// let response = builder.send().await?;
3753    /// # Ok(()) }
3754    ///
3755    /// fn prepare_request_builder() -> TestIamPermissions {
3756    ///   # panic!();
3757    ///   // ... details omitted ...
3758    /// }
3759    /// ```
3760    #[derive(Clone, Debug)]
3761    pub struct TestIamPermissions(
3762        RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
3763    );
3764
3765    impl TestIamPermissions {
3766        pub(crate) fn new(
3767            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
3768        ) -> Self {
3769            Self(RequestBuilder::new(stub))
3770        }
3771
3772        /// Sets the full request, replacing any prior values.
3773        pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
3774            mut self,
3775            v: V,
3776        ) -> Self {
3777            self.0.request = v.into();
3778            self
3779        }
3780
3781        /// Sets all the options, replacing any prior values.
3782        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3783            self.0.options = v.into();
3784            self
3785        }
3786
3787        /// Sends the request.
3788        pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
3789            (*self.0.stub)
3790                .test_iam_permissions(self.0.request, self.0.options)
3791                .await
3792                .map(crate::Response::into_body)
3793        }
3794
3795        /// Sets the value of [resource][google_cloud_iam_v1::model::TestIamPermissionsRequest::resource].
3796        ///
3797        /// This is a **required** field for requests.
3798        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
3799            self.0.request.resource = v.into();
3800            self
3801        }
3802
3803        /// Sets the value of [permissions][google_cloud_iam_v1::model::TestIamPermissionsRequest::permissions].
3804        ///
3805        /// This is a **required** field for requests.
3806        pub fn set_permissions<T, V>(mut self, v: T) -> Self
3807        where
3808            T: std::iter::IntoIterator<Item = V>,
3809            V: std::convert::Into<std::string::String>,
3810        {
3811            use std::iter::Iterator;
3812            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
3813            self
3814        }
3815    }
3816
3817    #[doc(hidden)]
3818    impl crate::RequestBuilder for TestIamPermissions {
3819        fn request_options(&mut self) -> &mut crate::RequestOptions {
3820            &mut self.0.options
3821        }
3822    }
3823
3824    /// The request builder for [StorageControl::get_intelligence_finding][crate::client::StorageControl::get_intelligence_finding] calls.
3825    ///
3826    /// # Example
3827    /// ```
3828    /// # use google_cloud_storage::builder::storage_control::GetIntelligenceFinding;
3829    /// # async fn sample() -> google_cloud_storage::Result<()> {
3830    ///
3831    /// let builder = prepare_request_builder();
3832    /// let response = builder.send().await?;
3833    /// # Ok(()) }
3834    ///
3835    /// fn prepare_request_builder() -> GetIntelligenceFinding {
3836    ///   # panic!();
3837    ///   // ... details omitted ...
3838    /// }
3839    /// ```
3840    #[derive(Clone, Debug)]
3841    pub struct GetIntelligenceFinding(RequestBuilder<crate::model::GetIntelligenceFindingRequest>);
3842
3843    impl GetIntelligenceFinding {
3844        pub(crate) fn new(
3845            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
3846        ) -> Self {
3847            Self(RequestBuilder::new(stub))
3848        }
3849
3850        /// Sets the full request, replacing any prior values.
3851        pub fn with_request<V: Into<crate::model::GetIntelligenceFindingRequest>>(
3852            mut self,
3853            v: V,
3854        ) -> Self {
3855            self.0.request = v.into();
3856            self
3857        }
3858
3859        /// Sets all the options, replacing any prior values.
3860        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3861            self.0.options = v.into();
3862            self
3863        }
3864
3865        /// Sends the request.
3866        pub async fn send(self) -> Result<crate::model::IntelligenceFinding> {
3867            (*self.0.stub)
3868                .get_intelligence_finding(self.0.request, self.0.options)
3869                .await
3870                .map(crate::Response::into_body)
3871        }
3872
3873        /// Sets the value of [name][crate::model::GetIntelligenceFindingRequest::name].
3874        ///
3875        /// This is a **required** field for requests.
3876        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3877            self.0.request.name = v.into();
3878            self
3879        }
3880    }
3881
3882    #[doc(hidden)]
3883    impl crate::RequestBuilder for GetIntelligenceFinding {
3884        fn request_options(&mut self) -> &mut crate::RequestOptions {
3885            &mut self.0.options
3886        }
3887    }
3888
3889    /// The request builder for [StorageControl::list_intelligence_findings][crate::client::StorageControl::list_intelligence_findings] calls.
3890    ///
3891    /// # Example
3892    /// ```
3893    /// # use google_cloud_storage::builder::storage_control::ListIntelligenceFindings;
3894    /// # async fn sample() -> google_cloud_storage::Result<()> {
3895    /// use google_cloud_gax::paginator::ItemPaginator;
3896    ///
3897    /// let builder = prepare_request_builder();
3898    /// let mut items = builder.by_item();
3899    /// while let Some(result) = items.next().await {
3900    ///   let item = result?;
3901    /// }
3902    /// # Ok(()) }
3903    ///
3904    /// fn prepare_request_builder() -> ListIntelligenceFindings {
3905    ///   # panic!();
3906    ///   // ... details omitted ...
3907    /// }
3908    /// ```
3909    #[derive(Clone, Debug)]
3910    pub struct ListIntelligenceFindings(
3911        RequestBuilder<crate::model::ListIntelligenceFindingsRequest>,
3912    );
3913
3914    impl ListIntelligenceFindings {
3915        pub(crate) fn new(
3916            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
3917        ) -> Self {
3918            Self(RequestBuilder::new(stub))
3919        }
3920
3921        /// Sets the full request, replacing any prior values.
3922        pub fn with_request<V: Into<crate::model::ListIntelligenceFindingsRequest>>(
3923            mut self,
3924            v: V,
3925        ) -> Self {
3926            self.0.request = v.into();
3927            self
3928        }
3929
3930        /// Sets all the options, replacing any prior values.
3931        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3932            self.0.options = v.into();
3933            self
3934        }
3935
3936        /// Sends the request.
3937        pub async fn send(self) -> Result<crate::model::ListIntelligenceFindingsResponse> {
3938            (*self.0.stub)
3939                .list_intelligence_findings(self.0.request, self.0.options)
3940                .await
3941                .map(crate::Response::into_body)
3942        }
3943
3944        /// Streams each page in the collection.
3945        pub fn by_page(
3946            self,
3947        ) -> impl google_cloud_gax::paginator::Paginator<
3948            crate::model::ListIntelligenceFindingsResponse,
3949            crate::Error,
3950        > {
3951            use std::clone::Clone;
3952            let token = self.0.request.page_token.clone();
3953            let execute = move |token: String| {
3954                let mut builder = self.clone();
3955                builder.0.request = builder.0.request.set_page_token(token);
3956                builder.send()
3957            };
3958            google_cloud_gax::paginator::internal::new_paginator(token, execute)
3959        }
3960
3961        /// Streams each item in the collection.
3962        pub fn by_item(
3963            self,
3964        ) -> impl google_cloud_gax::paginator::ItemPaginator<
3965            crate::model::ListIntelligenceFindingsResponse,
3966            crate::Error,
3967        > {
3968            use google_cloud_gax::paginator::Paginator;
3969            self.by_page().items()
3970        }
3971
3972        /// Sets the value of [parent][crate::model::ListIntelligenceFindingsRequest::parent].
3973        ///
3974        /// This is a **required** field for requests.
3975        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3976            self.0.request.parent = v.into();
3977            self
3978        }
3979
3980        /// Sets the value of [filter][crate::model::ListIntelligenceFindingsRequest::filter].
3981        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3982            self.0.request.filter = v.into();
3983            self
3984        }
3985
3986        /// Sets the value of [page_size][crate::model::ListIntelligenceFindingsRequest::page_size].
3987        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3988            self.0.request.page_size = v.into();
3989            self
3990        }
3991
3992        /// Sets the value of [page_token][crate::model::ListIntelligenceFindingsRequest::page_token].
3993        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3994            self.0.request.page_token = v.into();
3995            self
3996        }
3997    }
3998
3999    #[doc(hidden)]
4000    impl crate::RequestBuilder for ListIntelligenceFindings {
4001        fn request_options(&mut self) -> &mut crate::RequestOptions {
4002            &mut self.0.options
4003        }
4004    }
4005
4006    /// The request builder for [StorageControl::summarize_intelligence_findings][crate::client::StorageControl::summarize_intelligence_findings] calls.
4007    ///
4008    /// # Example
4009    /// ```
4010    /// # use google_cloud_storage::builder::storage_control::SummarizeIntelligenceFindings;
4011    /// # async fn sample() -> google_cloud_storage::Result<()> {
4012    /// use google_cloud_gax::paginator::ItemPaginator;
4013    ///
4014    /// let builder = prepare_request_builder();
4015    /// let mut items = builder.by_item();
4016    /// while let Some(result) = items.next().await {
4017    ///   let item = result?;
4018    /// }
4019    /// # Ok(()) }
4020    ///
4021    /// fn prepare_request_builder() -> SummarizeIntelligenceFindings {
4022    ///   # panic!();
4023    ///   // ... details omitted ...
4024    /// }
4025    /// ```
4026    #[derive(Clone, Debug)]
4027    pub struct SummarizeIntelligenceFindings(
4028        RequestBuilder<crate::model::SummarizeIntelligenceFindingsRequest>,
4029    );
4030
4031    impl SummarizeIntelligenceFindings {
4032        pub(crate) fn new(
4033            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
4034        ) -> Self {
4035            Self(RequestBuilder::new(stub))
4036        }
4037
4038        /// Sets the full request, replacing any prior values.
4039        pub fn with_request<V: Into<crate::model::SummarizeIntelligenceFindingsRequest>>(
4040            mut self,
4041            v: V,
4042        ) -> Self {
4043            self.0.request = v.into();
4044            self
4045        }
4046
4047        /// Sets all the options, replacing any prior values.
4048        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4049            self.0.options = v.into();
4050            self
4051        }
4052
4053        /// Sends the request.
4054        pub async fn send(self) -> Result<crate::model::SummarizeIntelligenceFindingsResponse> {
4055            (*self.0.stub)
4056                .summarize_intelligence_findings(self.0.request, self.0.options)
4057                .await
4058                .map(crate::Response::into_body)
4059        }
4060
4061        /// Streams each page in the collection.
4062        pub fn by_page(
4063            self,
4064        ) -> impl google_cloud_gax::paginator::Paginator<
4065            crate::model::SummarizeIntelligenceFindingsResponse,
4066            crate::Error,
4067        > {
4068            use std::clone::Clone;
4069            let token = self.0.request.page_token.clone();
4070            let execute = move |token: String| {
4071                let mut builder = self.clone();
4072                builder.0.request = builder.0.request.set_page_token(token);
4073                builder.send()
4074            };
4075            google_cloud_gax::paginator::internal::new_paginator(token, execute)
4076        }
4077
4078        /// Streams each item in the collection.
4079        pub fn by_item(
4080            self,
4081        ) -> impl google_cloud_gax::paginator::ItemPaginator<
4082            crate::model::SummarizeIntelligenceFindingsResponse,
4083            crate::Error,
4084        > {
4085            use google_cloud_gax::paginator::Paginator;
4086            self.by_page().items()
4087        }
4088
4089        /// Sets the value of [parent][crate::model::SummarizeIntelligenceFindingsRequest::parent].
4090        ///
4091        /// This is a **required** field for requests.
4092        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4093            self.0.request.parent = v.into();
4094            self
4095        }
4096
4097        /// Sets the value of [resource_scope][crate::model::SummarizeIntelligenceFindingsRequest::resource_scope].
4098        pub fn set_resource_scope<
4099            T: Into<crate::model::summarize_intelligence_findings_request::ResourceScope>,
4100        >(
4101            mut self,
4102            v: T,
4103        ) -> Self {
4104            self.0.request.resource_scope = v.into();
4105            self
4106        }
4107
4108        /// Sets the value of [filter][crate::model::SummarizeIntelligenceFindingsRequest::filter].
4109        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4110            self.0.request.filter = v.into();
4111            self
4112        }
4113
4114        /// Sets the value of [page_size][crate::model::SummarizeIntelligenceFindingsRequest::page_size].
4115        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4116            self.0.request.page_size = v.into();
4117            self
4118        }
4119
4120        /// Sets the value of [page_token][crate::model::SummarizeIntelligenceFindingsRequest::page_token].
4121        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4122            self.0.request.page_token = v.into();
4123            self
4124        }
4125    }
4126
4127    #[doc(hidden)]
4128    impl crate::RequestBuilder for SummarizeIntelligenceFindings {
4129        fn request_options(&mut self) -> &mut crate::RequestOptions {
4130            &mut self.0.options
4131        }
4132    }
4133
4134    /// The request builder for [StorageControl::get_intelligence_finding_revision][crate::client::StorageControl::get_intelligence_finding_revision] calls.
4135    ///
4136    /// # Example
4137    /// ```
4138    /// # use google_cloud_storage::builder::storage_control::GetIntelligenceFindingRevision;
4139    /// # async fn sample() -> google_cloud_storage::Result<()> {
4140    ///
4141    /// let builder = prepare_request_builder();
4142    /// let response = builder.send().await?;
4143    /// # Ok(()) }
4144    ///
4145    /// fn prepare_request_builder() -> GetIntelligenceFindingRevision {
4146    ///   # panic!();
4147    ///   // ... details omitted ...
4148    /// }
4149    /// ```
4150    #[derive(Clone, Debug)]
4151    pub struct GetIntelligenceFindingRevision(
4152        RequestBuilder<crate::model::GetIntelligenceFindingRevisionRequest>,
4153    );
4154
4155    impl GetIntelligenceFindingRevision {
4156        pub(crate) fn new(
4157            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
4158        ) -> Self {
4159            Self(RequestBuilder::new(stub))
4160        }
4161
4162        /// Sets the full request, replacing any prior values.
4163        pub fn with_request<V: Into<crate::model::GetIntelligenceFindingRevisionRequest>>(
4164            mut self,
4165            v: V,
4166        ) -> Self {
4167            self.0.request = v.into();
4168            self
4169        }
4170
4171        /// Sets all the options, replacing any prior values.
4172        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4173            self.0.options = v.into();
4174            self
4175        }
4176
4177        /// Sends the request.
4178        pub async fn send(self) -> Result<crate::model::IntelligenceFindingRevision> {
4179            (*self.0.stub)
4180                .get_intelligence_finding_revision(self.0.request, self.0.options)
4181                .await
4182                .map(crate::Response::into_body)
4183        }
4184
4185        /// Sets the value of [name][crate::model::GetIntelligenceFindingRevisionRequest::name].
4186        ///
4187        /// This is a **required** field for requests.
4188        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4189            self.0.request.name = v.into();
4190            self
4191        }
4192    }
4193
4194    #[doc(hidden)]
4195    impl crate::RequestBuilder for GetIntelligenceFindingRevision {
4196        fn request_options(&mut self) -> &mut crate::RequestOptions {
4197            &mut self.0.options
4198        }
4199    }
4200
4201    /// The request builder for [StorageControl::list_intelligence_finding_revisions][crate::client::StorageControl::list_intelligence_finding_revisions] calls.
4202    ///
4203    /// # Example
4204    /// ```
4205    /// # use google_cloud_storage::builder::storage_control::ListIntelligenceFindingRevisions;
4206    /// # async fn sample() -> google_cloud_storage::Result<()> {
4207    /// use google_cloud_gax::paginator::ItemPaginator;
4208    ///
4209    /// let builder = prepare_request_builder();
4210    /// let mut items = builder.by_item();
4211    /// while let Some(result) = items.next().await {
4212    ///   let item = result?;
4213    /// }
4214    /// # Ok(()) }
4215    ///
4216    /// fn prepare_request_builder() -> ListIntelligenceFindingRevisions {
4217    ///   # panic!();
4218    ///   // ... details omitted ...
4219    /// }
4220    /// ```
4221    #[derive(Clone, Debug)]
4222    pub struct ListIntelligenceFindingRevisions(
4223        RequestBuilder<crate::model::ListIntelligenceFindingRevisionsRequest>,
4224    );
4225
4226    impl ListIntelligenceFindingRevisions {
4227        pub(crate) fn new(
4228            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
4229        ) -> Self {
4230            Self(RequestBuilder::new(stub))
4231        }
4232
4233        /// Sets the full request, replacing any prior values.
4234        pub fn with_request<V: Into<crate::model::ListIntelligenceFindingRevisionsRequest>>(
4235            mut self,
4236            v: V,
4237        ) -> Self {
4238            self.0.request = v.into();
4239            self
4240        }
4241
4242        /// Sets all the options, replacing any prior values.
4243        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4244            self.0.options = v.into();
4245            self
4246        }
4247
4248        /// Sends the request.
4249        pub async fn send(self) -> Result<crate::model::ListIntelligenceFindingRevisionsResponse> {
4250            (*self.0.stub)
4251                .list_intelligence_finding_revisions(self.0.request, self.0.options)
4252                .await
4253                .map(crate::Response::into_body)
4254        }
4255
4256        /// Streams each page in the collection.
4257        pub fn by_page(
4258            self,
4259        ) -> impl google_cloud_gax::paginator::Paginator<
4260            crate::model::ListIntelligenceFindingRevisionsResponse,
4261            crate::Error,
4262        > {
4263            use std::clone::Clone;
4264            let token = self.0.request.page_token.clone();
4265            let execute = move |token: String| {
4266                let mut builder = self.clone();
4267                builder.0.request = builder.0.request.set_page_token(token);
4268                builder.send()
4269            };
4270            google_cloud_gax::paginator::internal::new_paginator(token, execute)
4271        }
4272
4273        /// Streams each item in the collection.
4274        pub fn by_item(
4275            self,
4276        ) -> impl google_cloud_gax::paginator::ItemPaginator<
4277            crate::model::ListIntelligenceFindingRevisionsResponse,
4278            crate::Error,
4279        > {
4280            use google_cloud_gax::paginator::Paginator;
4281            self.by_page().items()
4282        }
4283
4284        /// Sets the value of [parent][crate::model::ListIntelligenceFindingRevisionsRequest::parent].
4285        ///
4286        /// This is a **required** field for requests.
4287        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4288            self.0.request.parent = v.into();
4289            self
4290        }
4291
4292        /// Sets the value of [page_size][crate::model::ListIntelligenceFindingRevisionsRequest::page_size].
4293        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4294            self.0.request.page_size = v.into();
4295            self
4296        }
4297
4298        /// Sets the value of [page_token][crate::model::ListIntelligenceFindingRevisionsRequest::page_token].
4299        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4300            self.0.request.page_token = v.into();
4301            self
4302        }
4303    }
4304
4305    #[doc(hidden)]
4306    impl crate::RequestBuilder for ListIntelligenceFindingRevisions {
4307        fn request_options(&mut self) -> &mut crate::RequestOptions {
4308            &mut self.0.options
4309        }
4310    }
4311
4312    /// The request builder for [StorageControl::view_object_full_context][crate::client::StorageControl::view_object_full_context] calls.
4313    ///
4314    /// # Example
4315    /// ```
4316    /// # use google_cloud_storage::builder::storage_control::ViewObjectFullContext;
4317    /// # async fn sample() -> google_cloud_storage::Result<()> {
4318    ///
4319    /// let builder = prepare_request_builder();
4320    /// let response = builder.send().await?;
4321    /// # Ok(()) }
4322    ///
4323    /// fn prepare_request_builder() -> ViewObjectFullContext {
4324    ///   # panic!();
4325    ///   // ... details omitted ...
4326    /// }
4327    /// ```
4328    #[derive(Clone, Debug)]
4329    pub struct ViewObjectFullContext(RequestBuilder<crate::model::ViewObjectFullContextRequest>);
4330
4331    impl ViewObjectFullContext {
4332        pub(crate) fn new(
4333            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
4334        ) -> Self {
4335            Self(RequestBuilder::new(stub))
4336        }
4337
4338        /// Sets the full request, replacing any prior values.
4339        pub fn with_request<V: Into<crate::model::ViewObjectFullContextRequest>>(
4340            mut self,
4341            v: V,
4342        ) -> Self {
4343            self.0.request = v.into();
4344            self
4345        }
4346
4347        /// Sets all the options, replacing any prior values.
4348        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4349            self.0.options = v.into();
4350            self
4351        }
4352
4353        /// Sends the request.
4354        pub async fn send(self) -> Result<crate::model::ObjectFullContext> {
4355            (*self.0.stub)
4356                .view_object_full_context(self.0.request, self.0.options)
4357                .await
4358                .map(crate::Response::into_body)
4359        }
4360
4361        /// Sets the value of [generation][crate::model::ViewObjectFullContextRequest::generation].
4362        pub fn set_generation<T: Into<i64>>(mut self, v: T) -> Self {
4363            self.0.request.generation = v.into();
4364            self
4365        }
4366
4367        /// Sets the value of [context_key][crate::model::ViewObjectFullContextRequest::context_key].
4368        ///
4369        /// This is a **required** field for requests.
4370        pub fn set_context_key<T: Into<std::string::String>>(mut self, v: T) -> Self {
4371            self.0.request.context_key = v.into();
4372            self
4373        }
4374
4375        /// Sets the value of [name][crate::model::ViewObjectFullContextRequest::name].
4376        ///
4377        /// This is a **required** field for requests.
4378        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4379            self.0.request.name = v.into();
4380            self
4381        }
4382    }
4383
4384    #[doc(hidden)]
4385    impl crate::RequestBuilder for ViewObjectFullContext {
4386        fn request_options(&mut self) -> &mut crate::RequestOptions {
4387            &mut self.0.options
4388        }
4389    }
4390
4391    /// The request builder for [StorageControl::get_operation][crate::client::StorageControl::get_operation] calls.
4392    ///
4393    /// # Example
4394    /// ```
4395    /// # use google_cloud_storage::builder::storage_control::GetOperation;
4396    /// # async fn sample() -> google_cloud_storage::Result<()> {
4397    ///
4398    /// let builder = prepare_request_builder();
4399    /// let response = builder.send().await?;
4400    /// # Ok(()) }
4401    ///
4402    /// fn prepare_request_builder() -> GetOperation {
4403    ///   # panic!();
4404    ///   // ... details omitted ...
4405    /// }
4406    /// ```
4407    #[derive(Clone, Debug)]
4408    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
4409
4410    impl GetOperation {
4411        pub(crate) fn new(
4412            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
4413        ) -> Self {
4414            Self(RequestBuilder::new(stub))
4415        }
4416
4417        /// Sets the full request, replacing any prior values.
4418        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
4419            mut self,
4420            v: V,
4421        ) -> Self {
4422            self.0.request = v.into();
4423            self
4424        }
4425
4426        /// Sets all the options, replacing any prior values.
4427        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4428            self.0.options = v.into();
4429            self
4430        }
4431
4432        /// Sends the request.
4433        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4434            (*self.0.stub)
4435                .get_operation(self.0.request, self.0.options)
4436                .await
4437                .map(crate::Response::into_body)
4438        }
4439
4440        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
4441        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4442            self.0.request.name = v.into();
4443            self
4444        }
4445    }
4446
4447    #[doc(hidden)]
4448    impl crate::RequestBuilder for GetOperation {
4449        fn request_options(&mut self) -> &mut crate::RequestOptions {
4450            &mut self.0.options
4451        }
4452    }
4453}