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