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::create_anywhere_cache][crate::client::StorageControl::create_anywhere_cache] calls.
1470    ///
1471    /// # Example
1472    /// ```
1473    /// # use google_cloud_storage::builder::storage_control::CreateAnywhereCache;
1474    /// # async fn sample() -> google_cloud_storage::Result<()> {
1475    /// use google_cloud_lro::Poller;
1476    ///
1477    /// let builder = prepare_request_builder();
1478    /// let response = builder.poller().until_done().await?;
1479    /// # Ok(()) }
1480    ///
1481    /// fn prepare_request_builder() -> CreateAnywhereCache {
1482    ///   # panic!();
1483    ///   // ... details omitted ...
1484    /// }
1485    /// ```
1486    #[derive(Clone, Debug)]
1487    pub struct CreateAnywhereCache(RequestBuilder<crate::model::CreateAnywhereCacheRequest>);
1488
1489    impl CreateAnywhereCache {
1490        pub(crate) fn new(
1491            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1492        ) -> Self {
1493            Self(RequestBuilder::new(stub))
1494        }
1495
1496        /// Sets the full request, replacing any prior values.
1497        pub fn with_request<V: Into<crate::model::CreateAnywhereCacheRequest>>(
1498            mut self,
1499            v: V,
1500        ) -> Self {
1501            self.0.request = v.into();
1502            self
1503        }
1504
1505        /// Sets all the options, replacing any prior values.
1506        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1507            self.0.options = v.into();
1508            self
1509        }
1510
1511        /// Sends the request.
1512        ///
1513        /// # Long running operations
1514        ///
1515        /// This starts, but does not poll, a longrunning operation. More information
1516        /// on [create_anywhere_cache][crate::client::StorageControl::create_anywhere_cache].
1517        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1518            let req = Self::auto_populate(self.0.request, false);
1519            (*self.0.stub)
1520                .create_anywhere_cache(req, self.0.options)
1521                .await
1522                .map(crate::Response::into_body)
1523        }
1524
1525        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_anywhere_cache`.
1526        pub fn poller(
1527            self,
1528        ) -> impl google_cloud_lro::Poller<
1529            crate::model::AnywhereCache,
1530            crate::model::CreateAnywhereCacheMetadata,
1531        > {
1532            type Operation = google_cloud_lro::internal::Operation<
1533                crate::model::AnywhereCache,
1534                crate::model::CreateAnywhereCacheMetadata,
1535            >;
1536            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1537            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1538            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1539            if let Some(ref mut details) = poller_options.tracing {
1540                details.method_name = "google_cloud_storage::client::StorageControl::create_anywhere_cache::until_done";
1541            }
1542
1543            let stub = self.0.stub.clone();
1544            let mut options = self.0.options.clone();
1545            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1546            let query = move |name| {
1547                let stub = stub.clone();
1548                let options = options.clone();
1549                async {
1550                    let op = GetOperation::new(stub)
1551                        .set_name(name)
1552                        .with_options(options)
1553                        .send()
1554                        .await?;
1555                    Ok(Operation::new(op))
1556                }
1557            };
1558
1559            let start = move || async {
1560                let op = self.send().await?;
1561                Ok(Operation::new(op))
1562            };
1563
1564            use google_cloud_lro::internal::PollerExt;
1565            {
1566                google_cloud_lro::internal::new_poller(
1567                    polling_error_policy,
1568                    polling_backoff_policy,
1569                    start,
1570                    query,
1571                )
1572            }
1573            .with_options(poller_options)
1574        }
1575
1576        fn auto_populate(
1577            mut req: crate::model::CreateAnywhereCacheRequest,
1578            force: bool,
1579        ) -> crate::model::CreateAnywhereCacheRequest {
1580            if force || req.request_id.is_empty() {
1581                req = req.set_request_id(uuid::Uuid::new_v4().to_string())
1582            }
1583            req
1584        }
1585
1586        /// Sets the value of [parent][crate::model::CreateAnywhereCacheRequest::parent].
1587        ///
1588        /// This is a **required** field for requests.
1589        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1590            self.0.request.parent = v.into();
1591            self
1592        }
1593
1594        /// Sets the value of [anywhere_cache][crate::model::CreateAnywhereCacheRequest::anywhere_cache].
1595        ///
1596        /// This is a **required** field for requests.
1597        pub fn set_anywhere_cache<T>(mut self, v: T) -> Self
1598        where
1599            T: std::convert::Into<crate::model::AnywhereCache>,
1600        {
1601            self.0.request.anywhere_cache = std::option::Option::Some(v.into());
1602            self
1603        }
1604
1605        /// Sets or clears the value of [anywhere_cache][crate::model::CreateAnywhereCacheRequest::anywhere_cache].
1606        ///
1607        /// This is a **required** field for requests.
1608        pub fn set_or_clear_anywhere_cache<T>(mut self, v: std::option::Option<T>) -> Self
1609        where
1610            T: std::convert::Into<crate::model::AnywhereCache>,
1611        {
1612            self.0.request.anywhere_cache = v.map(|x| x.into());
1613            self
1614        }
1615
1616        /// Sets the value of [request_id][crate::model::CreateAnywhereCacheRequest::request_id].
1617        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1618            self.0.request.request_id = v.into();
1619            self
1620        }
1621    }
1622
1623    #[doc(hidden)]
1624    impl crate::RequestBuilder for CreateAnywhereCache {
1625        fn request_options(&mut self) -> &mut crate::RequestOptions {
1626            &mut self.0.options
1627        }
1628    }
1629
1630    /// The request builder for [StorageControl::update_anywhere_cache][crate::client::StorageControl::update_anywhere_cache] calls.
1631    ///
1632    /// # Example
1633    /// ```
1634    /// # use google_cloud_storage::builder::storage_control::UpdateAnywhereCache;
1635    /// # async fn sample() -> google_cloud_storage::Result<()> {
1636    /// use google_cloud_lro::Poller;
1637    ///
1638    /// let builder = prepare_request_builder();
1639    /// let response = builder.poller().until_done().await?;
1640    /// # Ok(()) }
1641    ///
1642    /// fn prepare_request_builder() -> UpdateAnywhereCache {
1643    ///   # panic!();
1644    ///   // ... details omitted ...
1645    /// }
1646    /// ```
1647    #[derive(Clone, Debug)]
1648    pub struct UpdateAnywhereCache(RequestBuilder<crate::model::UpdateAnywhereCacheRequest>);
1649
1650    impl UpdateAnywhereCache {
1651        pub(crate) fn new(
1652            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1653        ) -> Self {
1654            Self(RequestBuilder::new(stub))
1655        }
1656
1657        /// Sets the full request, replacing any prior values.
1658        pub fn with_request<V: Into<crate::model::UpdateAnywhereCacheRequest>>(
1659            mut self,
1660            v: V,
1661        ) -> Self {
1662            self.0.request = v.into();
1663            self
1664        }
1665
1666        /// Sets all the options, replacing any prior values.
1667        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1668            self.0.options = v.into();
1669            self
1670        }
1671
1672        /// Sends the request.
1673        ///
1674        /// # Long running operations
1675        ///
1676        /// This starts, but does not poll, a longrunning operation. More information
1677        /// on [update_anywhere_cache][crate::client::StorageControl::update_anywhere_cache].
1678        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1679            let req = Self::auto_populate(self.0.request, false);
1680            (*self.0.stub)
1681                .update_anywhere_cache(req, self.0.options)
1682                .await
1683                .map(crate::Response::into_body)
1684        }
1685
1686        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_anywhere_cache`.
1687        pub fn poller(
1688            self,
1689        ) -> impl google_cloud_lro::Poller<
1690            crate::model::AnywhereCache,
1691            crate::model::UpdateAnywhereCacheMetadata,
1692        > {
1693            type Operation = google_cloud_lro::internal::Operation<
1694                crate::model::AnywhereCache,
1695                crate::model::UpdateAnywhereCacheMetadata,
1696            >;
1697            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1698            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1699            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1700            if let Some(ref mut details) = poller_options.tracing {
1701                details.method_name = "google_cloud_storage::client::StorageControl::update_anywhere_cache::until_done";
1702            }
1703
1704            let stub = self.0.stub.clone();
1705            let mut options = self.0.options.clone();
1706            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1707            let query = move |name| {
1708                let stub = stub.clone();
1709                let options = options.clone();
1710                async {
1711                    let op = GetOperation::new(stub)
1712                        .set_name(name)
1713                        .with_options(options)
1714                        .send()
1715                        .await?;
1716                    Ok(Operation::new(op))
1717                }
1718            };
1719
1720            let start = move || async {
1721                let op = self.send().await?;
1722                Ok(Operation::new(op))
1723            };
1724
1725            use google_cloud_lro::internal::PollerExt;
1726            {
1727                google_cloud_lro::internal::new_poller(
1728                    polling_error_policy,
1729                    polling_backoff_policy,
1730                    start,
1731                    query,
1732                )
1733            }
1734            .with_options(poller_options)
1735        }
1736
1737        fn auto_populate(
1738            mut req: crate::model::UpdateAnywhereCacheRequest,
1739            force: bool,
1740        ) -> crate::model::UpdateAnywhereCacheRequest {
1741            if force || req.request_id.is_empty() {
1742                req = req.set_request_id(uuid::Uuid::new_v4().to_string())
1743            }
1744            req
1745        }
1746
1747        /// Sets the value of [anywhere_cache][crate::model::UpdateAnywhereCacheRequest::anywhere_cache].
1748        ///
1749        /// This is a **required** field for requests.
1750        pub fn set_anywhere_cache<T>(mut self, v: T) -> Self
1751        where
1752            T: std::convert::Into<crate::model::AnywhereCache>,
1753        {
1754            self.0.request.anywhere_cache = std::option::Option::Some(v.into());
1755            self
1756        }
1757
1758        /// Sets or clears the value of [anywhere_cache][crate::model::UpdateAnywhereCacheRequest::anywhere_cache].
1759        ///
1760        /// This is a **required** field for requests.
1761        pub fn set_or_clear_anywhere_cache<T>(mut self, v: std::option::Option<T>) -> Self
1762        where
1763            T: std::convert::Into<crate::model::AnywhereCache>,
1764        {
1765            self.0.request.anywhere_cache = v.map(|x| x.into());
1766            self
1767        }
1768
1769        /// Sets the value of [update_mask][crate::model::UpdateAnywhereCacheRequest::update_mask].
1770        ///
1771        /// This is a **required** field for requests.
1772        pub fn set_update_mask<T>(mut self, v: T) -> Self
1773        where
1774            T: std::convert::Into<wkt::FieldMask>,
1775        {
1776            self.0.request.update_mask = std::option::Option::Some(v.into());
1777            self
1778        }
1779
1780        /// Sets or clears the value of [update_mask][crate::model::UpdateAnywhereCacheRequest::update_mask].
1781        ///
1782        /// This is a **required** field for requests.
1783        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1784        where
1785            T: std::convert::Into<wkt::FieldMask>,
1786        {
1787            self.0.request.update_mask = v.map(|x| x.into());
1788            self
1789        }
1790
1791        /// Sets the value of [request_id][crate::model::UpdateAnywhereCacheRequest::request_id].
1792        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1793            self.0.request.request_id = v.into();
1794            self
1795        }
1796    }
1797
1798    #[doc(hidden)]
1799    impl crate::RequestBuilder for UpdateAnywhereCache {
1800        fn request_options(&mut self) -> &mut crate::RequestOptions {
1801            &mut self.0.options
1802        }
1803    }
1804
1805    /// The request builder for [StorageControl::disable_anywhere_cache][crate::client::StorageControl::disable_anywhere_cache] calls.
1806    ///
1807    /// # Example
1808    /// ```
1809    /// # use google_cloud_storage::builder::storage_control::DisableAnywhereCache;
1810    /// # async fn sample() -> google_cloud_storage::Result<()> {
1811    ///
1812    /// let builder = prepare_request_builder();
1813    /// let response = builder.send().await?;
1814    /// # Ok(()) }
1815    ///
1816    /// fn prepare_request_builder() -> DisableAnywhereCache {
1817    ///   # panic!();
1818    ///   // ... details omitted ...
1819    /// }
1820    /// ```
1821    #[derive(Clone, Debug)]
1822    pub struct DisableAnywhereCache(RequestBuilder<crate::model::DisableAnywhereCacheRequest>);
1823
1824    impl DisableAnywhereCache {
1825        pub(crate) fn new(
1826            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1827        ) -> Self {
1828            Self(RequestBuilder::new(stub))
1829        }
1830
1831        /// Sets the full request, replacing any prior values.
1832        pub fn with_request<V: Into<crate::model::DisableAnywhereCacheRequest>>(
1833            mut self,
1834            v: V,
1835        ) -> Self {
1836            self.0.request = v.into();
1837            self
1838        }
1839
1840        /// Sets all the options, replacing any prior values.
1841        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1842            self.0.options = v.into();
1843            self
1844        }
1845
1846        /// Sends the request.
1847        pub async fn send(self) -> Result<crate::model::AnywhereCache> {
1848            let req = Self::auto_populate(self.0.request, false);
1849            (*self.0.stub)
1850                .disable_anywhere_cache(req, self.0.options)
1851                .await
1852                .map(crate::Response::into_body)
1853        }
1854
1855        fn auto_populate(
1856            mut req: crate::model::DisableAnywhereCacheRequest,
1857            force: bool,
1858        ) -> crate::model::DisableAnywhereCacheRequest {
1859            if force || req.request_id.is_empty() {
1860                req = req.set_request_id(uuid::Uuid::new_v4().to_string())
1861            }
1862            req
1863        }
1864
1865        /// Sets the value of [name][crate::model::DisableAnywhereCacheRequest::name].
1866        ///
1867        /// This is a **required** field for requests.
1868        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1869            self.0.request.name = v.into();
1870            self
1871        }
1872
1873        /// Sets the value of [request_id][crate::model::DisableAnywhereCacheRequest::request_id].
1874        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1875            self.0.request.request_id = v.into();
1876            self
1877        }
1878    }
1879
1880    #[doc(hidden)]
1881    impl crate::RequestBuilder for DisableAnywhereCache {
1882        fn request_options(&mut self) -> &mut crate::RequestOptions {
1883            &mut self.0.options
1884        }
1885    }
1886
1887    /// The request builder for [StorageControl::pause_anywhere_cache][crate::client::StorageControl::pause_anywhere_cache] calls.
1888    ///
1889    /// # Example
1890    /// ```
1891    /// # use google_cloud_storage::builder::storage_control::PauseAnywhereCache;
1892    /// # async fn sample() -> google_cloud_storage::Result<()> {
1893    ///
1894    /// let builder = prepare_request_builder();
1895    /// let response = builder.send().await?;
1896    /// # Ok(()) }
1897    ///
1898    /// fn prepare_request_builder() -> PauseAnywhereCache {
1899    ///   # panic!();
1900    ///   // ... details omitted ...
1901    /// }
1902    /// ```
1903    #[derive(Clone, Debug)]
1904    pub struct PauseAnywhereCache(RequestBuilder<crate::model::PauseAnywhereCacheRequest>);
1905
1906    impl PauseAnywhereCache {
1907        pub(crate) fn new(
1908            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1909        ) -> Self {
1910            Self(RequestBuilder::new(stub))
1911        }
1912
1913        /// Sets the full request, replacing any prior values.
1914        pub fn with_request<V: Into<crate::model::PauseAnywhereCacheRequest>>(
1915            mut self,
1916            v: V,
1917        ) -> Self {
1918            self.0.request = v.into();
1919            self
1920        }
1921
1922        /// Sets all the options, replacing any prior values.
1923        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1924            self.0.options = v.into();
1925            self
1926        }
1927
1928        /// Sends the request.
1929        pub async fn send(self) -> Result<crate::model::AnywhereCache> {
1930            let req = Self::auto_populate(self.0.request, false);
1931            (*self.0.stub)
1932                .pause_anywhere_cache(req, self.0.options)
1933                .await
1934                .map(crate::Response::into_body)
1935        }
1936
1937        fn auto_populate(
1938            mut req: crate::model::PauseAnywhereCacheRequest,
1939            force: bool,
1940        ) -> crate::model::PauseAnywhereCacheRequest {
1941            if force || req.request_id.is_empty() {
1942                req = req.set_request_id(uuid::Uuid::new_v4().to_string())
1943            }
1944            req
1945        }
1946
1947        /// Sets the value of [name][crate::model::PauseAnywhereCacheRequest::name].
1948        ///
1949        /// This is a **required** field for requests.
1950        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1951            self.0.request.name = v.into();
1952            self
1953        }
1954
1955        /// Sets the value of [request_id][crate::model::PauseAnywhereCacheRequest::request_id].
1956        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1957            self.0.request.request_id = v.into();
1958            self
1959        }
1960    }
1961
1962    #[doc(hidden)]
1963    impl crate::RequestBuilder for PauseAnywhereCache {
1964        fn request_options(&mut self) -> &mut crate::RequestOptions {
1965            &mut self.0.options
1966        }
1967    }
1968
1969    /// The request builder for [StorageControl::resume_anywhere_cache][crate::client::StorageControl::resume_anywhere_cache] calls.
1970    ///
1971    /// # Example
1972    /// ```
1973    /// # use google_cloud_storage::builder::storage_control::ResumeAnywhereCache;
1974    /// # async fn sample() -> google_cloud_storage::Result<()> {
1975    ///
1976    /// let builder = prepare_request_builder();
1977    /// let response = builder.send().await?;
1978    /// # Ok(()) }
1979    ///
1980    /// fn prepare_request_builder() -> ResumeAnywhereCache {
1981    ///   # panic!();
1982    ///   // ... details omitted ...
1983    /// }
1984    /// ```
1985    #[derive(Clone, Debug)]
1986    pub struct ResumeAnywhereCache(RequestBuilder<crate::model::ResumeAnywhereCacheRequest>);
1987
1988    impl ResumeAnywhereCache {
1989        pub(crate) fn new(
1990            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1991        ) -> Self {
1992            Self(RequestBuilder::new(stub))
1993        }
1994
1995        /// Sets the full request, replacing any prior values.
1996        pub fn with_request<V: Into<crate::model::ResumeAnywhereCacheRequest>>(
1997            mut self,
1998            v: V,
1999        ) -> Self {
2000            self.0.request = v.into();
2001            self
2002        }
2003
2004        /// Sets all the options, replacing any prior values.
2005        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2006            self.0.options = v.into();
2007            self
2008        }
2009
2010        /// Sends the request.
2011        pub async fn send(self) -> Result<crate::model::AnywhereCache> {
2012            let req = Self::auto_populate(self.0.request, false);
2013            (*self.0.stub)
2014                .resume_anywhere_cache(req, self.0.options)
2015                .await
2016                .map(crate::Response::into_body)
2017        }
2018
2019        fn auto_populate(
2020            mut req: crate::model::ResumeAnywhereCacheRequest,
2021            force: bool,
2022        ) -> crate::model::ResumeAnywhereCacheRequest {
2023            if force || req.request_id.is_empty() {
2024                req = req.set_request_id(uuid::Uuid::new_v4().to_string())
2025            }
2026            req
2027        }
2028
2029        /// Sets the value of [name][crate::model::ResumeAnywhereCacheRequest::name].
2030        ///
2031        /// This is a **required** field for requests.
2032        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2033            self.0.request.name = v.into();
2034            self
2035        }
2036
2037        /// Sets the value of [request_id][crate::model::ResumeAnywhereCacheRequest::request_id].
2038        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2039            self.0.request.request_id = v.into();
2040            self
2041        }
2042    }
2043
2044    #[doc(hidden)]
2045    impl crate::RequestBuilder for ResumeAnywhereCache {
2046        fn request_options(&mut self) -> &mut crate::RequestOptions {
2047            &mut self.0.options
2048        }
2049    }
2050
2051    /// The request builder for [StorageControl::get_anywhere_cache][crate::client::StorageControl::get_anywhere_cache] calls.
2052    ///
2053    /// # Example
2054    /// ```
2055    /// # use google_cloud_storage::builder::storage_control::GetAnywhereCache;
2056    /// # async fn sample() -> google_cloud_storage::Result<()> {
2057    ///
2058    /// let builder = prepare_request_builder();
2059    /// let response = builder.send().await?;
2060    /// # Ok(()) }
2061    ///
2062    /// fn prepare_request_builder() -> GetAnywhereCache {
2063    ///   # panic!();
2064    ///   // ... details omitted ...
2065    /// }
2066    /// ```
2067    #[derive(Clone, Debug)]
2068    pub struct GetAnywhereCache(RequestBuilder<crate::model::GetAnywhereCacheRequest>);
2069
2070    impl GetAnywhereCache {
2071        pub(crate) fn new(
2072            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2073        ) -> Self {
2074            Self(RequestBuilder::new(stub))
2075        }
2076
2077        /// Sets the full request, replacing any prior values.
2078        pub fn with_request<V: Into<crate::model::GetAnywhereCacheRequest>>(
2079            mut self,
2080            v: V,
2081        ) -> Self {
2082            self.0.request = v.into();
2083            self
2084        }
2085
2086        /// Sets all the options, replacing any prior values.
2087        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2088            self.0.options = v.into();
2089            self
2090        }
2091
2092        /// Sends the request.
2093        pub async fn send(self) -> Result<crate::model::AnywhereCache> {
2094            let req = Self::auto_populate(self.0.request, false);
2095            (*self.0.stub)
2096                .get_anywhere_cache(req, self.0.options)
2097                .await
2098                .map(crate::Response::into_body)
2099        }
2100
2101        fn auto_populate(
2102            mut req: crate::model::GetAnywhereCacheRequest,
2103            force: bool,
2104        ) -> crate::model::GetAnywhereCacheRequest {
2105            if force || req.request_id.is_empty() {
2106                req = req.set_request_id(uuid::Uuid::new_v4().to_string())
2107            }
2108            req
2109        }
2110
2111        /// Sets the value of [name][crate::model::GetAnywhereCacheRequest::name].
2112        ///
2113        /// This is a **required** field for requests.
2114        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2115            self.0.request.name = v.into();
2116            self
2117        }
2118
2119        /// Sets the value of [request_id][crate::model::GetAnywhereCacheRequest::request_id].
2120        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2121            self.0.request.request_id = v.into();
2122            self
2123        }
2124    }
2125
2126    #[doc(hidden)]
2127    impl crate::RequestBuilder for GetAnywhereCache {
2128        fn request_options(&mut self) -> &mut crate::RequestOptions {
2129            &mut self.0.options
2130        }
2131    }
2132
2133    /// The request builder for [StorageControl::list_anywhere_caches][crate::client::StorageControl::list_anywhere_caches] calls.
2134    ///
2135    /// # Example
2136    /// ```
2137    /// # use google_cloud_storage::builder::storage_control::ListAnywhereCaches;
2138    /// # async fn sample() -> google_cloud_storage::Result<()> {
2139    /// use google_cloud_gax::paginator::ItemPaginator;
2140    ///
2141    /// let builder = prepare_request_builder();
2142    /// let mut items = builder.by_item();
2143    /// while let Some(result) = items.next().await {
2144    ///   let item = result?;
2145    /// }
2146    /// # Ok(()) }
2147    ///
2148    /// fn prepare_request_builder() -> ListAnywhereCaches {
2149    ///   # panic!();
2150    ///   // ... details omitted ...
2151    /// }
2152    /// ```
2153    #[derive(Clone, Debug)]
2154    pub struct ListAnywhereCaches(RequestBuilder<crate::model::ListAnywhereCachesRequest>);
2155
2156    impl ListAnywhereCaches {
2157        pub(crate) fn new(
2158            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2159        ) -> Self {
2160            Self(RequestBuilder::new(stub))
2161        }
2162
2163        /// Sets the full request, replacing any prior values.
2164        pub fn with_request<V: Into<crate::model::ListAnywhereCachesRequest>>(
2165            mut self,
2166            v: V,
2167        ) -> Self {
2168            self.0.request = v.into();
2169            self
2170        }
2171
2172        /// Sets all the options, replacing any prior values.
2173        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2174            self.0.options = v.into();
2175            self
2176        }
2177
2178        /// Sends the request.
2179        pub async fn send(self) -> Result<crate::model::ListAnywhereCachesResponse> {
2180            let req = Self::auto_populate(self.0.request, false);
2181            (*self.0.stub)
2182                .list_anywhere_caches(req, self.0.options)
2183                .await
2184                .map(crate::Response::into_body)
2185        }
2186
2187        /// Streams each page in the collection.
2188        pub fn by_page(
2189            self,
2190        ) -> impl google_cloud_gax::paginator::Paginator<
2191            crate::model::ListAnywhereCachesResponse,
2192            crate::Error,
2193        > {
2194            use std::clone::Clone;
2195            let token = self.0.request.page_token.clone();
2196            let execute = move |token: String| {
2197                let mut builder = self.clone();
2198                let initial = builder.0.request.page_token == token;
2199                builder.0.request = Self::auto_populate(builder.0.request, !initial);
2200                builder.0.request = builder.0.request.set_page_token(token);
2201                builder.send()
2202            };
2203            google_cloud_gax::paginator::internal::new_paginator(token, execute)
2204        }
2205
2206        /// Streams each item in the collection.
2207        pub fn by_item(
2208            self,
2209        ) -> impl google_cloud_gax::paginator::ItemPaginator<
2210            crate::model::ListAnywhereCachesResponse,
2211            crate::Error,
2212        > {
2213            use google_cloud_gax::paginator::Paginator;
2214            self.by_page().items()
2215        }
2216
2217        fn auto_populate(
2218            mut req: crate::model::ListAnywhereCachesRequest,
2219            force: bool,
2220        ) -> crate::model::ListAnywhereCachesRequest {
2221            if force || req.request_id.is_empty() {
2222                req = req.set_request_id(uuid::Uuid::new_v4().to_string())
2223            }
2224            req
2225        }
2226
2227        /// Sets the value of [parent][crate::model::ListAnywhereCachesRequest::parent].
2228        ///
2229        /// This is a **required** field for requests.
2230        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2231            self.0.request.parent = v.into();
2232            self
2233        }
2234
2235        /// Sets the value of [page_size][crate::model::ListAnywhereCachesRequest::page_size].
2236        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2237            self.0.request.page_size = v.into();
2238            self
2239        }
2240
2241        /// Sets the value of [page_token][crate::model::ListAnywhereCachesRequest::page_token].
2242        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2243            self.0.request.page_token = v.into();
2244            self
2245        }
2246
2247        /// Sets the value of [request_id][crate::model::ListAnywhereCachesRequest::request_id].
2248        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2249            self.0.request.request_id = v.into();
2250            self
2251        }
2252    }
2253
2254    #[doc(hidden)]
2255    impl crate::RequestBuilder for ListAnywhereCaches {
2256        fn request_options(&mut self) -> &mut crate::RequestOptions {
2257            &mut self.0.options
2258        }
2259    }
2260
2261    /// The request builder for [StorageControl::get_project_intelligence_config][crate::client::StorageControl::get_project_intelligence_config] calls.
2262    ///
2263    /// # Example
2264    /// ```
2265    /// # use google_cloud_storage::builder::storage_control::GetProjectIntelligenceConfig;
2266    /// # async fn sample() -> google_cloud_storage::Result<()> {
2267    ///
2268    /// let builder = prepare_request_builder();
2269    /// let response = builder.send().await?;
2270    /// # Ok(()) }
2271    ///
2272    /// fn prepare_request_builder() -> GetProjectIntelligenceConfig {
2273    ///   # panic!();
2274    ///   // ... details omitted ...
2275    /// }
2276    /// ```
2277    #[derive(Clone, Debug)]
2278    pub struct GetProjectIntelligenceConfig(
2279        RequestBuilder<crate::model::GetProjectIntelligenceConfigRequest>,
2280    );
2281
2282    impl GetProjectIntelligenceConfig {
2283        pub(crate) fn new(
2284            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2285        ) -> Self {
2286            Self(RequestBuilder::new(stub))
2287        }
2288
2289        /// Sets the full request, replacing any prior values.
2290        pub fn with_request<V: Into<crate::model::GetProjectIntelligenceConfigRequest>>(
2291            mut self,
2292            v: V,
2293        ) -> Self {
2294            self.0.request = v.into();
2295            self
2296        }
2297
2298        /// Sets all the options, replacing any prior values.
2299        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2300            self.0.options = v.into();
2301            self
2302        }
2303
2304        /// Sends the request.
2305        pub async fn send(self) -> Result<crate::model::IntelligenceConfig> {
2306            (*self.0.stub)
2307                .get_project_intelligence_config(self.0.request, self.0.options)
2308                .await
2309                .map(crate::Response::into_body)
2310        }
2311
2312        /// Sets the value of [name][crate::model::GetProjectIntelligenceConfigRequest::name].
2313        ///
2314        /// This is a **required** field for requests.
2315        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2316            self.0.request.name = v.into();
2317            self
2318        }
2319    }
2320
2321    #[doc(hidden)]
2322    impl crate::RequestBuilder for GetProjectIntelligenceConfig {
2323        fn request_options(&mut self) -> &mut crate::RequestOptions {
2324            &mut self.0.options
2325        }
2326    }
2327
2328    /// The request builder for [StorageControl::update_project_intelligence_config][crate::client::StorageControl::update_project_intelligence_config] calls.
2329    ///
2330    /// # Example
2331    /// ```
2332    /// # use google_cloud_storage::builder::storage_control::UpdateProjectIntelligenceConfig;
2333    /// # async fn sample() -> google_cloud_storage::Result<()> {
2334    ///
2335    /// let builder = prepare_request_builder();
2336    /// let response = builder.send().await?;
2337    /// # Ok(()) }
2338    ///
2339    /// fn prepare_request_builder() -> UpdateProjectIntelligenceConfig {
2340    ///   # panic!();
2341    ///   // ... details omitted ...
2342    /// }
2343    /// ```
2344    #[derive(Clone, Debug)]
2345    pub struct UpdateProjectIntelligenceConfig(
2346        RequestBuilder<crate::model::UpdateProjectIntelligenceConfigRequest>,
2347    );
2348
2349    impl UpdateProjectIntelligenceConfig {
2350        pub(crate) fn new(
2351            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2352        ) -> Self {
2353            Self(RequestBuilder::new(stub))
2354        }
2355
2356        /// Sets the full request, replacing any prior values.
2357        pub fn with_request<V: Into<crate::model::UpdateProjectIntelligenceConfigRequest>>(
2358            mut self,
2359            v: V,
2360        ) -> Self {
2361            self.0.request = v.into();
2362            self
2363        }
2364
2365        /// Sets all the options, replacing any prior values.
2366        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2367            self.0.options = v.into();
2368            self
2369        }
2370
2371        /// Sends the request.
2372        pub async fn send(self) -> Result<crate::model::IntelligenceConfig> {
2373            (*self.0.stub)
2374                .update_project_intelligence_config(self.0.request, self.0.options)
2375                .await
2376                .map(crate::Response::into_body)
2377        }
2378
2379        /// Sets the value of [intelligence_config][crate::model::UpdateProjectIntelligenceConfigRequest::intelligence_config].
2380        ///
2381        /// This is a **required** field for requests.
2382        pub fn set_intelligence_config<T>(mut self, v: T) -> Self
2383        where
2384            T: std::convert::Into<crate::model::IntelligenceConfig>,
2385        {
2386            self.0.request.intelligence_config = std::option::Option::Some(v.into());
2387            self
2388        }
2389
2390        /// Sets or clears the value of [intelligence_config][crate::model::UpdateProjectIntelligenceConfigRequest::intelligence_config].
2391        ///
2392        /// This is a **required** field for requests.
2393        pub fn set_or_clear_intelligence_config<T>(mut self, v: std::option::Option<T>) -> Self
2394        where
2395            T: std::convert::Into<crate::model::IntelligenceConfig>,
2396        {
2397            self.0.request.intelligence_config = v.map(|x| x.into());
2398            self
2399        }
2400
2401        /// Sets the value of [update_mask][crate::model::UpdateProjectIntelligenceConfigRequest::update_mask].
2402        ///
2403        /// This is a **required** field for requests.
2404        pub fn set_update_mask<T>(mut self, v: T) -> Self
2405        where
2406            T: std::convert::Into<wkt::FieldMask>,
2407        {
2408            self.0.request.update_mask = std::option::Option::Some(v.into());
2409            self
2410        }
2411
2412        /// Sets or clears the value of [update_mask][crate::model::UpdateProjectIntelligenceConfigRequest::update_mask].
2413        ///
2414        /// This is a **required** field for requests.
2415        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2416        where
2417            T: std::convert::Into<wkt::FieldMask>,
2418        {
2419            self.0.request.update_mask = v.map(|x| x.into());
2420            self
2421        }
2422
2423        /// Sets the value of [request_id][crate::model::UpdateProjectIntelligenceConfigRequest::request_id].
2424        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2425            self.0.request.request_id = v.into();
2426            self
2427        }
2428    }
2429
2430    #[doc(hidden)]
2431    impl crate::RequestBuilder for UpdateProjectIntelligenceConfig {
2432        fn request_options(&mut self) -> &mut crate::RequestOptions {
2433            &mut self.0.options
2434        }
2435    }
2436
2437    /// The request builder for [StorageControl::get_folder_intelligence_config][crate::client::StorageControl::get_folder_intelligence_config] calls.
2438    ///
2439    /// # Example
2440    /// ```
2441    /// # use google_cloud_storage::builder::storage_control::GetFolderIntelligenceConfig;
2442    /// # async fn sample() -> google_cloud_storage::Result<()> {
2443    ///
2444    /// let builder = prepare_request_builder();
2445    /// let response = builder.send().await?;
2446    /// # Ok(()) }
2447    ///
2448    /// fn prepare_request_builder() -> GetFolderIntelligenceConfig {
2449    ///   # panic!();
2450    ///   // ... details omitted ...
2451    /// }
2452    /// ```
2453    #[derive(Clone, Debug)]
2454    pub struct GetFolderIntelligenceConfig(
2455        RequestBuilder<crate::model::GetFolderIntelligenceConfigRequest>,
2456    );
2457
2458    impl GetFolderIntelligenceConfig {
2459        pub(crate) fn new(
2460            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2461        ) -> Self {
2462            Self(RequestBuilder::new(stub))
2463        }
2464
2465        /// Sets the full request, replacing any prior values.
2466        pub fn with_request<V: Into<crate::model::GetFolderIntelligenceConfigRequest>>(
2467            mut self,
2468            v: V,
2469        ) -> Self {
2470            self.0.request = v.into();
2471            self
2472        }
2473
2474        /// Sets all the options, replacing any prior values.
2475        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2476            self.0.options = v.into();
2477            self
2478        }
2479
2480        /// Sends the request.
2481        pub async fn send(self) -> Result<crate::model::IntelligenceConfig> {
2482            (*self.0.stub)
2483                .get_folder_intelligence_config(self.0.request, self.0.options)
2484                .await
2485                .map(crate::Response::into_body)
2486        }
2487
2488        /// Sets the value of [name][crate::model::GetFolderIntelligenceConfigRequest::name].
2489        ///
2490        /// This is a **required** field for requests.
2491        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2492            self.0.request.name = v.into();
2493            self
2494        }
2495    }
2496
2497    #[doc(hidden)]
2498    impl crate::RequestBuilder for GetFolderIntelligenceConfig {
2499        fn request_options(&mut self) -> &mut crate::RequestOptions {
2500            &mut self.0.options
2501        }
2502    }
2503
2504    /// The request builder for [StorageControl::update_folder_intelligence_config][crate::client::StorageControl::update_folder_intelligence_config] calls.
2505    ///
2506    /// # Example
2507    /// ```
2508    /// # use google_cloud_storage::builder::storage_control::UpdateFolderIntelligenceConfig;
2509    /// # async fn sample() -> google_cloud_storage::Result<()> {
2510    ///
2511    /// let builder = prepare_request_builder();
2512    /// let response = builder.send().await?;
2513    /// # Ok(()) }
2514    ///
2515    /// fn prepare_request_builder() -> UpdateFolderIntelligenceConfig {
2516    ///   # panic!();
2517    ///   // ... details omitted ...
2518    /// }
2519    /// ```
2520    #[derive(Clone, Debug)]
2521    pub struct UpdateFolderIntelligenceConfig(
2522        RequestBuilder<crate::model::UpdateFolderIntelligenceConfigRequest>,
2523    );
2524
2525    impl UpdateFolderIntelligenceConfig {
2526        pub(crate) fn new(
2527            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2528        ) -> Self {
2529            Self(RequestBuilder::new(stub))
2530        }
2531
2532        /// Sets the full request, replacing any prior values.
2533        pub fn with_request<V: Into<crate::model::UpdateFolderIntelligenceConfigRequest>>(
2534            mut self,
2535            v: V,
2536        ) -> Self {
2537            self.0.request = v.into();
2538            self
2539        }
2540
2541        /// Sets all the options, replacing any prior values.
2542        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2543            self.0.options = v.into();
2544            self
2545        }
2546
2547        /// Sends the request.
2548        pub async fn send(self) -> Result<crate::model::IntelligenceConfig> {
2549            (*self.0.stub)
2550                .update_folder_intelligence_config(self.0.request, self.0.options)
2551                .await
2552                .map(crate::Response::into_body)
2553        }
2554
2555        /// Sets the value of [intelligence_config][crate::model::UpdateFolderIntelligenceConfigRequest::intelligence_config].
2556        ///
2557        /// This is a **required** field for requests.
2558        pub fn set_intelligence_config<T>(mut self, v: T) -> Self
2559        where
2560            T: std::convert::Into<crate::model::IntelligenceConfig>,
2561        {
2562            self.0.request.intelligence_config = std::option::Option::Some(v.into());
2563            self
2564        }
2565
2566        /// Sets or clears the value of [intelligence_config][crate::model::UpdateFolderIntelligenceConfigRequest::intelligence_config].
2567        ///
2568        /// This is a **required** field for requests.
2569        pub fn set_or_clear_intelligence_config<T>(mut self, v: std::option::Option<T>) -> Self
2570        where
2571            T: std::convert::Into<crate::model::IntelligenceConfig>,
2572        {
2573            self.0.request.intelligence_config = v.map(|x| x.into());
2574            self
2575        }
2576
2577        /// Sets the value of [update_mask][crate::model::UpdateFolderIntelligenceConfigRequest::update_mask].
2578        ///
2579        /// This is a **required** field for requests.
2580        pub fn set_update_mask<T>(mut self, v: T) -> Self
2581        where
2582            T: std::convert::Into<wkt::FieldMask>,
2583        {
2584            self.0.request.update_mask = std::option::Option::Some(v.into());
2585            self
2586        }
2587
2588        /// Sets or clears the value of [update_mask][crate::model::UpdateFolderIntelligenceConfigRequest::update_mask].
2589        ///
2590        /// This is a **required** field for requests.
2591        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2592        where
2593            T: std::convert::Into<wkt::FieldMask>,
2594        {
2595            self.0.request.update_mask = v.map(|x| x.into());
2596            self
2597        }
2598
2599        /// Sets the value of [request_id][crate::model::UpdateFolderIntelligenceConfigRequest::request_id].
2600        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2601            self.0.request.request_id = v.into();
2602            self
2603        }
2604    }
2605
2606    #[doc(hidden)]
2607    impl crate::RequestBuilder for UpdateFolderIntelligenceConfig {
2608        fn request_options(&mut self) -> &mut crate::RequestOptions {
2609            &mut self.0.options
2610        }
2611    }
2612
2613    /// The request builder for [StorageControl::get_organization_intelligence_config][crate::client::StorageControl::get_organization_intelligence_config] calls.
2614    ///
2615    /// # Example
2616    /// ```
2617    /// # use google_cloud_storage::builder::storage_control::GetOrganizationIntelligenceConfig;
2618    /// # async fn sample() -> google_cloud_storage::Result<()> {
2619    ///
2620    /// let builder = prepare_request_builder();
2621    /// let response = builder.send().await?;
2622    /// # Ok(()) }
2623    ///
2624    /// fn prepare_request_builder() -> GetOrganizationIntelligenceConfig {
2625    ///   # panic!();
2626    ///   // ... details omitted ...
2627    /// }
2628    /// ```
2629    #[derive(Clone, Debug)]
2630    pub struct GetOrganizationIntelligenceConfig(
2631        RequestBuilder<crate::model::GetOrganizationIntelligenceConfigRequest>,
2632    );
2633
2634    impl GetOrganizationIntelligenceConfig {
2635        pub(crate) fn new(
2636            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2637        ) -> Self {
2638            Self(RequestBuilder::new(stub))
2639        }
2640
2641        /// Sets the full request, replacing any prior values.
2642        pub fn with_request<V: Into<crate::model::GetOrganizationIntelligenceConfigRequest>>(
2643            mut self,
2644            v: V,
2645        ) -> Self {
2646            self.0.request = v.into();
2647            self
2648        }
2649
2650        /// Sets all the options, replacing any prior values.
2651        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2652            self.0.options = v.into();
2653            self
2654        }
2655
2656        /// Sends the request.
2657        pub async fn send(self) -> Result<crate::model::IntelligenceConfig> {
2658            (*self.0.stub)
2659                .get_organization_intelligence_config(self.0.request, self.0.options)
2660                .await
2661                .map(crate::Response::into_body)
2662        }
2663
2664        /// Sets the value of [name][crate::model::GetOrganizationIntelligenceConfigRequest::name].
2665        ///
2666        /// This is a **required** field for requests.
2667        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2668            self.0.request.name = v.into();
2669            self
2670        }
2671    }
2672
2673    #[doc(hidden)]
2674    impl crate::RequestBuilder for GetOrganizationIntelligenceConfig {
2675        fn request_options(&mut self) -> &mut crate::RequestOptions {
2676            &mut self.0.options
2677        }
2678    }
2679
2680    /// The request builder for [StorageControl::update_organization_intelligence_config][crate::client::StorageControl::update_organization_intelligence_config] calls.
2681    ///
2682    /// # Example
2683    /// ```
2684    /// # use google_cloud_storage::builder::storage_control::UpdateOrganizationIntelligenceConfig;
2685    /// # async fn sample() -> google_cloud_storage::Result<()> {
2686    ///
2687    /// let builder = prepare_request_builder();
2688    /// let response = builder.send().await?;
2689    /// # Ok(()) }
2690    ///
2691    /// fn prepare_request_builder() -> UpdateOrganizationIntelligenceConfig {
2692    ///   # panic!();
2693    ///   // ... details omitted ...
2694    /// }
2695    /// ```
2696    #[derive(Clone, Debug)]
2697    pub struct UpdateOrganizationIntelligenceConfig(
2698        RequestBuilder<crate::model::UpdateOrganizationIntelligenceConfigRequest>,
2699    );
2700
2701    impl UpdateOrganizationIntelligenceConfig {
2702        pub(crate) fn new(
2703            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2704        ) -> Self {
2705            Self(RequestBuilder::new(stub))
2706        }
2707
2708        /// Sets the full request, replacing any prior values.
2709        pub fn with_request<V: Into<crate::model::UpdateOrganizationIntelligenceConfigRequest>>(
2710            mut self,
2711            v: V,
2712        ) -> Self {
2713            self.0.request = v.into();
2714            self
2715        }
2716
2717        /// Sets all the options, replacing any prior values.
2718        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2719            self.0.options = v.into();
2720            self
2721        }
2722
2723        /// Sends the request.
2724        pub async fn send(self) -> Result<crate::model::IntelligenceConfig> {
2725            (*self.0.stub)
2726                .update_organization_intelligence_config(self.0.request, self.0.options)
2727                .await
2728                .map(crate::Response::into_body)
2729        }
2730
2731        /// Sets the value of [intelligence_config][crate::model::UpdateOrganizationIntelligenceConfigRequest::intelligence_config].
2732        ///
2733        /// This is a **required** field for requests.
2734        pub fn set_intelligence_config<T>(mut self, v: T) -> Self
2735        where
2736            T: std::convert::Into<crate::model::IntelligenceConfig>,
2737        {
2738            self.0.request.intelligence_config = std::option::Option::Some(v.into());
2739            self
2740        }
2741
2742        /// Sets or clears the value of [intelligence_config][crate::model::UpdateOrganizationIntelligenceConfigRequest::intelligence_config].
2743        ///
2744        /// This is a **required** field for requests.
2745        pub fn set_or_clear_intelligence_config<T>(mut self, v: std::option::Option<T>) -> Self
2746        where
2747            T: std::convert::Into<crate::model::IntelligenceConfig>,
2748        {
2749            self.0.request.intelligence_config = v.map(|x| x.into());
2750            self
2751        }
2752
2753        /// Sets the value of [update_mask][crate::model::UpdateOrganizationIntelligenceConfigRequest::update_mask].
2754        ///
2755        /// This is a **required** field for requests.
2756        pub fn set_update_mask<T>(mut self, v: T) -> Self
2757        where
2758            T: std::convert::Into<wkt::FieldMask>,
2759        {
2760            self.0.request.update_mask = std::option::Option::Some(v.into());
2761            self
2762        }
2763
2764        /// Sets or clears the value of [update_mask][crate::model::UpdateOrganizationIntelligenceConfigRequest::update_mask].
2765        ///
2766        /// This is a **required** field for requests.
2767        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2768        where
2769            T: std::convert::Into<wkt::FieldMask>,
2770        {
2771            self.0.request.update_mask = v.map(|x| x.into());
2772            self
2773        }
2774
2775        /// Sets the value of [request_id][crate::model::UpdateOrganizationIntelligenceConfigRequest::request_id].
2776        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2777            self.0.request.request_id = v.into();
2778            self
2779        }
2780    }
2781
2782    #[doc(hidden)]
2783    impl crate::RequestBuilder for UpdateOrganizationIntelligenceConfig {
2784        fn request_options(&mut self) -> &mut crate::RequestOptions {
2785            &mut self.0.options
2786        }
2787    }
2788
2789    /// The request builder for [StorageControl::get_iam_policy][crate::client::StorageControl::get_iam_policy] calls.
2790    ///
2791    /// # Example
2792    /// ```
2793    /// # use google_cloud_storage::builder::storage_control::GetIamPolicy;
2794    /// # async fn sample() -> google_cloud_storage::Result<()> {
2795    ///
2796    /// let builder = prepare_request_builder();
2797    /// let response = builder.send().await?;
2798    /// # Ok(()) }
2799    ///
2800    /// fn prepare_request_builder() -> GetIamPolicy {
2801    ///   # panic!();
2802    ///   // ... details omitted ...
2803    /// }
2804    /// ```
2805    #[derive(Clone, Debug)]
2806    pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
2807
2808    impl GetIamPolicy {
2809        pub(crate) fn new(
2810            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2811        ) -> Self {
2812            Self(RequestBuilder::new(stub))
2813        }
2814
2815        /// Sets the full request, replacing any prior values.
2816        pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
2817            mut self,
2818            v: V,
2819        ) -> Self {
2820            self.0.request = v.into();
2821            self
2822        }
2823
2824        /// Sets all the options, replacing any prior values.
2825        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2826            self.0.options = v.into();
2827            self
2828        }
2829
2830        /// Sends the request.
2831        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
2832            (*self.0.stub)
2833                .get_iam_policy(self.0.request, self.0.options)
2834                .await
2835                .map(crate::Response::into_body)
2836        }
2837
2838        /// Sets the value of [resource][google_cloud_iam_v1::model::GetIamPolicyRequest::resource].
2839        ///
2840        /// This is a **required** field for requests.
2841        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2842            self.0.request.resource = v.into();
2843            self
2844        }
2845
2846        /// Sets the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
2847        pub fn set_options<T>(mut self, v: T) -> Self
2848        where
2849            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
2850        {
2851            self.0.request.options = std::option::Option::Some(v.into());
2852            self
2853        }
2854
2855        /// Sets or clears the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
2856        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
2857        where
2858            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
2859        {
2860            self.0.request.options = v.map(|x| x.into());
2861            self
2862        }
2863    }
2864
2865    #[doc(hidden)]
2866    impl crate::RequestBuilder for GetIamPolicy {
2867        fn request_options(&mut self) -> &mut crate::RequestOptions {
2868            &mut self.0.options
2869        }
2870    }
2871
2872    /// The request builder for [StorageControl::set_iam_policy][crate::client::StorageControl::set_iam_policy] calls.
2873    ///
2874    /// # Example
2875    /// ```
2876    /// # use google_cloud_storage::builder::storage_control::SetIamPolicy;
2877    /// # async fn sample() -> google_cloud_storage::Result<()> {
2878    ///
2879    /// let builder = prepare_request_builder();
2880    /// let response = builder.send().await?;
2881    /// # Ok(()) }
2882    ///
2883    /// fn prepare_request_builder() -> SetIamPolicy {
2884    ///   # panic!();
2885    ///   // ... details omitted ...
2886    /// }
2887    /// ```
2888    #[derive(Clone, Debug)]
2889    pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
2890
2891    impl SetIamPolicy {
2892        pub(crate) fn new(
2893            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2894        ) -> Self {
2895            Self(RequestBuilder::new(stub))
2896        }
2897
2898        /// Sets the full request, replacing any prior values.
2899        pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
2900            mut self,
2901            v: V,
2902        ) -> Self {
2903            self.0.request = v.into();
2904            self
2905        }
2906
2907        /// Sets all the options, replacing any prior values.
2908        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2909            self.0.options = v.into();
2910            self
2911        }
2912
2913        /// Sends the request.
2914        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
2915            (*self.0.stub)
2916                .set_iam_policy(self.0.request, self.0.options)
2917                .await
2918                .map(crate::Response::into_body)
2919        }
2920
2921        /// Sets the value of [resource][google_cloud_iam_v1::model::SetIamPolicyRequest::resource].
2922        ///
2923        /// This is a **required** field for requests.
2924        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2925            self.0.request.resource = v.into();
2926            self
2927        }
2928
2929        /// Sets the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
2930        ///
2931        /// This is a **required** field for requests.
2932        pub fn set_policy<T>(mut self, v: T) -> Self
2933        where
2934            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
2935        {
2936            self.0.request.policy = std::option::Option::Some(v.into());
2937            self
2938        }
2939
2940        /// Sets or clears the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
2941        ///
2942        /// This is a **required** field for requests.
2943        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
2944        where
2945            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
2946        {
2947            self.0.request.policy = v.map(|x| x.into());
2948            self
2949        }
2950
2951        /// Sets the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
2952        pub fn set_update_mask<T>(mut self, v: T) -> Self
2953        where
2954            T: std::convert::Into<wkt::FieldMask>,
2955        {
2956            self.0.request.update_mask = std::option::Option::Some(v.into());
2957            self
2958        }
2959
2960        /// Sets or clears the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
2961        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2962        where
2963            T: std::convert::Into<wkt::FieldMask>,
2964        {
2965            self.0.request.update_mask = v.map(|x| x.into());
2966            self
2967        }
2968    }
2969
2970    #[doc(hidden)]
2971    impl crate::RequestBuilder for SetIamPolicy {
2972        fn request_options(&mut self) -> &mut crate::RequestOptions {
2973            &mut self.0.options
2974        }
2975    }
2976
2977    /// The request builder for [StorageControl::test_iam_permissions][crate::client::StorageControl::test_iam_permissions] calls.
2978    ///
2979    /// # Example
2980    /// ```
2981    /// # use google_cloud_storage::builder::storage_control::TestIamPermissions;
2982    /// # async fn sample() -> google_cloud_storage::Result<()> {
2983    ///
2984    /// let builder = prepare_request_builder();
2985    /// let response = builder.send().await?;
2986    /// # Ok(()) }
2987    ///
2988    /// fn prepare_request_builder() -> TestIamPermissions {
2989    ///   # panic!();
2990    ///   // ... details omitted ...
2991    /// }
2992    /// ```
2993    #[derive(Clone, Debug)]
2994    pub struct TestIamPermissions(
2995        RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
2996    );
2997
2998    impl TestIamPermissions {
2999        pub(crate) fn new(
3000            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
3001        ) -> Self {
3002            Self(RequestBuilder::new(stub))
3003        }
3004
3005        /// Sets the full request, replacing any prior values.
3006        pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
3007            mut self,
3008            v: V,
3009        ) -> Self {
3010            self.0.request = v.into();
3011            self
3012        }
3013
3014        /// Sets all the options, replacing any prior values.
3015        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3016            self.0.options = v.into();
3017            self
3018        }
3019
3020        /// Sends the request.
3021        pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
3022            (*self.0.stub)
3023                .test_iam_permissions(self.0.request, self.0.options)
3024                .await
3025                .map(crate::Response::into_body)
3026        }
3027
3028        /// Sets the value of [resource][google_cloud_iam_v1::model::TestIamPermissionsRequest::resource].
3029        ///
3030        /// This is a **required** field for requests.
3031        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
3032            self.0.request.resource = v.into();
3033            self
3034        }
3035
3036        /// Sets the value of [permissions][google_cloud_iam_v1::model::TestIamPermissionsRequest::permissions].
3037        ///
3038        /// This is a **required** field for requests.
3039        pub fn set_permissions<T, V>(mut self, v: T) -> Self
3040        where
3041            T: std::iter::IntoIterator<Item = V>,
3042            V: std::convert::Into<std::string::String>,
3043        {
3044            use std::iter::Iterator;
3045            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
3046            self
3047        }
3048    }
3049
3050    #[doc(hidden)]
3051    impl crate::RequestBuilder for TestIamPermissions {
3052        fn request_options(&mut self) -> &mut crate::RequestOptions {
3053            &mut self.0.options
3054        }
3055    }
3056
3057    /// The request builder for [StorageControl::get_intelligence_finding][crate::client::StorageControl::get_intelligence_finding] calls.
3058    ///
3059    /// # Example
3060    /// ```
3061    /// # use google_cloud_storage::builder::storage_control::GetIntelligenceFinding;
3062    /// # async fn sample() -> google_cloud_storage::Result<()> {
3063    ///
3064    /// let builder = prepare_request_builder();
3065    /// let response = builder.send().await?;
3066    /// # Ok(()) }
3067    ///
3068    /// fn prepare_request_builder() -> GetIntelligenceFinding {
3069    ///   # panic!();
3070    ///   // ... details omitted ...
3071    /// }
3072    /// ```
3073    #[derive(Clone, Debug)]
3074    pub struct GetIntelligenceFinding(RequestBuilder<crate::model::GetIntelligenceFindingRequest>);
3075
3076    impl GetIntelligenceFinding {
3077        pub(crate) fn new(
3078            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
3079        ) -> Self {
3080            Self(RequestBuilder::new(stub))
3081        }
3082
3083        /// Sets the full request, replacing any prior values.
3084        pub fn with_request<V: Into<crate::model::GetIntelligenceFindingRequest>>(
3085            mut self,
3086            v: V,
3087        ) -> Self {
3088            self.0.request = v.into();
3089            self
3090        }
3091
3092        /// Sets all the options, replacing any prior values.
3093        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3094            self.0.options = v.into();
3095            self
3096        }
3097
3098        /// Sends the request.
3099        pub async fn send(self) -> Result<crate::model::IntelligenceFinding> {
3100            (*self.0.stub)
3101                .get_intelligence_finding(self.0.request, self.0.options)
3102                .await
3103                .map(crate::Response::into_body)
3104        }
3105
3106        /// Sets the value of [name][crate::model::GetIntelligenceFindingRequest::name].
3107        ///
3108        /// This is a **required** field for requests.
3109        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3110            self.0.request.name = v.into();
3111            self
3112        }
3113    }
3114
3115    #[doc(hidden)]
3116    impl crate::RequestBuilder for GetIntelligenceFinding {
3117        fn request_options(&mut self) -> &mut crate::RequestOptions {
3118            &mut self.0.options
3119        }
3120    }
3121
3122    /// The request builder for [StorageControl::list_intelligence_findings][crate::client::StorageControl::list_intelligence_findings] calls.
3123    ///
3124    /// # Example
3125    /// ```
3126    /// # use google_cloud_storage::builder::storage_control::ListIntelligenceFindings;
3127    /// # async fn sample() -> google_cloud_storage::Result<()> {
3128    /// use google_cloud_gax::paginator::ItemPaginator;
3129    ///
3130    /// let builder = prepare_request_builder();
3131    /// let mut items = builder.by_item();
3132    /// while let Some(result) = items.next().await {
3133    ///   let item = result?;
3134    /// }
3135    /// # Ok(()) }
3136    ///
3137    /// fn prepare_request_builder() -> ListIntelligenceFindings {
3138    ///   # panic!();
3139    ///   // ... details omitted ...
3140    /// }
3141    /// ```
3142    #[derive(Clone, Debug)]
3143    pub struct ListIntelligenceFindings(
3144        RequestBuilder<crate::model::ListIntelligenceFindingsRequest>,
3145    );
3146
3147    impl ListIntelligenceFindings {
3148        pub(crate) fn new(
3149            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
3150        ) -> Self {
3151            Self(RequestBuilder::new(stub))
3152        }
3153
3154        /// Sets the full request, replacing any prior values.
3155        pub fn with_request<V: Into<crate::model::ListIntelligenceFindingsRequest>>(
3156            mut self,
3157            v: V,
3158        ) -> Self {
3159            self.0.request = v.into();
3160            self
3161        }
3162
3163        /// Sets all the options, replacing any prior values.
3164        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3165            self.0.options = v.into();
3166            self
3167        }
3168
3169        /// Sends the request.
3170        pub async fn send(self) -> Result<crate::model::ListIntelligenceFindingsResponse> {
3171            (*self.0.stub)
3172                .list_intelligence_findings(self.0.request, self.0.options)
3173                .await
3174                .map(crate::Response::into_body)
3175        }
3176
3177        /// Streams each page in the collection.
3178        pub fn by_page(
3179            self,
3180        ) -> impl google_cloud_gax::paginator::Paginator<
3181            crate::model::ListIntelligenceFindingsResponse,
3182            crate::Error,
3183        > {
3184            use std::clone::Clone;
3185            let token = self.0.request.page_token.clone();
3186            let execute = move |token: String| {
3187                let mut builder = self.clone();
3188                builder.0.request = builder.0.request.set_page_token(token);
3189                builder.send()
3190            };
3191            google_cloud_gax::paginator::internal::new_paginator(token, execute)
3192        }
3193
3194        /// Streams each item in the collection.
3195        pub fn by_item(
3196            self,
3197        ) -> impl google_cloud_gax::paginator::ItemPaginator<
3198            crate::model::ListIntelligenceFindingsResponse,
3199            crate::Error,
3200        > {
3201            use google_cloud_gax::paginator::Paginator;
3202            self.by_page().items()
3203        }
3204
3205        /// Sets the value of [parent][crate::model::ListIntelligenceFindingsRequest::parent].
3206        ///
3207        /// This is a **required** field for requests.
3208        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3209            self.0.request.parent = v.into();
3210            self
3211        }
3212
3213        /// Sets the value of [filter][crate::model::ListIntelligenceFindingsRequest::filter].
3214        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3215            self.0.request.filter = v.into();
3216            self
3217        }
3218
3219        /// Sets the value of [page_size][crate::model::ListIntelligenceFindingsRequest::page_size].
3220        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3221            self.0.request.page_size = v.into();
3222            self
3223        }
3224
3225        /// Sets the value of [page_token][crate::model::ListIntelligenceFindingsRequest::page_token].
3226        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3227            self.0.request.page_token = v.into();
3228            self
3229        }
3230    }
3231
3232    #[doc(hidden)]
3233    impl crate::RequestBuilder for ListIntelligenceFindings {
3234        fn request_options(&mut self) -> &mut crate::RequestOptions {
3235            &mut self.0.options
3236        }
3237    }
3238
3239    /// The request builder for [StorageControl::summarize_intelligence_findings][crate::client::StorageControl::summarize_intelligence_findings] calls.
3240    ///
3241    /// # Example
3242    /// ```
3243    /// # use google_cloud_storage::builder::storage_control::SummarizeIntelligenceFindings;
3244    /// # async fn sample() -> google_cloud_storage::Result<()> {
3245    /// use google_cloud_gax::paginator::ItemPaginator;
3246    ///
3247    /// let builder = prepare_request_builder();
3248    /// let mut items = builder.by_item();
3249    /// while let Some(result) = items.next().await {
3250    ///   let item = result?;
3251    /// }
3252    /// # Ok(()) }
3253    ///
3254    /// fn prepare_request_builder() -> SummarizeIntelligenceFindings {
3255    ///   # panic!();
3256    ///   // ... details omitted ...
3257    /// }
3258    /// ```
3259    #[derive(Clone, Debug)]
3260    pub struct SummarizeIntelligenceFindings(
3261        RequestBuilder<crate::model::SummarizeIntelligenceFindingsRequest>,
3262    );
3263
3264    impl SummarizeIntelligenceFindings {
3265        pub(crate) fn new(
3266            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
3267        ) -> Self {
3268            Self(RequestBuilder::new(stub))
3269        }
3270
3271        /// Sets the full request, replacing any prior values.
3272        pub fn with_request<V: Into<crate::model::SummarizeIntelligenceFindingsRequest>>(
3273            mut self,
3274            v: V,
3275        ) -> Self {
3276            self.0.request = v.into();
3277            self
3278        }
3279
3280        /// Sets all the options, replacing any prior values.
3281        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3282            self.0.options = v.into();
3283            self
3284        }
3285
3286        /// Sends the request.
3287        pub async fn send(self) -> Result<crate::model::SummarizeIntelligenceFindingsResponse> {
3288            (*self.0.stub)
3289                .summarize_intelligence_findings(self.0.request, self.0.options)
3290                .await
3291                .map(crate::Response::into_body)
3292        }
3293
3294        /// Streams each page in the collection.
3295        pub fn by_page(
3296            self,
3297        ) -> impl google_cloud_gax::paginator::Paginator<
3298            crate::model::SummarizeIntelligenceFindingsResponse,
3299            crate::Error,
3300        > {
3301            use std::clone::Clone;
3302            let token = self.0.request.page_token.clone();
3303            let execute = move |token: String| {
3304                let mut builder = self.clone();
3305                builder.0.request = builder.0.request.set_page_token(token);
3306                builder.send()
3307            };
3308            google_cloud_gax::paginator::internal::new_paginator(token, execute)
3309        }
3310
3311        /// Streams each item in the collection.
3312        pub fn by_item(
3313            self,
3314        ) -> impl google_cloud_gax::paginator::ItemPaginator<
3315            crate::model::SummarizeIntelligenceFindingsResponse,
3316            crate::Error,
3317        > {
3318            use google_cloud_gax::paginator::Paginator;
3319            self.by_page().items()
3320        }
3321
3322        /// Sets the value of [parent][crate::model::SummarizeIntelligenceFindingsRequest::parent].
3323        ///
3324        /// This is a **required** field for requests.
3325        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3326            self.0.request.parent = v.into();
3327            self
3328        }
3329
3330        /// Sets the value of [resource_scope][crate::model::SummarizeIntelligenceFindingsRequest::resource_scope].
3331        pub fn set_resource_scope<
3332            T: Into<crate::model::summarize_intelligence_findings_request::ResourceScope>,
3333        >(
3334            mut self,
3335            v: T,
3336        ) -> Self {
3337            self.0.request.resource_scope = v.into();
3338            self
3339        }
3340
3341        /// Sets the value of [filter][crate::model::SummarizeIntelligenceFindingsRequest::filter].
3342        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3343            self.0.request.filter = v.into();
3344            self
3345        }
3346
3347        /// Sets the value of [page_size][crate::model::SummarizeIntelligenceFindingsRequest::page_size].
3348        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3349            self.0.request.page_size = v.into();
3350            self
3351        }
3352
3353        /// Sets the value of [page_token][crate::model::SummarizeIntelligenceFindingsRequest::page_token].
3354        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3355            self.0.request.page_token = v.into();
3356            self
3357        }
3358    }
3359
3360    #[doc(hidden)]
3361    impl crate::RequestBuilder for SummarizeIntelligenceFindings {
3362        fn request_options(&mut self) -> &mut crate::RequestOptions {
3363            &mut self.0.options
3364        }
3365    }
3366
3367    /// The request builder for [StorageControl::get_intelligence_finding_revision][crate::client::StorageControl::get_intelligence_finding_revision] calls.
3368    ///
3369    /// # Example
3370    /// ```
3371    /// # use google_cloud_storage::builder::storage_control::GetIntelligenceFindingRevision;
3372    /// # async fn sample() -> google_cloud_storage::Result<()> {
3373    ///
3374    /// let builder = prepare_request_builder();
3375    /// let response = builder.send().await?;
3376    /// # Ok(()) }
3377    ///
3378    /// fn prepare_request_builder() -> GetIntelligenceFindingRevision {
3379    ///   # panic!();
3380    ///   // ... details omitted ...
3381    /// }
3382    /// ```
3383    #[derive(Clone, Debug)]
3384    pub struct GetIntelligenceFindingRevision(
3385        RequestBuilder<crate::model::GetIntelligenceFindingRevisionRequest>,
3386    );
3387
3388    impl GetIntelligenceFindingRevision {
3389        pub(crate) fn new(
3390            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
3391        ) -> Self {
3392            Self(RequestBuilder::new(stub))
3393        }
3394
3395        /// Sets the full request, replacing any prior values.
3396        pub fn with_request<V: Into<crate::model::GetIntelligenceFindingRevisionRequest>>(
3397            mut self,
3398            v: V,
3399        ) -> Self {
3400            self.0.request = v.into();
3401            self
3402        }
3403
3404        /// Sets all the options, replacing any prior values.
3405        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3406            self.0.options = v.into();
3407            self
3408        }
3409
3410        /// Sends the request.
3411        pub async fn send(self) -> Result<crate::model::IntelligenceFindingRevision> {
3412            (*self.0.stub)
3413                .get_intelligence_finding_revision(self.0.request, self.0.options)
3414                .await
3415                .map(crate::Response::into_body)
3416        }
3417
3418        /// Sets the value of [name][crate::model::GetIntelligenceFindingRevisionRequest::name].
3419        ///
3420        /// This is a **required** field for requests.
3421        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3422            self.0.request.name = v.into();
3423            self
3424        }
3425    }
3426
3427    #[doc(hidden)]
3428    impl crate::RequestBuilder for GetIntelligenceFindingRevision {
3429        fn request_options(&mut self) -> &mut crate::RequestOptions {
3430            &mut self.0.options
3431        }
3432    }
3433
3434    /// The request builder for [StorageControl::list_intelligence_finding_revisions][crate::client::StorageControl::list_intelligence_finding_revisions] calls.
3435    ///
3436    /// # Example
3437    /// ```
3438    /// # use google_cloud_storage::builder::storage_control::ListIntelligenceFindingRevisions;
3439    /// # async fn sample() -> google_cloud_storage::Result<()> {
3440    /// use google_cloud_gax::paginator::ItemPaginator;
3441    ///
3442    /// let builder = prepare_request_builder();
3443    /// let mut items = builder.by_item();
3444    /// while let Some(result) = items.next().await {
3445    ///   let item = result?;
3446    /// }
3447    /// # Ok(()) }
3448    ///
3449    /// fn prepare_request_builder() -> ListIntelligenceFindingRevisions {
3450    ///   # panic!();
3451    ///   // ... details omitted ...
3452    /// }
3453    /// ```
3454    #[derive(Clone, Debug)]
3455    pub struct ListIntelligenceFindingRevisions(
3456        RequestBuilder<crate::model::ListIntelligenceFindingRevisionsRequest>,
3457    );
3458
3459    impl ListIntelligenceFindingRevisions {
3460        pub(crate) fn new(
3461            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
3462        ) -> Self {
3463            Self(RequestBuilder::new(stub))
3464        }
3465
3466        /// Sets the full request, replacing any prior values.
3467        pub fn with_request<V: Into<crate::model::ListIntelligenceFindingRevisionsRequest>>(
3468            mut self,
3469            v: V,
3470        ) -> Self {
3471            self.0.request = v.into();
3472            self
3473        }
3474
3475        /// Sets all the options, replacing any prior values.
3476        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3477            self.0.options = v.into();
3478            self
3479        }
3480
3481        /// Sends the request.
3482        pub async fn send(self) -> Result<crate::model::ListIntelligenceFindingRevisionsResponse> {
3483            (*self.0.stub)
3484                .list_intelligence_finding_revisions(self.0.request, self.0.options)
3485                .await
3486                .map(crate::Response::into_body)
3487        }
3488
3489        /// Streams each page in the collection.
3490        pub fn by_page(
3491            self,
3492        ) -> impl google_cloud_gax::paginator::Paginator<
3493            crate::model::ListIntelligenceFindingRevisionsResponse,
3494            crate::Error,
3495        > {
3496            use std::clone::Clone;
3497            let token = self.0.request.page_token.clone();
3498            let execute = move |token: String| {
3499                let mut builder = self.clone();
3500                builder.0.request = builder.0.request.set_page_token(token);
3501                builder.send()
3502            };
3503            google_cloud_gax::paginator::internal::new_paginator(token, execute)
3504        }
3505
3506        /// Streams each item in the collection.
3507        pub fn by_item(
3508            self,
3509        ) -> impl google_cloud_gax::paginator::ItemPaginator<
3510            crate::model::ListIntelligenceFindingRevisionsResponse,
3511            crate::Error,
3512        > {
3513            use google_cloud_gax::paginator::Paginator;
3514            self.by_page().items()
3515        }
3516
3517        /// Sets the value of [parent][crate::model::ListIntelligenceFindingRevisionsRequest::parent].
3518        ///
3519        /// This is a **required** field for requests.
3520        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3521            self.0.request.parent = v.into();
3522            self
3523        }
3524
3525        /// Sets the value of [page_size][crate::model::ListIntelligenceFindingRevisionsRequest::page_size].
3526        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3527            self.0.request.page_size = v.into();
3528            self
3529        }
3530
3531        /// Sets the value of [page_token][crate::model::ListIntelligenceFindingRevisionsRequest::page_token].
3532        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3533            self.0.request.page_token = v.into();
3534            self
3535        }
3536    }
3537
3538    #[doc(hidden)]
3539    impl crate::RequestBuilder for ListIntelligenceFindingRevisions {
3540        fn request_options(&mut self) -> &mut crate::RequestOptions {
3541            &mut self.0.options
3542        }
3543    }
3544
3545    /// The request builder for [StorageControl::get_operation][crate::client::StorageControl::get_operation] calls.
3546    ///
3547    /// # Example
3548    /// ```
3549    /// # use google_cloud_storage::builder::storage_control::GetOperation;
3550    /// # async fn sample() -> google_cloud_storage::Result<()> {
3551    ///
3552    /// let builder = prepare_request_builder();
3553    /// let response = builder.send().await?;
3554    /// # Ok(()) }
3555    ///
3556    /// fn prepare_request_builder() -> GetOperation {
3557    ///   # panic!();
3558    ///   // ... details omitted ...
3559    /// }
3560    /// ```
3561    #[derive(Clone, Debug)]
3562    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
3563
3564    impl GetOperation {
3565        pub(crate) fn new(
3566            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
3567        ) -> Self {
3568            Self(RequestBuilder::new(stub))
3569        }
3570
3571        /// Sets the full request, replacing any prior values.
3572        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
3573            mut self,
3574            v: V,
3575        ) -> Self {
3576            self.0.request = v.into();
3577            self
3578        }
3579
3580        /// Sets all the options, replacing any prior values.
3581        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3582            self.0.options = v.into();
3583            self
3584        }
3585
3586        /// Sends the request.
3587        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3588            (*self.0.stub)
3589                .get_operation(self.0.request, self.0.options)
3590                .await
3591                .map(crate::Response::into_body)
3592        }
3593
3594        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
3595        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3596            self.0.request.name = v.into();
3597            self
3598        }
3599    }
3600
3601    #[doc(hidden)]
3602    impl crate::RequestBuilder for GetOperation {
3603        fn request_options(&mut self) -> &mut crate::RequestOptions {
3604            &mut self.0.options
3605        }
3606    }
3607}