Skip to main content

google_cloud_resourcemanager_v3/
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
17pub mod folders {
18    use crate::Result;
19
20    /// A builder for [Folders][crate::client::Folders].
21    ///
22    /// ```
23    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
24    /// # use google_cloud_resourcemanager_v3::*;
25    /// # use builder::folders::ClientBuilder;
26    /// # use client::Folders;
27    /// let builder : ClientBuilder = Folders::builder();
28    /// let client = builder
29    ///     .with_endpoint("https://cloudresourcemanager.googleapis.com")
30    ///     .build().await?;
31    /// # Ok(()) }
32    /// ```
33    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
34
35    pub(crate) mod client {
36        use super::super::super::client::Folders;
37        pub struct Factory;
38        impl crate::ClientFactory for Factory {
39            type Client = Folders;
40            type Credentials = gaxi::options::Credentials;
41            async fn build(
42                self,
43                config: gaxi::options::ClientConfig,
44            ) -> crate::ClientBuilderResult<Self::Client> {
45                Self::Client::new(config).await
46            }
47        }
48    }
49
50    /// Common implementation for [crate::client::Folders] request builders.
51    #[derive(Clone, Debug)]
52    pub(crate) struct RequestBuilder<R: std::default::Default> {
53        stub: std::sync::Arc<dyn super::super::stub::dynamic::Folders>,
54        request: R,
55        options: crate::RequestOptions,
56    }
57
58    impl<R> RequestBuilder<R>
59    where
60        R: std::default::Default,
61    {
62        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Folders>) -> Self {
63            Self {
64                stub,
65                request: R::default(),
66                options: crate::RequestOptions::default(),
67            }
68        }
69    }
70
71    /// The request builder for [Folders::get_folder][crate::client::Folders::get_folder] calls.
72    ///
73    /// # Example
74    /// ```
75    /// # use google_cloud_resourcemanager_v3::builder::folders::GetFolder;
76    /// # async fn sample() -> google_cloud_resourcemanager_v3::Result<()> {
77    ///
78    /// let builder = prepare_request_builder();
79    /// let response = builder.send().await?;
80    /// # Ok(()) }
81    ///
82    /// fn prepare_request_builder() -> GetFolder {
83    ///   # panic!();
84    ///   // ... details omitted ...
85    /// }
86    /// ```
87    #[derive(Clone, Debug)]
88    pub struct GetFolder(RequestBuilder<crate::model::GetFolderRequest>);
89
90    impl GetFolder {
91        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Folders>) -> Self {
92            Self(RequestBuilder::new(stub))
93        }
94
95        /// Sets the full request, replacing any prior values.
96        pub fn with_request<V: Into<crate::model::GetFolderRequest>>(mut self, v: V) -> Self {
97            self.0.request = v.into();
98            self
99        }
100
101        /// Sets all the options, replacing any prior values.
102        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
103            self.0.options = v.into();
104            self
105        }
106
107        /// Sends the request.
108        pub async fn send(self) -> Result<crate::model::Folder> {
109            (*self.0.stub)
110                .get_folder(self.0.request, self.0.options)
111                .await
112                .map(crate::Response::into_body)
113        }
114
115        /// Sets the value of [name][crate::model::GetFolderRequest::name].
116        ///
117        /// This is a **required** field for requests.
118        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
119            self.0.request.name = v.into();
120            self
121        }
122    }
123
124    #[doc(hidden)]
125    impl crate::RequestBuilder for GetFolder {
126        fn request_options(&mut self) -> &mut crate::RequestOptions {
127            &mut self.0.options
128        }
129    }
130
131    /// The request builder for [Folders::list_folders][crate::client::Folders::list_folders] calls.
132    ///
133    /// # Example
134    /// ```
135    /// # use google_cloud_resourcemanager_v3::builder::folders::ListFolders;
136    /// # async fn sample() -> google_cloud_resourcemanager_v3::Result<()> {
137    /// use google_cloud_gax::paginator::ItemPaginator;
138    ///
139    /// let builder = prepare_request_builder();
140    /// let mut items = builder.by_item();
141    /// while let Some(result) = items.next().await {
142    ///   let item = result?;
143    /// }
144    /// # Ok(()) }
145    ///
146    /// fn prepare_request_builder() -> ListFolders {
147    ///   # panic!();
148    ///   // ... details omitted ...
149    /// }
150    /// ```
151    #[derive(Clone, Debug)]
152    pub struct ListFolders(RequestBuilder<crate::model::ListFoldersRequest>);
153
154    impl ListFolders {
155        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Folders>) -> Self {
156            Self(RequestBuilder::new(stub))
157        }
158
159        /// Sets the full request, replacing any prior values.
160        pub fn with_request<V: Into<crate::model::ListFoldersRequest>>(mut self, v: V) -> Self {
161            self.0.request = v.into();
162            self
163        }
164
165        /// Sets all the options, replacing any prior values.
166        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
167            self.0.options = v.into();
168            self
169        }
170
171        /// Sends the request.
172        pub async fn send(self) -> Result<crate::model::ListFoldersResponse> {
173            (*self.0.stub)
174                .list_folders(self.0.request, self.0.options)
175                .await
176                .map(crate::Response::into_body)
177        }
178
179        /// Streams each page in the collection.
180        pub fn by_page(
181            self,
182        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListFoldersResponse, crate::Error>
183        {
184            use std::clone::Clone;
185            let token = self.0.request.page_token.clone();
186            let execute = move |token: String| {
187                let mut builder = self.clone();
188                builder.0.request = builder.0.request.set_page_token(token);
189                builder.send()
190            };
191            google_cloud_gax::paginator::internal::new_paginator(token, execute)
192        }
193
194        /// Streams each item in the collection.
195        pub fn by_item(
196            self,
197        ) -> impl google_cloud_gax::paginator::ItemPaginator<
198            crate::model::ListFoldersResponse,
199            crate::Error,
200        > {
201            use google_cloud_gax::paginator::Paginator;
202            self.by_page().items()
203        }
204
205        /// Sets the value of [parent][crate::model::ListFoldersRequest::parent].
206        ///
207        /// This is a **required** field for requests.
208        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
209            self.0.request.parent = v.into();
210            self
211        }
212
213        /// Sets the value of [page_size][crate::model::ListFoldersRequest::page_size].
214        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
215            self.0.request.page_size = v.into();
216            self
217        }
218
219        /// Sets the value of [page_token][crate::model::ListFoldersRequest::page_token].
220        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
221            self.0.request.page_token = v.into();
222            self
223        }
224
225        /// Sets the value of [show_deleted][crate::model::ListFoldersRequest::show_deleted].
226        pub fn set_show_deleted<T: Into<bool>>(mut self, v: T) -> Self {
227            self.0.request.show_deleted = v.into();
228            self
229        }
230    }
231
232    #[doc(hidden)]
233    impl crate::RequestBuilder for ListFolders {
234        fn request_options(&mut self) -> &mut crate::RequestOptions {
235            &mut self.0.options
236        }
237    }
238
239    /// The request builder for [Folders::search_folders][crate::client::Folders::search_folders] calls.
240    ///
241    /// # Example
242    /// ```
243    /// # use google_cloud_resourcemanager_v3::builder::folders::SearchFolders;
244    /// # async fn sample() -> google_cloud_resourcemanager_v3::Result<()> {
245    /// use google_cloud_gax::paginator::ItemPaginator;
246    ///
247    /// let builder = prepare_request_builder();
248    /// let mut items = builder.by_item();
249    /// while let Some(result) = items.next().await {
250    ///   let item = result?;
251    /// }
252    /// # Ok(()) }
253    ///
254    /// fn prepare_request_builder() -> SearchFolders {
255    ///   # panic!();
256    ///   // ... details omitted ...
257    /// }
258    /// ```
259    #[derive(Clone, Debug)]
260    pub struct SearchFolders(RequestBuilder<crate::model::SearchFoldersRequest>);
261
262    impl SearchFolders {
263        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Folders>) -> Self {
264            Self(RequestBuilder::new(stub))
265        }
266
267        /// Sets the full request, replacing any prior values.
268        pub fn with_request<V: Into<crate::model::SearchFoldersRequest>>(mut self, v: V) -> Self {
269            self.0.request = v.into();
270            self
271        }
272
273        /// Sets all the options, replacing any prior values.
274        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
275            self.0.options = v.into();
276            self
277        }
278
279        /// Sends the request.
280        pub async fn send(self) -> Result<crate::model::SearchFoldersResponse> {
281            (*self.0.stub)
282                .search_folders(self.0.request, self.0.options)
283                .await
284                .map(crate::Response::into_body)
285        }
286
287        /// Streams each page in the collection.
288        pub fn by_page(
289            self,
290        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::SearchFoldersResponse, crate::Error>
291        {
292            use std::clone::Clone;
293            let token = self.0.request.page_token.clone();
294            let execute = move |token: String| {
295                let mut builder = self.clone();
296                builder.0.request = builder.0.request.set_page_token(token);
297                builder.send()
298            };
299            google_cloud_gax::paginator::internal::new_paginator(token, execute)
300        }
301
302        /// Streams each item in the collection.
303        pub fn by_item(
304            self,
305        ) -> impl google_cloud_gax::paginator::ItemPaginator<
306            crate::model::SearchFoldersResponse,
307            crate::Error,
308        > {
309            use google_cloud_gax::paginator::Paginator;
310            self.by_page().items()
311        }
312
313        /// Sets the value of [page_size][crate::model::SearchFoldersRequest::page_size].
314        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
315            self.0.request.page_size = v.into();
316            self
317        }
318
319        /// Sets the value of [page_token][crate::model::SearchFoldersRequest::page_token].
320        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
321            self.0.request.page_token = v.into();
322            self
323        }
324
325        /// Sets the value of [query][crate::model::SearchFoldersRequest::query].
326        pub fn set_query<T: Into<std::string::String>>(mut self, v: T) -> Self {
327            self.0.request.query = v.into();
328            self
329        }
330    }
331
332    #[doc(hidden)]
333    impl crate::RequestBuilder for SearchFolders {
334        fn request_options(&mut self) -> &mut crate::RequestOptions {
335            &mut self.0.options
336        }
337    }
338
339    /// The request builder for [Folders::create_folder][crate::client::Folders::create_folder] calls.
340    ///
341    /// # Example
342    /// ```
343    /// # use google_cloud_resourcemanager_v3::builder::folders::CreateFolder;
344    /// # async fn sample() -> google_cloud_resourcemanager_v3::Result<()> {
345    /// use google_cloud_lro::Poller;
346    ///
347    /// let builder = prepare_request_builder();
348    /// let response = builder.poller().until_done().await?;
349    /// # Ok(()) }
350    ///
351    /// fn prepare_request_builder() -> CreateFolder {
352    ///   # panic!();
353    ///   // ... details omitted ...
354    /// }
355    /// ```
356    #[derive(Clone, Debug)]
357    pub struct CreateFolder(RequestBuilder<crate::model::CreateFolderRequest>);
358
359    impl CreateFolder {
360        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Folders>) -> Self {
361            Self(RequestBuilder::new(stub))
362        }
363
364        /// Sets the full request, replacing any prior values.
365        pub fn with_request<V: Into<crate::model::CreateFolderRequest>>(mut self, v: V) -> Self {
366            self.0.request = v.into();
367            self
368        }
369
370        /// Sets all the options, replacing any prior values.
371        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
372            self.0.options = v.into();
373            self
374        }
375
376        /// Sends the request.
377        ///
378        /// # Long running operations
379        ///
380        /// This starts, but does not poll, a longrunning operation. More information
381        /// on [create_folder][crate::client::Folders::create_folder].
382        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
383            (*self.0.stub)
384                .create_folder(self.0.request, self.0.options)
385                .await
386                .map(crate::Response::into_body)
387        }
388
389        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_folder`.
390        pub fn poller(
391            self,
392        ) -> impl google_cloud_lro::Poller<crate::model::Folder, crate::model::CreateFolderMetadata>
393        {
394            type Operation = google_cloud_lro::internal::Operation<
395                crate::model::Folder,
396                crate::model::CreateFolderMetadata,
397            >;
398            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
399            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
400
401            let stub = self.0.stub.clone();
402            let mut options = self.0.options.clone();
403            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
404            let query = move |name| {
405                let stub = stub.clone();
406                let options = options.clone();
407                async {
408                    let op = GetOperation::new(stub)
409                        .set_name(name)
410                        .with_options(options)
411                        .send()
412                        .await?;
413                    Ok(Operation::new(op))
414                }
415            };
416
417            let start = move || async {
418                let op = self.send().await?;
419                Ok(Operation::new(op))
420            };
421
422            google_cloud_lro::internal::new_poller(
423                polling_error_policy,
424                polling_backoff_policy,
425                start,
426                query,
427            )
428        }
429
430        /// Sets the value of [folder][crate::model::CreateFolderRequest::folder].
431        ///
432        /// This is a **required** field for requests.
433        pub fn set_folder<T>(mut self, v: T) -> Self
434        where
435            T: std::convert::Into<crate::model::Folder>,
436        {
437            self.0.request.folder = std::option::Option::Some(v.into());
438            self
439        }
440
441        /// Sets or clears the value of [folder][crate::model::CreateFolderRequest::folder].
442        ///
443        /// This is a **required** field for requests.
444        pub fn set_or_clear_folder<T>(mut self, v: std::option::Option<T>) -> Self
445        where
446            T: std::convert::Into<crate::model::Folder>,
447        {
448            self.0.request.folder = v.map(|x| x.into());
449            self
450        }
451    }
452
453    #[doc(hidden)]
454    impl crate::RequestBuilder for CreateFolder {
455        fn request_options(&mut self) -> &mut crate::RequestOptions {
456            &mut self.0.options
457        }
458    }
459
460    /// The request builder for [Folders::update_folder][crate::client::Folders::update_folder] calls.
461    ///
462    /// # Example
463    /// ```
464    /// # use google_cloud_resourcemanager_v3::builder::folders::UpdateFolder;
465    /// # async fn sample() -> google_cloud_resourcemanager_v3::Result<()> {
466    /// use google_cloud_lro::Poller;
467    ///
468    /// let builder = prepare_request_builder();
469    /// let response = builder.poller().until_done().await?;
470    /// # Ok(()) }
471    ///
472    /// fn prepare_request_builder() -> UpdateFolder {
473    ///   # panic!();
474    ///   // ... details omitted ...
475    /// }
476    /// ```
477    #[derive(Clone, Debug)]
478    pub struct UpdateFolder(RequestBuilder<crate::model::UpdateFolderRequest>);
479
480    impl UpdateFolder {
481        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Folders>) -> Self {
482            Self(RequestBuilder::new(stub))
483        }
484
485        /// Sets the full request, replacing any prior values.
486        pub fn with_request<V: Into<crate::model::UpdateFolderRequest>>(mut self, v: V) -> Self {
487            self.0.request = v.into();
488            self
489        }
490
491        /// Sets all the options, replacing any prior values.
492        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
493            self.0.options = v.into();
494            self
495        }
496
497        /// Sends the request.
498        ///
499        /// # Long running operations
500        ///
501        /// This starts, but does not poll, a longrunning operation. More information
502        /// on [update_folder][crate::client::Folders::update_folder].
503        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
504            (*self.0.stub)
505                .update_folder(self.0.request, self.0.options)
506                .await
507                .map(crate::Response::into_body)
508        }
509
510        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_folder`.
511        pub fn poller(
512            self,
513        ) -> impl google_cloud_lro::Poller<crate::model::Folder, crate::model::UpdateFolderMetadata>
514        {
515            type Operation = google_cloud_lro::internal::Operation<
516                crate::model::Folder,
517                crate::model::UpdateFolderMetadata,
518            >;
519            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
520            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
521
522            let stub = self.0.stub.clone();
523            let mut options = self.0.options.clone();
524            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
525            let query = move |name| {
526                let stub = stub.clone();
527                let options = options.clone();
528                async {
529                    let op = GetOperation::new(stub)
530                        .set_name(name)
531                        .with_options(options)
532                        .send()
533                        .await?;
534                    Ok(Operation::new(op))
535                }
536            };
537
538            let start = move || async {
539                let op = self.send().await?;
540                Ok(Operation::new(op))
541            };
542
543            google_cloud_lro::internal::new_poller(
544                polling_error_policy,
545                polling_backoff_policy,
546                start,
547                query,
548            )
549        }
550
551        /// Sets the value of [folder][crate::model::UpdateFolderRequest::folder].
552        ///
553        /// This is a **required** field for requests.
554        pub fn set_folder<T>(mut self, v: T) -> Self
555        where
556            T: std::convert::Into<crate::model::Folder>,
557        {
558            self.0.request.folder = std::option::Option::Some(v.into());
559            self
560        }
561
562        /// Sets or clears the value of [folder][crate::model::UpdateFolderRequest::folder].
563        ///
564        /// This is a **required** field for requests.
565        pub fn set_or_clear_folder<T>(mut self, v: std::option::Option<T>) -> Self
566        where
567            T: std::convert::Into<crate::model::Folder>,
568        {
569            self.0.request.folder = v.map(|x| x.into());
570            self
571        }
572
573        /// Sets the value of [update_mask][crate::model::UpdateFolderRequest::update_mask].
574        ///
575        /// This is a **required** field for requests.
576        pub fn set_update_mask<T>(mut self, v: T) -> Self
577        where
578            T: std::convert::Into<wkt::FieldMask>,
579        {
580            self.0.request.update_mask = std::option::Option::Some(v.into());
581            self
582        }
583
584        /// Sets or clears the value of [update_mask][crate::model::UpdateFolderRequest::update_mask].
585        ///
586        /// This is a **required** field for requests.
587        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
588        where
589            T: std::convert::Into<wkt::FieldMask>,
590        {
591            self.0.request.update_mask = v.map(|x| x.into());
592            self
593        }
594    }
595
596    #[doc(hidden)]
597    impl crate::RequestBuilder for UpdateFolder {
598        fn request_options(&mut self) -> &mut crate::RequestOptions {
599            &mut self.0.options
600        }
601    }
602
603    /// The request builder for [Folders::move_folder][crate::client::Folders::move_folder] calls.
604    ///
605    /// # Example
606    /// ```
607    /// # use google_cloud_resourcemanager_v3::builder::folders::MoveFolder;
608    /// # async fn sample() -> google_cloud_resourcemanager_v3::Result<()> {
609    /// use google_cloud_lro::Poller;
610    ///
611    /// let builder = prepare_request_builder();
612    /// let response = builder.poller().until_done().await?;
613    /// # Ok(()) }
614    ///
615    /// fn prepare_request_builder() -> MoveFolder {
616    ///   # panic!();
617    ///   // ... details omitted ...
618    /// }
619    /// ```
620    #[derive(Clone, Debug)]
621    pub struct MoveFolder(RequestBuilder<crate::model::MoveFolderRequest>);
622
623    impl MoveFolder {
624        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Folders>) -> Self {
625            Self(RequestBuilder::new(stub))
626        }
627
628        /// Sets the full request, replacing any prior values.
629        pub fn with_request<V: Into<crate::model::MoveFolderRequest>>(mut self, v: V) -> Self {
630            self.0.request = v.into();
631            self
632        }
633
634        /// Sets all the options, replacing any prior values.
635        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
636            self.0.options = v.into();
637            self
638        }
639
640        /// Sends the request.
641        ///
642        /// # Long running operations
643        ///
644        /// This starts, but does not poll, a longrunning operation. More information
645        /// on [move_folder][crate::client::Folders::move_folder].
646        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
647            (*self.0.stub)
648                .move_folder(self.0.request, self.0.options)
649                .await
650                .map(crate::Response::into_body)
651        }
652
653        /// Creates a [Poller][google_cloud_lro::Poller] to work with `move_folder`.
654        pub fn poller(
655            self,
656        ) -> impl google_cloud_lro::Poller<crate::model::Folder, crate::model::MoveFolderMetadata>
657        {
658            type Operation = google_cloud_lro::internal::Operation<
659                crate::model::Folder,
660                crate::model::MoveFolderMetadata,
661            >;
662            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
663            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
664
665            let stub = self.0.stub.clone();
666            let mut options = self.0.options.clone();
667            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
668            let query = move |name| {
669                let stub = stub.clone();
670                let options = options.clone();
671                async {
672                    let op = GetOperation::new(stub)
673                        .set_name(name)
674                        .with_options(options)
675                        .send()
676                        .await?;
677                    Ok(Operation::new(op))
678                }
679            };
680
681            let start = move || async {
682                let op = self.send().await?;
683                Ok(Operation::new(op))
684            };
685
686            google_cloud_lro::internal::new_poller(
687                polling_error_policy,
688                polling_backoff_policy,
689                start,
690                query,
691            )
692        }
693
694        /// Sets the value of [name][crate::model::MoveFolderRequest::name].
695        ///
696        /// This is a **required** field for requests.
697        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
698            self.0.request.name = v.into();
699            self
700        }
701
702        /// Sets the value of [destination_parent][crate::model::MoveFolderRequest::destination_parent].
703        ///
704        /// This is a **required** field for requests.
705        pub fn set_destination_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
706            self.0.request.destination_parent = v.into();
707            self
708        }
709    }
710
711    #[doc(hidden)]
712    impl crate::RequestBuilder for MoveFolder {
713        fn request_options(&mut self) -> &mut crate::RequestOptions {
714            &mut self.0.options
715        }
716    }
717
718    /// The request builder for [Folders::delete_folder][crate::client::Folders::delete_folder] calls.
719    ///
720    /// # Example
721    /// ```
722    /// # use google_cloud_resourcemanager_v3::builder::folders::DeleteFolder;
723    /// # async fn sample() -> google_cloud_resourcemanager_v3::Result<()> {
724    /// use google_cloud_lro::Poller;
725    ///
726    /// let builder = prepare_request_builder();
727    /// let response = builder.poller().until_done().await?;
728    /// # Ok(()) }
729    ///
730    /// fn prepare_request_builder() -> DeleteFolder {
731    ///   # panic!();
732    ///   // ... details omitted ...
733    /// }
734    /// ```
735    #[derive(Clone, Debug)]
736    pub struct DeleteFolder(RequestBuilder<crate::model::DeleteFolderRequest>);
737
738    impl DeleteFolder {
739        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Folders>) -> Self {
740            Self(RequestBuilder::new(stub))
741        }
742
743        /// Sets the full request, replacing any prior values.
744        pub fn with_request<V: Into<crate::model::DeleteFolderRequest>>(mut self, v: V) -> Self {
745            self.0.request = v.into();
746            self
747        }
748
749        /// Sets all the options, replacing any prior values.
750        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
751            self.0.options = v.into();
752            self
753        }
754
755        /// Sends the request.
756        ///
757        /// # Long running operations
758        ///
759        /// This starts, but does not poll, a longrunning operation. More information
760        /// on [delete_folder][crate::client::Folders::delete_folder].
761        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
762            (*self.0.stub)
763                .delete_folder(self.0.request, self.0.options)
764                .await
765                .map(crate::Response::into_body)
766        }
767
768        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_folder`.
769        pub fn poller(
770            self,
771        ) -> impl google_cloud_lro::Poller<crate::model::Folder, crate::model::DeleteFolderMetadata>
772        {
773            type Operation = google_cloud_lro::internal::Operation<
774                crate::model::Folder,
775                crate::model::DeleteFolderMetadata,
776            >;
777            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
778            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
779
780            let stub = self.0.stub.clone();
781            let mut options = self.0.options.clone();
782            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
783            let query = move |name| {
784                let stub = stub.clone();
785                let options = options.clone();
786                async {
787                    let op = GetOperation::new(stub)
788                        .set_name(name)
789                        .with_options(options)
790                        .send()
791                        .await?;
792                    Ok(Operation::new(op))
793                }
794            };
795
796            let start = move || async {
797                let op = self.send().await?;
798                Ok(Operation::new(op))
799            };
800
801            google_cloud_lro::internal::new_poller(
802                polling_error_policy,
803                polling_backoff_policy,
804                start,
805                query,
806            )
807        }
808
809        /// Sets the value of [name][crate::model::DeleteFolderRequest::name].
810        ///
811        /// This is a **required** field for requests.
812        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
813            self.0.request.name = v.into();
814            self
815        }
816    }
817
818    #[doc(hidden)]
819    impl crate::RequestBuilder for DeleteFolder {
820        fn request_options(&mut self) -> &mut crate::RequestOptions {
821            &mut self.0.options
822        }
823    }
824
825    /// The request builder for [Folders::undelete_folder][crate::client::Folders::undelete_folder] calls.
826    ///
827    /// # Example
828    /// ```
829    /// # use google_cloud_resourcemanager_v3::builder::folders::UndeleteFolder;
830    /// # async fn sample() -> google_cloud_resourcemanager_v3::Result<()> {
831    /// use google_cloud_lro::Poller;
832    ///
833    /// let builder = prepare_request_builder();
834    /// let response = builder.poller().until_done().await?;
835    /// # Ok(()) }
836    ///
837    /// fn prepare_request_builder() -> UndeleteFolder {
838    ///   # panic!();
839    ///   // ... details omitted ...
840    /// }
841    /// ```
842    #[derive(Clone, Debug)]
843    pub struct UndeleteFolder(RequestBuilder<crate::model::UndeleteFolderRequest>);
844
845    impl UndeleteFolder {
846        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Folders>) -> Self {
847            Self(RequestBuilder::new(stub))
848        }
849
850        /// Sets the full request, replacing any prior values.
851        pub fn with_request<V: Into<crate::model::UndeleteFolderRequest>>(mut self, v: V) -> Self {
852            self.0.request = v.into();
853            self
854        }
855
856        /// Sets all the options, replacing any prior values.
857        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
858            self.0.options = v.into();
859            self
860        }
861
862        /// Sends the request.
863        ///
864        /// # Long running operations
865        ///
866        /// This starts, but does not poll, a longrunning operation. More information
867        /// on [undelete_folder][crate::client::Folders::undelete_folder].
868        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
869            (*self.0.stub)
870                .undelete_folder(self.0.request, self.0.options)
871                .await
872                .map(crate::Response::into_body)
873        }
874
875        /// Creates a [Poller][google_cloud_lro::Poller] to work with `undelete_folder`.
876        pub fn poller(
877            self,
878        ) -> impl google_cloud_lro::Poller<crate::model::Folder, crate::model::UndeleteFolderMetadata>
879        {
880            type Operation = google_cloud_lro::internal::Operation<
881                crate::model::Folder,
882                crate::model::UndeleteFolderMetadata,
883            >;
884            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
885            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
886
887            let stub = self.0.stub.clone();
888            let mut options = self.0.options.clone();
889            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
890            let query = move |name| {
891                let stub = stub.clone();
892                let options = options.clone();
893                async {
894                    let op = GetOperation::new(stub)
895                        .set_name(name)
896                        .with_options(options)
897                        .send()
898                        .await?;
899                    Ok(Operation::new(op))
900                }
901            };
902
903            let start = move || async {
904                let op = self.send().await?;
905                Ok(Operation::new(op))
906            };
907
908            google_cloud_lro::internal::new_poller(
909                polling_error_policy,
910                polling_backoff_policy,
911                start,
912                query,
913            )
914        }
915
916        /// Sets the value of [name][crate::model::UndeleteFolderRequest::name].
917        ///
918        /// This is a **required** field for requests.
919        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
920            self.0.request.name = v.into();
921            self
922        }
923    }
924
925    #[doc(hidden)]
926    impl crate::RequestBuilder for UndeleteFolder {
927        fn request_options(&mut self) -> &mut crate::RequestOptions {
928            &mut self.0.options
929        }
930    }
931
932    /// The request builder for [Folders::get_iam_policy][crate::client::Folders::get_iam_policy] calls.
933    ///
934    /// # Example
935    /// ```
936    /// # use google_cloud_resourcemanager_v3::builder::folders::GetIamPolicy;
937    /// # async fn sample() -> google_cloud_resourcemanager_v3::Result<()> {
938    ///
939    /// let builder = prepare_request_builder();
940    /// let response = builder.send().await?;
941    /// # Ok(()) }
942    ///
943    /// fn prepare_request_builder() -> GetIamPolicy {
944    ///   # panic!();
945    ///   // ... details omitted ...
946    /// }
947    /// ```
948    #[derive(Clone, Debug)]
949    pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
950
951    impl GetIamPolicy {
952        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Folders>) -> Self {
953            Self(RequestBuilder::new(stub))
954        }
955
956        /// Sets the full request, replacing any prior values.
957        pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
958            mut self,
959            v: V,
960        ) -> Self {
961            self.0.request = v.into();
962            self
963        }
964
965        /// Sets all the options, replacing any prior values.
966        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
967            self.0.options = v.into();
968            self
969        }
970
971        /// Sends the request.
972        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
973            (*self.0.stub)
974                .get_iam_policy(self.0.request, self.0.options)
975                .await
976                .map(crate::Response::into_body)
977        }
978
979        /// Sets the value of [resource][google_cloud_iam_v1::model::GetIamPolicyRequest::resource].
980        ///
981        /// This is a **required** field for requests.
982        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
983            self.0.request.resource = v.into();
984            self
985        }
986
987        /// Sets the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
988        pub fn set_options<T>(mut self, v: T) -> Self
989        where
990            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
991        {
992            self.0.request.options = std::option::Option::Some(v.into());
993            self
994        }
995
996        /// Sets or clears the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
997        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
998        where
999            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
1000        {
1001            self.0.request.options = v.map(|x| x.into());
1002            self
1003        }
1004    }
1005
1006    #[doc(hidden)]
1007    impl crate::RequestBuilder for GetIamPolicy {
1008        fn request_options(&mut self) -> &mut crate::RequestOptions {
1009            &mut self.0.options
1010        }
1011    }
1012
1013    /// The request builder for [Folders::set_iam_policy][crate::client::Folders::set_iam_policy] calls.
1014    ///
1015    /// # Example
1016    /// ```
1017    /// # use google_cloud_resourcemanager_v3::builder::folders::SetIamPolicy;
1018    /// # async fn sample() -> google_cloud_resourcemanager_v3::Result<()> {
1019    ///
1020    /// let builder = prepare_request_builder();
1021    /// let response = builder.send().await?;
1022    /// # Ok(()) }
1023    ///
1024    /// fn prepare_request_builder() -> SetIamPolicy {
1025    ///   # panic!();
1026    ///   // ... details omitted ...
1027    /// }
1028    /// ```
1029    #[derive(Clone, Debug)]
1030    pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
1031
1032    impl SetIamPolicy {
1033        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Folders>) -> Self {
1034            Self(RequestBuilder::new(stub))
1035        }
1036
1037        /// Sets the full request, replacing any prior values.
1038        pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
1039            mut self,
1040            v: V,
1041        ) -> Self {
1042            self.0.request = v.into();
1043            self
1044        }
1045
1046        /// Sets all the options, replacing any prior values.
1047        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1048            self.0.options = v.into();
1049            self
1050        }
1051
1052        /// Sends the request.
1053        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
1054            (*self.0.stub)
1055                .set_iam_policy(self.0.request, self.0.options)
1056                .await
1057                .map(crate::Response::into_body)
1058        }
1059
1060        /// Sets the value of [resource][google_cloud_iam_v1::model::SetIamPolicyRequest::resource].
1061        ///
1062        /// This is a **required** field for requests.
1063        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1064            self.0.request.resource = v.into();
1065            self
1066        }
1067
1068        /// Sets the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
1069        ///
1070        /// This is a **required** field for requests.
1071        pub fn set_policy<T>(mut self, v: T) -> Self
1072        where
1073            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
1074        {
1075            self.0.request.policy = std::option::Option::Some(v.into());
1076            self
1077        }
1078
1079        /// Sets or clears the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
1080        ///
1081        /// This is a **required** field for requests.
1082        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
1083        where
1084            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
1085        {
1086            self.0.request.policy = v.map(|x| x.into());
1087            self
1088        }
1089
1090        /// Sets the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
1091        pub fn set_update_mask<T>(mut self, v: T) -> Self
1092        where
1093            T: std::convert::Into<wkt::FieldMask>,
1094        {
1095            self.0.request.update_mask = std::option::Option::Some(v.into());
1096            self
1097        }
1098
1099        /// Sets or clears the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
1100        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1101        where
1102            T: std::convert::Into<wkt::FieldMask>,
1103        {
1104            self.0.request.update_mask = v.map(|x| x.into());
1105            self
1106        }
1107    }
1108
1109    #[doc(hidden)]
1110    impl crate::RequestBuilder for SetIamPolicy {
1111        fn request_options(&mut self) -> &mut crate::RequestOptions {
1112            &mut self.0.options
1113        }
1114    }
1115
1116    /// The request builder for [Folders::test_iam_permissions][crate::client::Folders::test_iam_permissions] calls.
1117    ///
1118    /// # Example
1119    /// ```
1120    /// # use google_cloud_resourcemanager_v3::builder::folders::TestIamPermissions;
1121    /// # async fn sample() -> google_cloud_resourcemanager_v3::Result<()> {
1122    ///
1123    /// let builder = prepare_request_builder();
1124    /// let response = builder.send().await?;
1125    /// # Ok(()) }
1126    ///
1127    /// fn prepare_request_builder() -> TestIamPermissions {
1128    ///   # panic!();
1129    ///   // ... details omitted ...
1130    /// }
1131    /// ```
1132    #[derive(Clone, Debug)]
1133    pub struct TestIamPermissions(
1134        RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
1135    );
1136
1137    impl TestIamPermissions {
1138        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Folders>) -> Self {
1139            Self(RequestBuilder::new(stub))
1140        }
1141
1142        /// Sets the full request, replacing any prior values.
1143        pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
1144            mut self,
1145            v: V,
1146        ) -> Self {
1147            self.0.request = v.into();
1148            self
1149        }
1150
1151        /// Sets all the options, replacing any prior values.
1152        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1153            self.0.options = v.into();
1154            self
1155        }
1156
1157        /// Sends the request.
1158        pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
1159            (*self.0.stub)
1160                .test_iam_permissions(self.0.request, self.0.options)
1161                .await
1162                .map(crate::Response::into_body)
1163        }
1164
1165        /// Sets the value of [resource][google_cloud_iam_v1::model::TestIamPermissionsRequest::resource].
1166        ///
1167        /// This is a **required** field for requests.
1168        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1169            self.0.request.resource = v.into();
1170            self
1171        }
1172
1173        /// Sets the value of [permissions][google_cloud_iam_v1::model::TestIamPermissionsRequest::permissions].
1174        ///
1175        /// This is a **required** field for requests.
1176        pub fn set_permissions<T, V>(mut self, v: T) -> Self
1177        where
1178            T: std::iter::IntoIterator<Item = V>,
1179            V: std::convert::Into<std::string::String>,
1180        {
1181            use std::iter::Iterator;
1182            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
1183            self
1184        }
1185    }
1186
1187    #[doc(hidden)]
1188    impl crate::RequestBuilder for TestIamPermissions {
1189        fn request_options(&mut self) -> &mut crate::RequestOptions {
1190            &mut self.0.options
1191        }
1192    }
1193
1194    /// The request builder for [Folders::get_operation][crate::client::Folders::get_operation] calls.
1195    ///
1196    /// # Example
1197    /// ```
1198    /// # use google_cloud_resourcemanager_v3::builder::folders::GetOperation;
1199    /// # async fn sample() -> google_cloud_resourcemanager_v3::Result<()> {
1200    ///
1201    /// let builder = prepare_request_builder();
1202    /// let response = builder.send().await?;
1203    /// # Ok(()) }
1204    ///
1205    /// fn prepare_request_builder() -> GetOperation {
1206    ///   # panic!();
1207    ///   // ... details omitted ...
1208    /// }
1209    /// ```
1210    #[derive(Clone, Debug)]
1211    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
1212
1213    impl GetOperation {
1214        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Folders>) -> Self {
1215            Self(RequestBuilder::new(stub))
1216        }
1217
1218        /// Sets the full request, replacing any prior values.
1219        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
1220            mut self,
1221            v: V,
1222        ) -> Self {
1223            self.0.request = v.into();
1224            self
1225        }
1226
1227        /// Sets all the options, replacing any prior values.
1228        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1229            self.0.options = v.into();
1230            self
1231        }
1232
1233        /// Sends the request.
1234        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1235            (*self.0.stub)
1236                .get_operation(self.0.request, self.0.options)
1237                .await
1238                .map(crate::Response::into_body)
1239        }
1240
1241        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
1242        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1243            self.0.request.name = v.into();
1244            self
1245        }
1246    }
1247
1248    #[doc(hidden)]
1249    impl crate::RequestBuilder for GetOperation {
1250        fn request_options(&mut self) -> &mut crate::RequestOptions {
1251            &mut self.0.options
1252        }
1253    }
1254}
1255
1256pub mod organizations {
1257    use crate::Result;
1258
1259    /// A builder for [Organizations][crate::client::Organizations].
1260    ///
1261    /// ```
1262    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1263    /// # use google_cloud_resourcemanager_v3::*;
1264    /// # use builder::organizations::ClientBuilder;
1265    /// # use client::Organizations;
1266    /// let builder : ClientBuilder = Organizations::builder();
1267    /// let client = builder
1268    ///     .with_endpoint("https://cloudresourcemanager.googleapis.com")
1269    ///     .build().await?;
1270    /// # Ok(()) }
1271    /// ```
1272    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1273
1274    pub(crate) mod client {
1275        use super::super::super::client::Organizations;
1276        pub struct Factory;
1277        impl crate::ClientFactory for Factory {
1278            type Client = Organizations;
1279            type Credentials = gaxi::options::Credentials;
1280            async fn build(
1281                self,
1282                config: gaxi::options::ClientConfig,
1283            ) -> crate::ClientBuilderResult<Self::Client> {
1284                Self::Client::new(config).await
1285            }
1286        }
1287    }
1288
1289    /// Common implementation for [crate::client::Organizations] request builders.
1290    #[derive(Clone, Debug)]
1291    pub(crate) struct RequestBuilder<R: std::default::Default> {
1292        stub: std::sync::Arc<dyn super::super::stub::dynamic::Organizations>,
1293        request: R,
1294        options: crate::RequestOptions,
1295    }
1296
1297    impl<R> RequestBuilder<R>
1298    where
1299        R: std::default::Default,
1300    {
1301        pub(crate) fn new(
1302            stub: std::sync::Arc<dyn super::super::stub::dynamic::Organizations>,
1303        ) -> Self {
1304            Self {
1305                stub,
1306                request: R::default(),
1307                options: crate::RequestOptions::default(),
1308            }
1309        }
1310    }
1311
1312    /// The request builder for [Organizations::get_organization][crate::client::Organizations::get_organization] calls.
1313    ///
1314    /// # Example
1315    /// ```
1316    /// # use google_cloud_resourcemanager_v3::builder::organizations::GetOrganization;
1317    /// # async fn sample() -> google_cloud_resourcemanager_v3::Result<()> {
1318    ///
1319    /// let builder = prepare_request_builder();
1320    /// let response = builder.send().await?;
1321    /// # Ok(()) }
1322    ///
1323    /// fn prepare_request_builder() -> GetOrganization {
1324    ///   # panic!();
1325    ///   // ... details omitted ...
1326    /// }
1327    /// ```
1328    #[derive(Clone, Debug)]
1329    pub struct GetOrganization(RequestBuilder<crate::model::GetOrganizationRequest>);
1330
1331    impl GetOrganization {
1332        pub(crate) fn new(
1333            stub: std::sync::Arc<dyn super::super::stub::dynamic::Organizations>,
1334        ) -> Self {
1335            Self(RequestBuilder::new(stub))
1336        }
1337
1338        /// Sets the full request, replacing any prior values.
1339        pub fn with_request<V: Into<crate::model::GetOrganizationRequest>>(mut self, v: V) -> Self {
1340            self.0.request = v.into();
1341            self
1342        }
1343
1344        /// Sets all the options, replacing any prior values.
1345        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1346            self.0.options = v.into();
1347            self
1348        }
1349
1350        /// Sends the request.
1351        pub async fn send(self) -> Result<crate::model::Organization> {
1352            (*self.0.stub)
1353                .get_organization(self.0.request, self.0.options)
1354                .await
1355                .map(crate::Response::into_body)
1356        }
1357
1358        /// Sets the value of [name][crate::model::GetOrganizationRequest::name].
1359        ///
1360        /// This is a **required** field for requests.
1361        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1362            self.0.request.name = v.into();
1363            self
1364        }
1365    }
1366
1367    #[doc(hidden)]
1368    impl crate::RequestBuilder for GetOrganization {
1369        fn request_options(&mut self) -> &mut crate::RequestOptions {
1370            &mut self.0.options
1371        }
1372    }
1373
1374    /// The request builder for [Organizations::search_organizations][crate::client::Organizations::search_organizations] calls.
1375    ///
1376    /// # Example
1377    /// ```
1378    /// # use google_cloud_resourcemanager_v3::builder::organizations::SearchOrganizations;
1379    /// # async fn sample() -> google_cloud_resourcemanager_v3::Result<()> {
1380    /// use google_cloud_gax::paginator::ItemPaginator;
1381    ///
1382    /// let builder = prepare_request_builder();
1383    /// let mut items = builder.by_item();
1384    /// while let Some(result) = items.next().await {
1385    ///   let item = result?;
1386    /// }
1387    /// # Ok(()) }
1388    ///
1389    /// fn prepare_request_builder() -> SearchOrganizations {
1390    ///   # panic!();
1391    ///   // ... details omitted ...
1392    /// }
1393    /// ```
1394    #[derive(Clone, Debug)]
1395    pub struct SearchOrganizations(RequestBuilder<crate::model::SearchOrganizationsRequest>);
1396
1397    impl SearchOrganizations {
1398        pub(crate) fn new(
1399            stub: std::sync::Arc<dyn super::super::stub::dynamic::Organizations>,
1400        ) -> Self {
1401            Self(RequestBuilder::new(stub))
1402        }
1403
1404        /// Sets the full request, replacing any prior values.
1405        pub fn with_request<V: Into<crate::model::SearchOrganizationsRequest>>(
1406            mut self,
1407            v: V,
1408        ) -> Self {
1409            self.0.request = v.into();
1410            self
1411        }
1412
1413        /// Sets all the options, replacing any prior values.
1414        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1415            self.0.options = v.into();
1416            self
1417        }
1418
1419        /// Sends the request.
1420        pub async fn send(self) -> Result<crate::model::SearchOrganizationsResponse> {
1421            (*self.0.stub)
1422                .search_organizations(self.0.request, self.0.options)
1423                .await
1424                .map(crate::Response::into_body)
1425        }
1426
1427        /// Streams each page in the collection.
1428        pub fn by_page(
1429            self,
1430        ) -> impl google_cloud_gax::paginator::Paginator<
1431            crate::model::SearchOrganizationsResponse,
1432            crate::Error,
1433        > {
1434            use std::clone::Clone;
1435            let token = self.0.request.page_token.clone();
1436            let execute = move |token: String| {
1437                let mut builder = self.clone();
1438                builder.0.request = builder.0.request.set_page_token(token);
1439                builder.send()
1440            };
1441            google_cloud_gax::paginator::internal::new_paginator(token, execute)
1442        }
1443
1444        /// Streams each item in the collection.
1445        pub fn by_item(
1446            self,
1447        ) -> impl google_cloud_gax::paginator::ItemPaginator<
1448            crate::model::SearchOrganizationsResponse,
1449            crate::Error,
1450        > {
1451            use google_cloud_gax::paginator::Paginator;
1452            self.by_page().items()
1453        }
1454
1455        /// Sets the value of [page_size][crate::model::SearchOrganizationsRequest::page_size].
1456        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1457            self.0.request.page_size = v.into();
1458            self
1459        }
1460
1461        /// Sets the value of [page_token][crate::model::SearchOrganizationsRequest::page_token].
1462        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1463            self.0.request.page_token = v.into();
1464            self
1465        }
1466
1467        /// Sets the value of [query][crate::model::SearchOrganizationsRequest::query].
1468        pub fn set_query<T: Into<std::string::String>>(mut self, v: T) -> Self {
1469            self.0.request.query = v.into();
1470            self
1471        }
1472    }
1473
1474    #[doc(hidden)]
1475    impl crate::RequestBuilder for SearchOrganizations {
1476        fn request_options(&mut self) -> &mut crate::RequestOptions {
1477            &mut self.0.options
1478        }
1479    }
1480
1481    /// The request builder for [Organizations::get_iam_policy][crate::client::Organizations::get_iam_policy] calls.
1482    ///
1483    /// # Example
1484    /// ```
1485    /// # use google_cloud_resourcemanager_v3::builder::organizations::GetIamPolicy;
1486    /// # async fn sample() -> google_cloud_resourcemanager_v3::Result<()> {
1487    ///
1488    /// let builder = prepare_request_builder();
1489    /// let response = builder.send().await?;
1490    /// # Ok(()) }
1491    ///
1492    /// fn prepare_request_builder() -> GetIamPolicy {
1493    ///   # panic!();
1494    ///   // ... details omitted ...
1495    /// }
1496    /// ```
1497    #[derive(Clone, Debug)]
1498    pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
1499
1500    impl GetIamPolicy {
1501        pub(crate) fn new(
1502            stub: std::sync::Arc<dyn super::super::stub::dynamic::Organizations>,
1503        ) -> Self {
1504            Self(RequestBuilder::new(stub))
1505        }
1506
1507        /// Sets the full request, replacing any prior values.
1508        pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
1509            mut self,
1510            v: V,
1511        ) -> Self {
1512            self.0.request = v.into();
1513            self
1514        }
1515
1516        /// Sets all the options, replacing any prior values.
1517        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1518            self.0.options = v.into();
1519            self
1520        }
1521
1522        /// Sends the request.
1523        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
1524            (*self.0.stub)
1525                .get_iam_policy(self.0.request, self.0.options)
1526                .await
1527                .map(crate::Response::into_body)
1528        }
1529
1530        /// Sets the value of [resource][google_cloud_iam_v1::model::GetIamPolicyRequest::resource].
1531        ///
1532        /// This is a **required** field for requests.
1533        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1534            self.0.request.resource = v.into();
1535            self
1536        }
1537
1538        /// Sets the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
1539        pub fn set_options<T>(mut self, v: T) -> Self
1540        where
1541            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
1542        {
1543            self.0.request.options = std::option::Option::Some(v.into());
1544            self
1545        }
1546
1547        /// Sets or clears the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
1548        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
1549        where
1550            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
1551        {
1552            self.0.request.options = v.map(|x| x.into());
1553            self
1554        }
1555    }
1556
1557    #[doc(hidden)]
1558    impl crate::RequestBuilder for GetIamPolicy {
1559        fn request_options(&mut self) -> &mut crate::RequestOptions {
1560            &mut self.0.options
1561        }
1562    }
1563
1564    /// The request builder for [Organizations::set_iam_policy][crate::client::Organizations::set_iam_policy] calls.
1565    ///
1566    /// # Example
1567    /// ```
1568    /// # use google_cloud_resourcemanager_v3::builder::organizations::SetIamPolicy;
1569    /// # async fn sample() -> google_cloud_resourcemanager_v3::Result<()> {
1570    ///
1571    /// let builder = prepare_request_builder();
1572    /// let response = builder.send().await?;
1573    /// # Ok(()) }
1574    ///
1575    /// fn prepare_request_builder() -> SetIamPolicy {
1576    ///   # panic!();
1577    ///   // ... details omitted ...
1578    /// }
1579    /// ```
1580    #[derive(Clone, Debug)]
1581    pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
1582
1583    impl SetIamPolicy {
1584        pub(crate) fn new(
1585            stub: std::sync::Arc<dyn super::super::stub::dynamic::Organizations>,
1586        ) -> Self {
1587            Self(RequestBuilder::new(stub))
1588        }
1589
1590        /// Sets the full request, replacing any prior values.
1591        pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
1592            mut self,
1593            v: V,
1594        ) -> Self {
1595            self.0.request = v.into();
1596            self
1597        }
1598
1599        /// Sets all the options, replacing any prior values.
1600        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1601            self.0.options = v.into();
1602            self
1603        }
1604
1605        /// Sends the request.
1606        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
1607            (*self.0.stub)
1608                .set_iam_policy(self.0.request, self.0.options)
1609                .await
1610                .map(crate::Response::into_body)
1611        }
1612
1613        /// Sets the value of [resource][google_cloud_iam_v1::model::SetIamPolicyRequest::resource].
1614        ///
1615        /// This is a **required** field for requests.
1616        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1617            self.0.request.resource = v.into();
1618            self
1619        }
1620
1621        /// Sets the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
1622        ///
1623        /// This is a **required** field for requests.
1624        pub fn set_policy<T>(mut self, v: T) -> Self
1625        where
1626            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
1627        {
1628            self.0.request.policy = std::option::Option::Some(v.into());
1629            self
1630        }
1631
1632        /// Sets or clears the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
1633        ///
1634        /// This is a **required** field for requests.
1635        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
1636        where
1637            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
1638        {
1639            self.0.request.policy = v.map(|x| x.into());
1640            self
1641        }
1642
1643        /// Sets the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
1644        pub fn set_update_mask<T>(mut self, v: T) -> Self
1645        where
1646            T: std::convert::Into<wkt::FieldMask>,
1647        {
1648            self.0.request.update_mask = std::option::Option::Some(v.into());
1649            self
1650        }
1651
1652        /// Sets or clears the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
1653        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1654        where
1655            T: std::convert::Into<wkt::FieldMask>,
1656        {
1657            self.0.request.update_mask = v.map(|x| x.into());
1658            self
1659        }
1660    }
1661
1662    #[doc(hidden)]
1663    impl crate::RequestBuilder for SetIamPolicy {
1664        fn request_options(&mut self) -> &mut crate::RequestOptions {
1665            &mut self.0.options
1666        }
1667    }
1668
1669    /// The request builder for [Organizations::test_iam_permissions][crate::client::Organizations::test_iam_permissions] calls.
1670    ///
1671    /// # Example
1672    /// ```
1673    /// # use google_cloud_resourcemanager_v3::builder::organizations::TestIamPermissions;
1674    /// # async fn sample() -> google_cloud_resourcemanager_v3::Result<()> {
1675    ///
1676    /// let builder = prepare_request_builder();
1677    /// let response = builder.send().await?;
1678    /// # Ok(()) }
1679    ///
1680    /// fn prepare_request_builder() -> TestIamPermissions {
1681    ///   # panic!();
1682    ///   // ... details omitted ...
1683    /// }
1684    /// ```
1685    #[derive(Clone, Debug)]
1686    pub struct TestIamPermissions(
1687        RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
1688    );
1689
1690    impl TestIamPermissions {
1691        pub(crate) fn new(
1692            stub: std::sync::Arc<dyn super::super::stub::dynamic::Organizations>,
1693        ) -> Self {
1694            Self(RequestBuilder::new(stub))
1695        }
1696
1697        /// Sets the full request, replacing any prior values.
1698        pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
1699            mut self,
1700            v: V,
1701        ) -> Self {
1702            self.0.request = v.into();
1703            self
1704        }
1705
1706        /// Sets all the options, replacing any prior values.
1707        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1708            self.0.options = v.into();
1709            self
1710        }
1711
1712        /// Sends the request.
1713        pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
1714            (*self.0.stub)
1715                .test_iam_permissions(self.0.request, self.0.options)
1716                .await
1717                .map(crate::Response::into_body)
1718        }
1719
1720        /// Sets the value of [resource][google_cloud_iam_v1::model::TestIamPermissionsRequest::resource].
1721        ///
1722        /// This is a **required** field for requests.
1723        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1724            self.0.request.resource = v.into();
1725            self
1726        }
1727
1728        /// Sets the value of [permissions][google_cloud_iam_v1::model::TestIamPermissionsRequest::permissions].
1729        ///
1730        /// This is a **required** field for requests.
1731        pub fn set_permissions<T, V>(mut self, v: T) -> Self
1732        where
1733            T: std::iter::IntoIterator<Item = V>,
1734            V: std::convert::Into<std::string::String>,
1735        {
1736            use std::iter::Iterator;
1737            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
1738            self
1739        }
1740    }
1741
1742    #[doc(hidden)]
1743    impl crate::RequestBuilder for TestIamPermissions {
1744        fn request_options(&mut self) -> &mut crate::RequestOptions {
1745            &mut self.0.options
1746        }
1747    }
1748
1749    /// The request builder for [Organizations::get_operation][crate::client::Organizations::get_operation] calls.
1750    ///
1751    /// # Example
1752    /// ```
1753    /// # use google_cloud_resourcemanager_v3::builder::organizations::GetOperation;
1754    /// # async fn sample() -> google_cloud_resourcemanager_v3::Result<()> {
1755    ///
1756    /// let builder = prepare_request_builder();
1757    /// let response = builder.send().await?;
1758    /// # Ok(()) }
1759    ///
1760    /// fn prepare_request_builder() -> GetOperation {
1761    ///   # panic!();
1762    ///   // ... details omitted ...
1763    /// }
1764    /// ```
1765    #[derive(Clone, Debug)]
1766    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
1767
1768    impl GetOperation {
1769        pub(crate) fn new(
1770            stub: std::sync::Arc<dyn super::super::stub::dynamic::Organizations>,
1771        ) -> Self {
1772            Self(RequestBuilder::new(stub))
1773        }
1774
1775        /// Sets the full request, replacing any prior values.
1776        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
1777            mut self,
1778            v: V,
1779        ) -> Self {
1780            self.0.request = v.into();
1781            self
1782        }
1783
1784        /// Sets all the options, replacing any prior values.
1785        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1786            self.0.options = v.into();
1787            self
1788        }
1789
1790        /// Sends the request.
1791        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1792            (*self.0.stub)
1793                .get_operation(self.0.request, self.0.options)
1794                .await
1795                .map(crate::Response::into_body)
1796        }
1797
1798        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
1799        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1800            self.0.request.name = v.into();
1801            self
1802        }
1803    }
1804
1805    #[doc(hidden)]
1806    impl crate::RequestBuilder for GetOperation {
1807        fn request_options(&mut self) -> &mut crate::RequestOptions {
1808            &mut self.0.options
1809        }
1810    }
1811}
1812
1813pub mod projects {
1814    use crate::Result;
1815
1816    /// A builder for [Projects][crate::client::Projects].
1817    ///
1818    /// ```
1819    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1820    /// # use google_cloud_resourcemanager_v3::*;
1821    /// # use builder::projects::ClientBuilder;
1822    /// # use client::Projects;
1823    /// let builder : ClientBuilder = Projects::builder();
1824    /// let client = builder
1825    ///     .with_endpoint("https://cloudresourcemanager.googleapis.com")
1826    ///     .build().await?;
1827    /// # Ok(()) }
1828    /// ```
1829    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1830
1831    pub(crate) mod client {
1832        use super::super::super::client::Projects;
1833        pub struct Factory;
1834        impl crate::ClientFactory for Factory {
1835            type Client = Projects;
1836            type Credentials = gaxi::options::Credentials;
1837            async fn build(
1838                self,
1839                config: gaxi::options::ClientConfig,
1840            ) -> crate::ClientBuilderResult<Self::Client> {
1841                Self::Client::new(config).await
1842            }
1843        }
1844    }
1845
1846    /// Common implementation for [crate::client::Projects] request builders.
1847    #[derive(Clone, Debug)]
1848    pub(crate) struct RequestBuilder<R: std::default::Default> {
1849        stub: std::sync::Arc<dyn super::super::stub::dynamic::Projects>,
1850        request: R,
1851        options: crate::RequestOptions,
1852    }
1853
1854    impl<R> RequestBuilder<R>
1855    where
1856        R: std::default::Default,
1857    {
1858        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Projects>) -> Self {
1859            Self {
1860                stub,
1861                request: R::default(),
1862                options: crate::RequestOptions::default(),
1863            }
1864        }
1865    }
1866
1867    /// The request builder for [Projects::get_project][crate::client::Projects::get_project] calls.
1868    ///
1869    /// # Example
1870    /// ```
1871    /// # use google_cloud_resourcemanager_v3::builder::projects::GetProject;
1872    /// # async fn sample() -> google_cloud_resourcemanager_v3::Result<()> {
1873    ///
1874    /// let builder = prepare_request_builder();
1875    /// let response = builder.send().await?;
1876    /// # Ok(()) }
1877    ///
1878    /// fn prepare_request_builder() -> GetProject {
1879    ///   # panic!();
1880    ///   // ... details omitted ...
1881    /// }
1882    /// ```
1883    #[derive(Clone, Debug)]
1884    pub struct GetProject(RequestBuilder<crate::model::GetProjectRequest>);
1885
1886    impl GetProject {
1887        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Projects>) -> Self {
1888            Self(RequestBuilder::new(stub))
1889        }
1890
1891        /// Sets the full request, replacing any prior values.
1892        pub fn with_request<V: Into<crate::model::GetProjectRequest>>(mut self, v: V) -> Self {
1893            self.0.request = v.into();
1894            self
1895        }
1896
1897        /// Sets all the options, replacing any prior values.
1898        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1899            self.0.options = v.into();
1900            self
1901        }
1902
1903        /// Sends the request.
1904        pub async fn send(self) -> Result<crate::model::Project> {
1905            (*self.0.stub)
1906                .get_project(self.0.request, self.0.options)
1907                .await
1908                .map(crate::Response::into_body)
1909        }
1910
1911        /// Sets the value of [name][crate::model::GetProjectRequest::name].
1912        ///
1913        /// This is a **required** field for requests.
1914        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1915            self.0.request.name = v.into();
1916            self
1917        }
1918    }
1919
1920    #[doc(hidden)]
1921    impl crate::RequestBuilder for GetProject {
1922        fn request_options(&mut self) -> &mut crate::RequestOptions {
1923            &mut self.0.options
1924        }
1925    }
1926
1927    /// The request builder for [Projects::list_projects][crate::client::Projects::list_projects] calls.
1928    ///
1929    /// # Example
1930    /// ```
1931    /// # use google_cloud_resourcemanager_v3::builder::projects::ListProjects;
1932    /// # async fn sample() -> google_cloud_resourcemanager_v3::Result<()> {
1933    /// use google_cloud_gax::paginator::ItemPaginator;
1934    ///
1935    /// let builder = prepare_request_builder();
1936    /// let mut items = builder.by_item();
1937    /// while let Some(result) = items.next().await {
1938    ///   let item = result?;
1939    /// }
1940    /// # Ok(()) }
1941    ///
1942    /// fn prepare_request_builder() -> ListProjects {
1943    ///   # panic!();
1944    ///   // ... details omitted ...
1945    /// }
1946    /// ```
1947    #[derive(Clone, Debug)]
1948    pub struct ListProjects(RequestBuilder<crate::model::ListProjectsRequest>);
1949
1950    impl ListProjects {
1951        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Projects>) -> Self {
1952            Self(RequestBuilder::new(stub))
1953        }
1954
1955        /// Sets the full request, replacing any prior values.
1956        pub fn with_request<V: Into<crate::model::ListProjectsRequest>>(mut self, v: V) -> Self {
1957            self.0.request = v.into();
1958            self
1959        }
1960
1961        /// Sets all the options, replacing any prior values.
1962        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1963            self.0.options = v.into();
1964            self
1965        }
1966
1967        /// Sends the request.
1968        pub async fn send(self) -> Result<crate::model::ListProjectsResponse> {
1969            (*self.0.stub)
1970                .list_projects(self.0.request, self.0.options)
1971                .await
1972                .map(crate::Response::into_body)
1973        }
1974
1975        /// Streams each page in the collection.
1976        pub fn by_page(
1977            self,
1978        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListProjectsResponse, crate::Error>
1979        {
1980            use std::clone::Clone;
1981            let token = self.0.request.page_token.clone();
1982            let execute = move |token: String| {
1983                let mut builder = self.clone();
1984                builder.0.request = builder.0.request.set_page_token(token);
1985                builder.send()
1986            };
1987            google_cloud_gax::paginator::internal::new_paginator(token, execute)
1988        }
1989
1990        /// Streams each item in the collection.
1991        pub fn by_item(
1992            self,
1993        ) -> impl google_cloud_gax::paginator::ItemPaginator<
1994            crate::model::ListProjectsResponse,
1995            crate::Error,
1996        > {
1997            use google_cloud_gax::paginator::Paginator;
1998            self.by_page().items()
1999        }
2000
2001        /// Sets the value of [parent][crate::model::ListProjectsRequest::parent].
2002        ///
2003        /// This is a **required** field for requests.
2004        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2005            self.0.request.parent = v.into();
2006            self
2007        }
2008
2009        /// Sets the value of [page_token][crate::model::ListProjectsRequest::page_token].
2010        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2011            self.0.request.page_token = v.into();
2012            self
2013        }
2014
2015        /// Sets the value of [page_size][crate::model::ListProjectsRequest::page_size].
2016        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2017            self.0.request.page_size = v.into();
2018            self
2019        }
2020
2021        /// Sets the value of [show_deleted][crate::model::ListProjectsRequest::show_deleted].
2022        pub fn set_show_deleted<T: Into<bool>>(mut self, v: T) -> Self {
2023            self.0.request.show_deleted = v.into();
2024            self
2025        }
2026    }
2027
2028    #[doc(hidden)]
2029    impl crate::RequestBuilder for ListProjects {
2030        fn request_options(&mut self) -> &mut crate::RequestOptions {
2031            &mut self.0.options
2032        }
2033    }
2034
2035    /// The request builder for [Projects::search_projects][crate::client::Projects::search_projects] calls.
2036    ///
2037    /// # Example
2038    /// ```
2039    /// # use google_cloud_resourcemanager_v3::builder::projects::SearchProjects;
2040    /// # async fn sample() -> google_cloud_resourcemanager_v3::Result<()> {
2041    /// use google_cloud_gax::paginator::ItemPaginator;
2042    ///
2043    /// let builder = prepare_request_builder();
2044    /// let mut items = builder.by_item();
2045    /// while let Some(result) = items.next().await {
2046    ///   let item = result?;
2047    /// }
2048    /// # Ok(()) }
2049    ///
2050    /// fn prepare_request_builder() -> SearchProjects {
2051    ///   # panic!();
2052    ///   // ... details omitted ...
2053    /// }
2054    /// ```
2055    #[derive(Clone, Debug)]
2056    pub struct SearchProjects(RequestBuilder<crate::model::SearchProjectsRequest>);
2057
2058    impl SearchProjects {
2059        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Projects>) -> Self {
2060            Self(RequestBuilder::new(stub))
2061        }
2062
2063        /// Sets the full request, replacing any prior values.
2064        pub fn with_request<V: Into<crate::model::SearchProjectsRequest>>(mut self, v: V) -> Self {
2065            self.0.request = v.into();
2066            self
2067        }
2068
2069        /// Sets all the options, replacing any prior values.
2070        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2071            self.0.options = v.into();
2072            self
2073        }
2074
2075        /// Sends the request.
2076        pub async fn send(self) -> Result<crate::model::SearchProjectsResponse> {
2077            (*self.0.stub)
2078                .search_projects(self.0.request, self.0.options)
2079                .await
2080                .map(crate::Response::into_body)
2081        }
2082
2083        /// Streams each page in the collection.
2084        pub fn by_page(
2085            self,
2086        ) -> impl google_cloud_gax::paginator::Paginator<
2087            crate::model::SearchProjectsResponse,
2088            crate::Error,
2089        > {
2090            use std::clone::Clone;
2091            let token = self.0.request.page_token.clone();
2092            let execute = move |token: String| {
2093                let mut builder = self.clone();
2094                builder.0.request = builder.0.request.set_page_token(token);
2095                builder.send()
2096            };
2097            google_cloud_gax::paginator::internal::new_paginator(token, execute)
2098        }
2099
2100        /// Streams each item in the collection.
2101        pub fn by_item(
2102            self,
2103        ) -> impl google_cloud_gax::paginator::ItemPaginator<
2104            crate::model::SearchProjectsResponse,
2105            crate::Error,
2106        > {
2107            use google_cloud_gax::paginator::Paginator;
2108            self.by_page().items()
2109        }
2110
2111        /// Sets the value of [query][crate::model::SearchProjectsRequest::query].
2112        pub fn set_query<T: Into<std::string::String>>(mut self, v: T) -> Self {
2113            self.0.request.query = v.into();
2114            self
2115        }
2116
2117        /// Sets the value of [page_token][crate::model::SearchProjectsRequest::page_token].
2118        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2119            self.0.request.page_token = v.into();
2120            self
2121        }
2122
2123        /// Sets the value of [page_size][crate::model::SearchProjectsRequest::page_size].
2124        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2125            self.0.request.page_size = v.into();
2126            self
2127        }
2128    }
2129
2130    #[doc(hidden)]
2131    impl crate::RequestBuilder for SearchProjects {
2132        fn request_options(&mut self) -> &mut crate::RequestOptions {
2133            &mut self.0.options
2134        }
2135    }
2136
2137    /// The request builder for [Projects::create_project][crate::client::Projects::create_project] calls.
2138    ///
2139    /// # Example
2140    /// ```
2141    /// # use google_cloud_resourcemanager_v3::builder::projects::CreateProject;
2142    /// # async fn sample() -> google_cloud_resourcemanager_v3::Result<()> {
2143    /// use google_cloud_lro::Poller;
2144    ///
2145    /// let builder = prepare_request_builder();
2146    /// let response = builder.poller().until_done().await?;
2147    /// # Ok(()) }
2148    ///
2149    /// fn prepare_request_builder() -> CreateProject {
2150    ///   # panic!();
2151    ///   // ... details omitted ...
2152    /// }
2153    /// ```
2154    #[derive(Clone, Debug)]
2155    pub struct CreateProject(RequestBuilder<crate::model::CreateProjectRequest>);
2156
2157    impl CreateProject {
2158        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Projects>) -> Self {
2159            Self(RequestBuilder::new(stub))
2160        }
2161
2162        /// Sets the full request, replacing any prior values.
2163        pub fn with_request<V: Into<crate::model::CreateProjectRequest>>(mut self, v: V) -> Self {
2164            self.0.request = v.into();
2165            self
2166        }
2167
2168        /// Sets all the options, replacing any prior values.
2169        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2170            self.0.options = v.into();
2171            self
2172        }
2173
2174        /// Sends the request.
2175        ///
2176        /// # Long running operations
2177        ///
2178        /// This starts, but does not poll, a longrunning operation. More information
2179        /// on [create_project][crate::client::Projects::create_project].
2180        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2181            (*self.0.stub)
2182                .create_project(self.0.request, self.0.options)
2183                .await
2184                .map(crate::Response::into_body)
2185        }
2186
2187        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_project`.
2188        pub fn poller(
2189            self,
2190        ) -> impl google_cloud_lro::Poller<crate::model::Project, crate::model::CreateProjectMetadata>
2191        {
2192            type Operation = google_cloud_lro::internal::Operation<
2193                crate::model::Project,
2194                crate::model::CreateProjectMetadata,
2195            >;
2196            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2197            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2198
2199            let stub = self.0.stub.clone();
2200            let mut options = self.0.options.clone();
2201            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2202            let query = move |name| {
2203                let stub = stub.clone();
2204                let options = options.clone();
2205                async {
2206                    let op = GetOperation::new(stub)
2207                        .set_name(name)
2208                        .with_options(options)
2209                        .send()
2210                        .await?;
2211                    Ok(Operation::new(op))
2212                }
2213            };
2214
2215            let start = move || async {
2216                let op = self.send().await?;
2217                Ok(Operation::new(op))
2218            };
2219
2220            google_cloud_lro::internal::new_poller(
2221                polling_error_policy,
2222                polling_backoff_policy,
2223                start,
2224                query,
2225            )
2226        }
2227
2228        /// Sets the value of [project][crate::model::CreateProjectRequest::project].
2229        ///
2230        /// This is a **required** field for requests.
2231        pub fn set_project<T>(mut self, v: T) -> Self
2232        where
2233            T: std::convert::Into<crate::model::Project>,
2234        {
2235            self.0.request.project = std::option::Option::Some(v.into());
2236            self
2237        }
2238
2239        /// Sets or clears the value of [project][crate::model::CreateProjectRequest::project].
2240        ///
2241        /// This is a **required** field for requests.
2242        pub fn set_or_clear_project<T>(mut self, v: std::option::Option<T>) -> Self
2243        where
2244            T: std::convert::Into<crate::model::Project>,
2245        {
2246            self.0.request.project = v.map(|x| x.into());
2247            self
2248        }
2249    }
2250
2251    #[doc(hidden)]
2252    impl crate::RequestBuilder for CreateProject {
2253        fn request_options(&mut self) -> &mut crate::RequestOptions {
2254            &mut self.0.options
2255        }
2256    }
2257
2258    /// The request builder for [Projects::update_project][crate::client::Projects::update_project] calls.
2259    ///
2260    /// # Example
2261    /// ```
2262    /// # use google_cloud_resourcemanager_v3::builder::projects::UpdateProject;
2263    /// # async fn sample() -> google_cloud_resourcemanager_v3::Result<()> {
2264    /// use google_cloud_lro::Poller;
2265    ///
2266    /// let builder = prepare_request_builder();
2267    /// let response = builder.poller().until_done().await?;
2268    /// # Ok(()) }
2269    ///
2270    /// fn prepare_request_builder() -> UpdateProject {
2271    ///   # panic!();
2272    ///   // ... details omitted ...
2273    /// }
2274    /// ```
2275    #[derive(Clone, Debug)]
2276    pub struct UpdateProject(RequestBuilder<crate::model::UpdateProjectRequest>);
2277
2278    impl UpdateProject {
2279        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Projects>) -> Self {
2280            Self(RequestBuilder::new(stub))
2281        }
2282
2283        /// Sets the full request, replacing any prior values.
2284        pub fn with_request<V: Into<crate::model::UpdateProjectRequest>>(mut self, v: V) -> Self {
2285            self.0.request = v.into();
2286            self
2287        }
2288
2289        /// Sets all the options, replacing any prior values.
2290        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2291            self.0.options = v.into();
2292            self
2293        }
2294
2295        /// Sends the request.
2296        ///
2297        /// # Long running operations
2298        ///
2299        /// This starts, but does not poll, a longrunning operation. More information
2300        /// on [update_project][crate::client::Projects::update_project].
2301        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2302            (*self.0.stub)
2303                .update_project(self.0.request, self.0.options)
2304                .await
2305                .map(crate::Response::into_body)
2306        }
2307
2308        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_project`.
2309        pub fn poller(
2310            self,
2311        ) -> impl google_cloud_lro::Poller<crate::model::Project, crate::model::UpdateProjectMetadata>
2312        {
2313            type Operation = google_cloud_lro::internal::Operation<
2314                crate::model::Project,
2315                crate::model::UpdateProjectMetadata,
2316            >;
2317            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2318            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2319
2320            let stub = self.0.stub.clone();
2321            let mut options = self.0.options.clone();
2322            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2323            let query = move |name| {
2324                let stub = stub.clone();
2325                let options = options.clone();
2326                async {
2327                    let op = GetOperation::new(stub)
2328                        .set_name(name)
2329                        .with_options(options)
2330                        .send()
2331                        .await?;
2332                    Ok(Operation::new(op))
2333                }
2334            };
2335
2336            let start = move || async {
2337                let op = self.send().await?;
2338                Ok(Operation::new(op))
2339            };
2340
2341            google_cloud_lro::internal::new_poller(
2342                polling_error_policy,
2343                polling_backoff_policy,
2344                start,
2345                query,
2346            )
2347        }
2348
2349        /// Sets the value of [project][crate::model::UpdateProjectRequest::project].
2350        ///
2351        /// This is a **required** field for requests.
2352        pub fn set_project<T>(mut self, v: T) -> Self
2353        where
2354            T: std::convert::Into<crate::model::Project>,
2355        {
2356            self.0.request.project = std::option::Option::Some(v.into());
2357            self
2358        }
2359
2360        /// Sets or clears the value of [project][crate::model::UpdateProjectRequest::project].
2361        ///
2362        /// This is a **required** field for requests.
2363        pub fn set_or_clear_project<T>(mut self, v: std::option::Option<T>) -> Self
2364        where
2365            T: std::convert::Into<crate::model::Project>,
2366        {
2367            self.0.request.project = v.map(|x| x.into());
2368            self
2369        }
2370
2371        /// Sets the value of [update_mask][crate::model::UpdateProjectRequest::update_mask].
2372        pub fn set_update_mask<T>(mut self, v: T) -> Self
2373        where
2374            T: std::convert::Into<wkt::FieldMask>,
2375        {
2376            self.0.request.update_mask = std::option::Option::Some(v.into());
2377            self
2378        }
2379
2380        /// Sets or clears the value of [update_mask][crate::model::UpdateProjectRequest::update_mask].
2381        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2382        where
2383            T: std::convert::Into<wkt::FieldMask>,
2384        {
2385            self.0.request.update_mask = v.map(|x| x.into());
2386            self
2387        }
2388    }
2389
2390    #[doc(hidden)]
2391    impl crate::RequestBuilder for UpdateProject {
2392        fn request_options(&mut self) -> &mut crate::RequestOptions {
2393            &mut self.0.options
2394        }
2395    }
2396
2397    /// The request builder for [Projects::move_project][crate::client::Projects::move_project] calls.
2398    ///
2399    /// # Example
2400    /// ```
2401    /// # use google_cloud_resourcemanager_v3::builder::projects::MoveProject;
2402    /// # async fn sample() -> google_cloud_resourcemanager_v3::Result<()> {
2403    /// use google_cloud_lro::Poller;
2404    ///
2405    /// let builder = prepare_request_builder();
2406    /// let response = builder.poller().until_done().await?;
2407    /// # Ok(()) }
2408    ///
2409    /// fn prepare_request_builder() -> MoveProject {
2410    ///   # panic!();
2411    ///   // ... details omitted ...
2412    /// }
2413    /// ```
2414    #[derive(Clone, Debug)]
2415    pub struct MoveProject(RequestBuilder<crate::model::MoveProjectRequest>);
2416
2417    impl MoveProject {
2418        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Projects>) -> Self {
2419            Self(RequestBuilder::new(stub))
2420        }
2421
2422        /// Sets the full request, replacing any prior values.
2423        pub fn with_request<V: Into<crate::model::MoveProjectRequest>>(mut self, v: V) -> Self {
2424            self.0.request = v.into();
2425            self
2426        }
2427
2428        /// Sets all the options, replacing any prior values.
2429        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2430            self.0.options = v.into();
2431            self
2432        }
2433
2434        /// Sends the request.
2435        ///
2436        /// # Long running operations
2437        ///
2438        /// This starts, but does not poll, a longrunning operation. More information
2439        /// on [move_project][crate::client::Projects::move_project].
2440        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2441            (*self.0.stub)
2442                .move_project(self.0.request, self.0.options)
2443                .await
2444                .map(crate::Response::into_body)
2445        }
2446
2447        /// Creates a [Poller][google_cloud_lro::Poller] to work with `move_project`.
2448        pub fn poller(
2449            self,
2450        ) -> impl google_cloud_lro::Poller<crate::model::Project, crate::model::MoveProjectMetadata>
2451        {
2452            type Operation = google_cloud_lro::internal::Operation<
2453                crate::model::Project,
2454                crate::model::MoveProjectMetadata,
2455            >;
2456            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2457            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2458
2459            let stub = self.0.stub.clone();
2460            let mut options = self.0.options.clone();
2461            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2462            let query = move |name| {
2463                let stub = stub.clone();
2464                let options = options.clone();
2465                async {
2466                    let op = GetOperation::new(stub)
2467                        .set_name(name)
2468                        .with_options(options)
2469                        .send()
2470                        .await?;
2471                    Ok(Operation::new(op))
2472                }
2473            };
2474
2475            let start = move || async {
2476                let op = self.send().await?;
2477                Ok(Operation::new(op))
2478            };
2479
2480            google_cloud_lro::internal::new_poller(
2481                polling_error_policy,
2482                polling_backoff_policy,
2483                start,
2484                query,
2485            )
2486        }
2487
2488        /// Sets the value of [name][crate::model::MoveProjectRequest::name].
2489        ///
2490        /// This is a **required** field for requests.
2491        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2492            self.0.request.name = v.into();
2493            self
2494        }
2495
2496        /// Sets the value of [destination_parent][crate::model::MoveProjectRequest::destination_parent].
2497        ///
2498        /// This is a **required** field for requests.
2499        pub fn set_destination_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2500            self.0.request.destination_parent = v.into();
2501            self
2502        }
2503    }
2504
2505    #[doc(hidden)]
2506    impl crate::RequestBuilder for MoveProject {
2507        fn request_options(&mut self) -> &mut crate::RequestOptions {
2508            &mut self.0.options
2509        }
2510    }
2511
2512    /// The request builder for [Projects::delete_project][crate::client::Projects::delete_project] calls.
2513    ///
2514    /// # Example
2515    /// ```
2516    /// # use google_cloud_resourcemanager_v3::builder::projects::DeleteProject;
2517    /// # async fn sample() -> google_cloud_resourcemanager_v3::Result<()> {
2518    /// use google_cloud_lro::Poller;
2519    ///
2520    /// let builder = prepare_request_builder();
2521    /// let response = builder.poller().until_done().await?;
2522    /// # Ok(()) }
2523    ///
2524    /// fn prepare_request_builder() -> DeleteProject {
2525    ///   # panic!();
2526    ///   // ... details omitted ...
2527    /// }
2528    /// ```
2529    #[derive(Clone, Debug)]
2530    pub struct DeleteProject(RequestBuilder<crate::model::DeleteProjectRequest>);
2531
2532    impl DeleteProject {
2533        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Projects>) -> Self {
2534            Self(RequestBuilder::new(stub))
2535        }
2536
2537        /// Sets the full request, replacing any prior values.
2538        pub fn with_request<V: Into<crate::model::DeleteProjectRequest>>(mut self, v: V) -> Self {
2539            self.0.request = v.into();
2540            self
2541        }
2542
2543        /// Sets all the options, replacing any prior values.
2544        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2545            self.0.options = v.into();
2546            self
2547        }
2548
2549        /// Sends the request.
2550        ///
2551        /// # Long running operations
2552        ///
2553        /// This starts, but does not poll, a longrunning operation. More information
2554        /// on [delete_project][crate::client::Projects::delete_project].
2555        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2556            (*self.0.stub)
2557                .delete_project(self.0.request, self.0.options)
2558                .await
2559                .map(crate::Response::into_body)
2560        }
2561
2562        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_project`.
2563        pub fn poller(
2564            self,
2565        ) -> impl google_cloud_lro::Poller<crate::model::Project, crate::model::DeleteProjectMetadata>
2566        {
2567            type Operation = google_cloud_lro::internal::Operation<
2568                crate::model::Project,
2569                crate::model::DeleteProjectMetadata,
2570            >;
2571            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2572            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2573
2574            let stub = self.0.stub.clone();
2575            let mut options = self.0.options.clone();
2576            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2577            let query = move |name| {
2578                let stub = stub.clone();
2579                let options = options.clone();
2580                async {
2581                    let op = GetOperation::new(stub)
2582                        .set_name(name)
2583                        .with_options(options)
2584                        .send()
2585                        .await?;
2586                    Ok(Operation::new(op))
2587                }
2588            };
2589
2590            let start = move || async {
2591                let op = self.send().await?;
2592                Ok(Operation::new(op))
2593            };
2594
2595            google_cloud_lro::internal::new_poller(
2596                polling_error_policy,
2597                polling_backoff_policy,
2598                start,
2599                query,
2600            )
2601        }
2602
2603        /// Sets the value of [name][crate::model::DeleteProjectRequest::name].
2604        ///
2605        /// This is a **required** field for requests.
2606        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2607            self.0.request.name = v.into();
2608            self
2609        }
2610    }
2611
2612    #[doc(hidden)]
2613    impl crate::RequestBuilder for DeleteProject {
2614        fn request_options(&mut self) -> &mut crate::RequestOptions {
2615            &mut self.0.options
2616        }
2617    }
2618
2619    /// The request builder for [Projects::undelete_project][crate::client::Projects::undelete_project] calls.
2620    ///
2621    /// # Example
2622    /// ```
2623    /// # use google_cloud_resourcemanager_v3::builder::projects::UndeleteProject;
2624    /// # async fn sample() -> google_cloud_resourcemanager_v3::Result<()> {
2625    /// use google_cloud_lro::Poller;
2626    ///
2627    /// let builder = prepare_request_builder();
2628    /// let response = builder.poller().until_done().await?;
2629    /// # Ok(()) }
2630    ///
2631    /// fn prepare_request_builder() -> UndeleteProject {
2632    ///   # panic!();
2633    ///   // ... details omitted ...
2634    /// }
2635    /// ```
2636    #[derive(Clone, Debug)]
2637    pub struct UndeleteProject(RequestBuilder<crate::model::UndeleteProjectRequest>);
2638
2639    impl UndeleteProject {
2640        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Projects>) -> Self {
2641            Self(RequestBuilder::new(stub))
2642        }
2643
2644        /// Sets the full request, replacing any prior values.
2645        pub fn with_request<V: Into<crate::model::UndeleteProjectRequest>>(mut self, v: V) -> Self {
2646            self.0.request = v.into();
2647            self
2648        }
2649
2650        /// Sets all the options, replacing any prior values.
2651        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2652            self.0.options = v.into();
2653            self
2654        }
2655
2656        /// Sends the request.
2657        ///
2658        /// # Long running operations
2659        ///
2660        /// This starts, but does not poll, a longrunning operation. More information
2661        /// on [undelete_project][crate::client::Projects::undelete_project].
2662        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2663            (*self.0.stub)
2664                .undelete_project(self.0.request, self.0.options)
2665                .await
2666                .map(crate::Response::into_body)
2667        }
2668
2669        /// Creates a [Poller][google_cloud_lro::Poller] to work with `undelete_project`.
2670        pub fn poller(
2671            self,
2672        ) -> impl google_cloud_lro::Poller<crate::model::Project, crate::model::UndeleteProjectMetadata>
2673        {
2674            type Operation = google_cloud_lro::internal::Operation<
2675                crate::model::Project,
2676                crate::model::UndeleteProjectMetadata,
2677            >;
2678            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2679            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2680
2681            let stub = self.0.stub.clone();
2682            let mut options = self.0.options.clone();
2683            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2684            let query = move |name| {
2685                let stub = stub.clone();
2686                let options = options.clone();
2687                async {
2688                    let op = GetOperation::new(stub)
2689                        .set_name(name)
2690                        .with_options(options)
2691                        .send()
2692                        .await?;
2693                    Ok(Operation::new(op))
2694                }
2695            };
2696
2697            let start = move || async {
2698                let op = self.send().await?;
2699                Ok(Operation::new(op))
2700            };
2701
2702            google_cloud_lro::internal::new_poller(
2703                polling_error_policy,
2704                polling_backoff_policy,
2705                start,
2706                query,
2707            )
2708        }
2709
2710        /// Sets the value of [name][crate::model::UndeleteProjectRequest::name].
2711        ///
2712        /// This is a **required** field for requests.
2713        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2714            self.0.request.name = v.into();
2715            self
2716        }
2717    }
2718
2719    #[doc(hidden)]
2720    impl crate::RequestBuilder for UndeleteProject {
2721        fn request_options(&mut self) -> &mut crate::RequestOptions {
2722            &mut self.0.options
2723        }
2724    }
2725
2726    /// The request builder for [Projects::get_iam_policy][crate::client::Projects::get_iam_policy] calls.
2727    ///
2728    /// # Example
2729    /// ```
2730    /// # use google_cloud_resourcemanager_v3::builder::projects::GetIamPolicy;
2731    /// # async fn sample() -> google_cloud_resourcemanager_v3::Result<()> {
2732    ///
2733    /// let builder = prepare_request_builder();
2734    /// let response = builder.send().await?;
2735    /// # Ok(()) }
2736    ///
2737    /// fn prepare_request_builder() -> GetIamPolicy {
2738    ///   # panic!();
2739    ///   // ... details omitted ...
2740    /// }
2741    /// ```
2742    #[derive(Clone, Debug)]
2743    pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
2744
2745    impl GetIamPolicy {
2746        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Projects>) -> Self {
2747            Self(RequestBuilder::new(stub))
2748        }
2749
2750        /// Sets the full request, replacing any prior values.
2751        pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
2752            mut self,
2753            v: V,
2754        ) -> Self {
2755            self.0.request = v.into();
2756            self
2757        }
2758
2759        /// Sets all the options, replacing any prior values.
2760        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2761            self.0.options = v.into();
2762            self
2763        }
2764
2765        /// Sends the request.
2766        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
2767            (*self.0.stub)
2768                .get_iam_policy(self.0.request, self.0.options)
2769                .await
2770                .map(crate::Response::into_body)
2771        }
2772
2773        /// Sets the value of [resource][google_cloud_iam_v1::model::GetIamPolicyRequest::resource].
2774        ///
2775        /// This is a **required** field for requests.
2776        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2777            self.0.request.resource = v.into();
2778            self
2779        }
2780
2781        /// Sets the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
2782        pub fn set_options<T>(mut self, v: T) -> Self
2783        where
2784            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
2785        {
2786            self.0.request.options = std::option::Option::Some(v.into());
2787            self
2788        }
2789
2790        /// Sets or clears the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
2791        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
2792        where
2793            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
2794        {
2795            self.0.request.options = v.map(|x| x.into());
2796            self
2797        }
2798    }
2799
2800    #[doc(hidden)]
2801    impl crate::RequestBuilder for GetIamPolicy {
2802        fn request_options(&mut self) -> &mut crate::RequestOptions {
2803            &mut self.0.options
2804        }
2805    }
2806
2807    /// The request builder for [Projects::set_iam_policy][crate::client::Projects::set_iam_policy] calls.
2808    ///
2809    /// # Example
2810    /// ```
2811    /// # use google_cloud_resourcemanager_v3::builder::projects::SetIamPolicy;
2812    /// # async fn sample() -> google_cloud_resourcemanager_v3::Result<()> {
2813    ///
2814    /// let builder = prepare_request_builder();
2815    /// let response = builder.send().await?;
2816    /// # Ok(()) }
2817    ///
2818    /// fn prepare_request_builder() -> SetIamPolicy {
2819    ///   # panic!();
2820    ///   // ... details omitted ...
2821    /// }
2822    /// ```
2823    #[derive(Clone, Debug)]
2824    pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
2825
2826    impl SetIamPolicy {
2827        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Projects>) -> Self {
2828            Self(RequestBuilder::new(stub))
2829        }
2830
2831        /// Sets the full request, replacing any prior values.
2832        pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
2833            mut self,
2834            v: V,
2835        ) -> Self {
2836            self.0.request = v.into();
2837            self
2838        }
2839
2840        /// Sets all the options, replacing any prior values.
2841        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2842            self.0.options = v.into();
2843            self
2844        }
2845
2846        /// Sends the request.
2847        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
2848            (*self.0.stub)
2849                .set_iam_policy(self.0.request, self.0.options)
2850                .await
2851                .map(crate::Response::into_body)
2852        }
2853
2854        /// Sets the value of [resource][google_cloud_iam_v1::model::SetIamPolicyRequest::resource].
2855        ///
2856        /// This is a **required** field for requests.
2857        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2858            self.0.request.resource = v.into();
2859            self
2860        }
2861
2862        /// Sets the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
2863        ///
2864        /// This is a **required** field for requests.
2865        pub fn set_policy<T>(mut self, v: T) -> Self
2866        where
2867            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
2868        {
2869            self.0.request.policy = std::option::Option::Some(v.into());
2870            self
2871        }
2872
2873        /// Sets or clears the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
2874        ///
2875        /// This is a **required** field for requests.
2876        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
2877        where
2878            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
2879        {
2880            self.0.request.policy = v.map(|x| x.into());
2881            self
2882        }
2883
2884        /// Sets the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
2885        pub fn set_update_mask<T>(mut self, v: T) -> Self
2886        where
2887            T: std::convert::Into<wkt::FieldMask>,
2888        {
2889            self.0.request.update_mask = std::option::Option::Some(v.into());
2890            self
2891        }
2892
2893        /// Sets or clears the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
2894        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2895        where
2896            T: std::convert::Into<wkt::FieldMask>,
2897        {
2898            self.0.request.update_mask = v.map(|x| x.into());
2899            self
2900        }
2901    }
2902
2903    #[doc(hidden)]
2904    impl crate::RequestBuilder for SetIamPolicy {
2905        fn request_options(&mut self) -> &mut crate::RequestOptions {
2906            &mut self.0.options
2907        }
2908    }
2909
2910    /// The request builder for [Projects::test_iam_permissions][crate::client::Projects::test_iam_permissions] calls.
2911    ///
2912    /// # Example
2913    /// ```
2914    /// # use google_cloud_resourcemanager_v3::builder::projects::TestIamPermissions;
2915    /// # async fn sample() -> google_cloud_resourcemanager_v3::Result<()> {
2916    ///
2917    /// let builder = prepare_request_builder();
2918    /// let response = builder.send().await?;
2919    /// # Ok(()) }
2920    ///
2921    /// fn prepare_request_builder() -> TestIamPermissions {
2922    ///   # panic!();
2923    ///   // ... details omitted ...
2924    /// }
2925    /// ```
2926    #[derive(Clone, Debug)]
2927    pub struct TestIamPermissions(
2928        RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
2929    );
2930
2931    impl TestIamPermissions {
2932        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Projects>) -> Self {
2933            Self(RequestBuilder::new(stub))
2934        }
2935
2936        /// Sets the full request, replacing any prior values.
2937        pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
2938            mut self,
2939            v: V,
2940        ) -> Self {
2941            self.0.request = v.into();
2942            self
2943        }
2944
2945        /// Sets all the options, replacing any prior values.
2946        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2947            self.0.options = v.into();
2948            self
2949        }
2950
2951        /// Sends the request.
2952        pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
2953            (*self.0.stub)
2954                .test_iam_permissions(self.0.request, self.0.options)
2955                .await
2956                .map(crate::Response::into_body)
2957        }
2958
2959        /// Sets the value of [resource][google_cloud_iam_v1::model::TestIamPermissionsRequest::resource].
2960        ///
2961        /// This is a **required** field for requests.
2962        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2963            self.0.request.resource = v.into();
2964            self
2965        }
2966
2967        /// Sets the value of [permissions][google_cloud_iam_v1::model::TestIamPermissionsRequest::permissions].
2968        ///
2969        /// This is a **required** field for requests.
2970        pub fn set_permissions<T, V>(mut self, v: T) -> Self
2971        where
2972            T: std::iter::IntoIterator<Item = V>,
2973            V: std::convert::Into<std::string::String>,
2974        {
2975            use std::iter::Iterator;
2976            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
2977            self
2978        }
2979    }
2980
2981    #[doc(hidden)]
2982    impl crate::RequestBuilder for TestIamPermissions {
2983        fn request_options(&mut self) -> &mut crate::RequestOptions {
2984            &mut self.0.options
2985        }
2986    }
2987
2988    /// The request builder for [Projects::get_operation][crate::client::Projects::get_operation] calls.
2989    ///
2990    /// # Example
2991    /// ```
2992    /// # use google_cloud_resourcemanager_v3::builder::projects::GetOperation;
2993    /// # async fn sample() -> google_cloud_resourcemanager_v3::Result<()> {
2994    ///
2995    /// let builder = prepare_request_builder();
2996    /// let response = builder.send().await?;
2997    /// # Ok(()) }
2998    ///
2999    /// fn prepare_request_builder() -> GetOperation {
3000    ///   # panic!();
3001    ///   // ... details omitted ...
3002    /// }
3003    /// ```
3004    #[derive(Clone, Debug)]
3005    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
3006
3007    impl GetOperation {
3008        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Projects>) -> Self {
3009            Self(RequestBuilder::new(stub))
3010        }
3011
3012        /// Sets the full request, replacing any prior values.
3013        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
3014            mut self,
3015            v: V,
3016        ) -> Self {
3017            self.0.request = v.into();
3018            self
3019        }
3020
3021        /// Sets all the options, replacing any prior values.
3022        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3023            self.0.options = v.into();
3024            self
3025        }
3026
3027        /// Sends the request.
3028        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3029            (*self.0.stub)
3030                .get_operation(self.0.request, self.0.options)
3031                .await
3032                .map(crate::Response::into_body)
3033        }
3034
3035        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
3036        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3037            self.0.request.name = v.into();
3038            self
3039        }
3040    }
3041
3042    #[doc(hidden)]
3043    impl crate::RequestBuilder for GetOperation {
3044        fn request_options(&mut self) -> &mut crate::RequestOptions {
3045            &mut self.0.options
3046        }
3047    }
3048}
3049
3050pub mod tag_bindings {
3051    use crate::Result;
3052
3053    /// A builder for [TagBindings][crate::client::TagBindings].
3054    ///
3055    /// ```
3056    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
3057    /// # use google_cloud_resourcemanager_v3::*;
3058    /// # use builder::tag_bindings::ClientBuilder;
3059    /// # use client::TagBindings;
3060    /// let builder : ClientBuilder = TagBindings::builder();
3061    /// let client = builder
3062    ///     .with_endpoint("https://cloudresourcemanager.googleapis.com")
3063    ///     .build().await?;
3064    /// # Ok(()) }
3065    /// ```
3066    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
3067
3068    pub(crate) mod client {
3069        use super::super::super::client::TagBindings;
3070        pub struct Factory;
3071        impl crate::ClientFactory for Factory {
3072            type Client = TagBindings;
3073            type Credentials = gaxi::options::Credentials;
3074            async fn build(
3075                self,
3076                config: gaxi::options::ClientConfig,
3077            ) -> crate::ClientBuilderResult<Self::Client> {
3078                Self::Client::new(config).await
3079            }
3080        }
3081    }
3082
3083    /// Common implementation for [crate::client::TagBindings] request builders.
3084    #[derive(Clone, Debug)]
3085    pub(crate) struct RequestBuilder<R: std::default::Default> {
3086        stub: std::sync::Arc<dyn super::super::stub::dynamic::TagBindings>,
3087        request: R,
3088        options: crate::RequestOptions,
3089    }
3090
3091    impl<R> RequestBuilder<R>
3092    where
3093        R: std::default::Default,
3094    {
3095        pub(crate) fn new(
3096            stub: std::sync::Arc<dyn super::super::stub::dynamic::TagBindings>,
3097        ) -> Self {
3098            Self {
3099                stub,
3100                request: R::default(),
3101                options: crate::RequestOptions::default(),
3102            }
3103        }
3104    }
3105
3106    /// The request builder for [TagBindings::list_tag_bindings][crate::client::TagBindings::list_tag_bindings] calls.
3107    ///
3108    /// # Example
3109    /// ```
3110    /// # use google_cloud_resourcemanager_v3::builder::tag_bindings::ListTagBindings;
3111    /// # async fn sample() -> google_cloud_resourcemanager_v3::Result<()> {
3112    /// use google_cloud_gax::paginator::ItemPaginator;
3113    ///
3114    /// let builder = prepare_request_builder();
3115    /// let mut items = builder.by_item();
3116    /// while let Some(result) = items.next().await {
3117    ///   let item = result?;
3118    /// }
3119    /// # Ok(()) }
3120    ///
3121    /// fn prepare_request_builder() -> ListTagBindings {
3122    ///   # panic!();
3123    ///   // ... details omitted ...
3124    /// }
3125    /// ```
3126    #[derive(Clone, Debug)]
3127    pub struct ListTagBindings(RequestBuilder<crate::model::ListTagBindingsRequest>);
3128
3129    impl ListTagBindings {
3130        pub(crate) fn new(
3131            stub: std::sync::Arc<dyn super::super::stub::dynamic::TagBindings>,
3132        ) -> Self {
3133            Self(RequestBuilder::new(stub))
3134        }
3135
3136        /// Sets the full request, replacing any prior values.
3137        pub fn with_request<V: Into<crate::model::ListTagBindingsRequest>>(mut self, v: V) -> Self {
3138            self.0.request = v.into();
3139            self
3140        }
3141
3142        /// Sets all the options, replacing any prior values.
3143        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3144            self.0.options = v.into();
3145            self
3146        }
3147
3148        /// Sends the request.
3149        pub async fn send(self) -> Result<crate::model::ListTagBindingsResponse> {
3150            (*self.0.stub)
3151                .list_tag_bindings(self.0.request, self.0.options)
3152                .await
3153                .map(crate::Response::into_body)
3154        }
3155
3156        /// Streams each page in the collection.
3157        pub fn by_page(
3158            self,
3159        ) -> impl google_cloud_gax::paginator::Paginator<
3160            crate::model::ListTagBindingsResponse,
3161            crate::Error,
3162        > {
3163            use std::clone::Clone;
3164            let token = self.0.request.page_token.clone();
3165            let execute = move |token: String| {
3166                let mut builder = self.clone();
3167                builder.0.request = builder.0.request.set_page_token(token);
3168                builder.send()
3169            };
3170            google_cloud_gax::paginator::internal::new_paginator(token, execute)
3171        }
3172
3173        /// Streams each item in the collection.
3174        pub fn by_item(
3175            self,
3176        ) -> impl google_cloud_gax::paginator::ItemPaginator<
3177            crate::model::ListTagBindingsResponse,
3178            crate::Error,
3179        > {
3180            use google_cloud_gax::paginator::Paginator;
3181            self.by_page().items()
3182        }
3183
3184        /// Sets the value of [parent][crate::model::ListTagBindingsRequest::parent].
3185        ///
3186        /// This is a **required** field for requests.
3187        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3188            self.0.request.parent = v.into();
3189            self
3190        }
3191
3192        /// Sets the value of [page_size][crate::model::ListTagBindingsRequest::page_size].
3193        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3194            self.0.request.page_size = v.into();
3195            self
3196        }
3197
3198        /// Sets the value of [page_token][crate::model::ListTagBindingsRequest::page_token].
3199        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3200            self.0.request.page_token = v.into();
3201            self
3202        }
3203    }
3204
3205    #[doc(hidden)]
3206    impl crate::RequestBuilder for ListTagBindings {
3207        fn request_options(&mut self) -> &mut crate::RequestOptions {
3208            &mut self.0.options
3209        }
3210    }
3211
3212    /// The request builder for [TagBindings::create_tag_binding][crate::client::TagBindings::create_tag_binding] calls.
3213    ///
3214    /// # Example
3215    /// ```
3216    /// # use google_cloud_resourcemanager_v3::builder::tag_bindings::CreateTagBinding;
3217    /// # async fn sample() -> google_cloud_resourcemanager_v3::Result<()> {
3218    /// use google_cloud_lro::Poller;
3219    ///
3220    /// let builder = prepare_request_builder();
3221    /// let response = builder.poller().until_done().await?;
3222    /// # Ok(()) }
3223    ///
3224    /// fn prepare_request_builder() -> CreateTagBinding {
3225    ///   # panic!();
3226    ///   // ... details omitted ...
3227    /// }
3228    /// ```
3229    #[derive(Clone, Debug)]
3230    pub struct CreateTagBinding(RequestBuilder<crate::model::CreateTagBindingRequest>);
3231
3232    impl CreateTagBinding {
3233        pub(crate) fn new(
3234            stub: std::sync::Arc<dyn super::super::stub::dynamic::TagBindings>,
3235        ) -> Self {
3236            Self(RequestBuilder::new(stub))
3237        }
3238
3239        /// Sets the full request, replacing any prior values.
3240        pub fn with_request<V: Into<crate::model::CreateTagBindingRequest>>(
3241            mut self,
3242            v: V,
3243        ) -> Self {
3244            self.0.request = v.into();
3245            self
3246        }
3247
3248        /// Sets all the options, replacing any prior values.
3249        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3250            self.0.options = v.into();
3251            self
3252        }
3253
3254        /// Sends the request.
3255        ///
3256        /// # Long running operations
3257        ///
3258        /// This starts, but does not poll, a longrunning operation. More information
3259        /// on [create_tag_binding][crate::client::TagBindings::create_tag_binding].
3260        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3261            (*self.0.stub)
3262                .create_tag_binding(self.0.request, self.0.options)
3263                .await
3264                .map(crate::Response::into_body)
3265        }
3266
3267        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_tag_binding`.
3268        pub fn poller(
3269            self,
3270        ) -> impl google_cloud_lro::Poller<
3271            crate::model::TagBinding,
3272            crate::model::CreateTagBindingMetadata,
3273        > {
3274            type Operation = google_cloud_lro::internal::Operation<
3275                crate::model::TagBinding,
3276                crate::model::CreateTagBindingMetadata,
3277            >;
3278            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3279            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3280
3281            let stub = self.0.stub.clone();
3282            let mut options = self.0.options.clone();
3283            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3284            let query = move |name| {
3285                let stub = stub.clone();
3286                let options = options.clone();
3287                async {
3288                    let op = GetOperation::new(stub)
3289                        .set_name(name)
3290                        .with_options(options)
3291                        .send()
3292                        .await?;
3293                    Ok(Operation::new(op))
3294                }
3295            };
3296
3297            let start = move || async {
3298                let op = self.send().await?;
3299                Ok(Operation::new(op))
3300            };
3301
3302            google_cloud_lro::internal::new_poller(
3303                polling_error_policy,
3304                polling_backoff_policy,
3305                start,
3306                query,
3307            )
3308        }
3309
3310        /// Sets the value of [tag_binding][crate::model::CreateTagBindingRequest::tag_binding].
3311        ///
3312        /// This is a **required** field for requests.
3313        pub fn set_tag_binding<T>(mut self, v: T) -> Self
3314        where
3315            T: std::convert::Into<crate::model::TagBinding>,
3316        {
3317            self.0.request.tag_binding = std::option::Option::Some(v.into());
3318            self
3319        }
3320
3321        /// Sets or clears the value of [tag_binding][crate::model::CreateTagBindingRequest::tag_binding].
3322        ///
3323        /// This is a **required** field for requests.
3324        pub fn set_or_clear_tag_binding<T>(mut self, v: std::option::Option<T>) -> Self
3325        where
3326            T: std::convert::Into<crate::model::TagBinding>,
3327        {
3328            self.0.request.tag_binding = v.map(|x| x.into());
3329            self
3330        }
3331
3332        /// Sets the value of [validate_only][crate::model::CreateTagBindingRequest::validate_only].
3333        pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
3334            self.0.request.validate_only = v.into();
3335            self
3336        }
3337    }
3338
3339    #[doc(hidden)]
3340    impl crate::RequestBuilder for CreateTagBinding {
3341        fn request_options(&mut self) -> &mut crate::RequestOptions {
3342            &mut self.0.options
3343        }
3344    }
3345
3346    /// The request builder for [TagBindings::delete_tag_binding][crate::client::TagBindings::delete_tag_binding] calls.
3347    ///
3348    /// # Example
3349    /// ```
3350    /// # use google_cloud_resourcemanager_v3::builder::tag_bindings::DeleteTagBinding;
3351    /// # async fn sample() -> google_cloud_resourcemanager_v3::Result<()> {
3352    /// use google_cloud_lro::Poller;
3353    ///
3354    /// let builder = prepare_request_builder();
3355    /// let response = builder.poller().until_done().await?;
3356    /// # Ok(()) }
3357    ///
3358    /// fn prepare_request_builder() -> DeleteTagBinding {
3359    ///   # panic!();
3360    ///   // ... details omitted ...
3361    /// }
3362    /// ```
3363    #[derive(Clone, Debug)]
3364    pub struct DeleteTagBinding(RequestBuilder<crate::model::DeleteTagBindingRequest>);
3365
3366    impl DeleteTagBinding {
3367        pub(crate) fn new(
3368            stub: std::sync::Arc<dyn super::super::stub::dynamic::TagBindings>,
3369        ) -> Self {
3370            Self(RequestBuilder::new(stub))
3371        }
3372
3373        /// Sets the full request, replacing any prior values.
3374        pub fn with_request<V: Into<crate::model::DeleteTagBindingRequest>>(
3375            mut self,
3376            v: V,
3377        ) -> Self {
3378            self.0.request = v.into();
3379            self
3380        }
3381
3382        /// Sets all the options, replacing any prior values.
3383        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3384            self.0.options = v.into();
3385            self
3386        }
3387
3388        /// Sends the request.
3389        ///
3390        /// # Long running operations
3391        ///
3392        /// This starts, but does not poll, a longrunning operation. More information
3393        /// on [delete_tag_binding][crate::client::TagBindings::delete_tag_binding].
3394        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3395            (*self.0.stub)
3396                .delete_tag_binding(self.0.request, self.0.options)
3397                .await
3398                .map(crate::Response::into_body)
3399        }
3400
3401        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_tag_binding`.
3402        pub fn poller(
3403            self,
3404        ) -> impl google_cloud_lro::Poller<(), crate::model::DeleteTagBindingMetadata> {
3405            type Operation = google_cloud_lro::internal::Operation<
3406                wkt::Empty,
3407                crate::model::DeleteTagBindingMetadata,
3408            >;
3409            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3410            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3411
3412            let stub = self.0.stub.clone();
3413            let mut options = self.0.options.clone();
3414            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3415            let query = move |name| {
3416                let stub = stub.clone();
3417                let options = options.clone();
3418                async {
3419                    let op = GetOperation::new(stub)
3420                        .set_name(name)
3421                        .with_options(options)
3422                        .send()
3423                        .await?;
3424                    Ok(Operation::new(op))
3425                }
3426            };
3427
3428            let start = move || async {
3429                let op = self.send().await?;
3430                Ok(Operation::new(op))
3431            };
3432
3433            google_cloud_lro::internal::new_unit_response_poller(
3434                polling_error_policy,
3435                polling_backoff_policy,
3436                start,
3437                query,
3438            )
3439        }
3440
3441        /// Sets the value of [name][crate::model::DeleteTagBindingRequest::name].
3442        ///
3443        /// This is a **required** field for requests.
3444        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3445            self.0.request.name = v.into();
3446            self
3447        }
3448    }
3449
3450    #[doc(hidden)]
3451    impl crate::RequestBuilder for DeleteTagBinding {
3452        fn request_options(&mut self) -> &mut crate::RequestOptions {
3453            &mut self.0.options
3454        }
3455    }
3456
3457    /// The request builder for [TagBindings::list_effective_tags][crate::client::TagBindings::list_effective_tags] calls.
3458    ///
3459    /// # Example
3460    /// ```
3461    /// # use google_cloud_resourcemanager_v3::builder::tag_bindings::ListEffectiveTags;
3462    /// # async fn sample() -> google_cloud_resourcemanager_v3::Result<()> {
3463    /// use google_cloud_gax::paginator::ItemPaginator;
3464    ///
3465    /// let builder = prepare_request_builder();
3466    /// let mut items = builder.by_item();
3467    /// while let Some(result) = items.next().await {
3468    ///   let item = result?;
3469    /// }
3470    /// # Ok(()) }
3471    ///
3472    /// fn prepare_request_builder() -> ListEffectiveTags {
3473    ///   # panic!();
3474    ///   // ... details omitted ...
3475    /// }
3476    /// ```
3477    #[derive(Clone, Debug)]
3478    pub struct ListEffectiveTags(RequestBuilder<crate::model::ListEffectiveTagsRequest>);
3479
3480    impl ListEffectiveTags {
3481        pub(crate) fn new(
3482            stub: std::sync::Arc<dyn super::super::stub::dynamic::TagBindings>,
3483        ) -> Self {
3484            Self(RequestBuilder::new(stub))
3485        }
3486
3487        /// Sets the full request, replacing any prior values.
3488        pub fn with_request<V: Into<crate::model::ListEffectiveTagsRequest>>(
3489            mut self,
3490            v: V,
3491        ) -> Self {
3492            self.0.request = v.into();
3493            self
3494        }
3495
3496        /// Sets all the options, replacing any prior values.
3497        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3498            self.0.options = v.into();
3499            self
3500        }
3501
3502        /// Sends the request.
3503        pub async fn send(self) -> Result<crate::model::ListEffectiveTagsResponse> {
3504            (*self.0.stub)
3505                .list_effective_tags(self.0.request, self.0.options)
3506                .await
3507                .map(crate::Response::into_body)
3508        }
3509
3510        /// Streams each page in the collection.
3511        pub fn by_page(
3512            self,
3513        ) -> impl google_cloud_gax::paginator::Paginator<
3514            crate::model::ListEffectiveTagsResponse,
3515            crate::Error,
3516        > {
3517            use std::clone::Clone;
3518            let token = self.0.request.page_token.clone();
3519            let execute = move |token: String| {
3520                let mut builder = self.clone();
3521                builder.0.request = builder.0.request.set_page_token(token);
3522                builder.send()
3523            };
3524            google_cloud_gax::paginator::internal::new_paginator(token, execute)
3525        }
3526
3527        /// Streams each item in the collection.
3528        pub fn by_item(
3529            self,
3530        ) -> impl google_cloud_gax::paginator::ItemPaginator<
3531            crate::model::ListEffectiveTagsResponse,
3532            crate::Error,
3533        > {
3534            use google_cloud_gax::paginator::Paginator;
3535            self.by_page().items()
3536        }
3537
3538        /// Sets the value of [parent][crate::model::ListEffectiveTagsRequest::parent].
3539        ///
3540        /// This is a **required** field for requests.
3541        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3542            self.0.request.parent = v.into();
3543            self
3544        }
3545
3546        /// Sets the value of [page_size][crate::model::ListEffectiveTagsRequest::page_size].
3547        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3548            self.0.request.page_size = v.into();
3549            self
3550        }
3551
3552        /// Sets the value of [page_token][crate::model::ListEffectiveTagsRequest::page_token].
3553        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3554            self.0.request.page_token = v.into();
3555            self
3556        }
3557    }
3558
3559    #[doc(hidden)]
3560    impl crate::RequestBuilder for ListEffectiveTags {
3561        fn request_options(&mut self) -> &mut crate::RequestOptions {
3562            &mut self.0.options
3563        }
3564    }
3565
3566    /// The request builder for [TagBindings::get_operation][crate::client::TagBindings::get_operation] calls.
3567    ///
3568    /// # Example
3569    /// ```
3570    /// # use google_cloud_resourcemanager_v3::builder::tag_bindings::GetOperation;
3571    /// # async fn sample() -> google_cloud_resourcemanager_v3::Result<()> {
3572    ///
3573    /// let builder = prepare_request_builder();
3574    /// let response = builder.send().await?;
3575    /// # Ok(()) }
3576    ///
3577    /// fn prepare_request_builder() -> GetOperation {
3578    ///   # panic!();
3579    ///   // ... details omitted ...
3580    /// }
3581    /// ```
3582    #[derive(Clone, Debug)]
3583    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
3584
3585    impl GetOperation {
3586        pub(crate) fn new(
3587            stub: std::sync::Arc<dyn super::super::stub::dynamic::TagBindings>,
3588        ) -> Self {
3589            Self(RequestBuilder::new(stub))
3590        }
3591
3592        /// Sets the full request, replacing any prior values.
3593        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
3594            mut self,
3595            v: V,
3596        ) -> Self {
3597            self.0.request = v.into();
3598            self
3599        }
3600
3601        /// Sets all the options, replacing any prior values.
3602        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3603            self.0.options = v.into();
3604            self
3605        }
3606
3607        /// Sends the request.
3608        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3609            (*self.0.stub)
3610                .get_operation(self.0.request, self.0.options)
3611                .await
3612                .map(crate::Response::into_body)
3613        }
3614
3615        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
3616        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3617            self.0.request.name = v.into();
3618            self
3619        }
3620    }
3621
3622    #[doc(hidden)]
3623    impl crate::RequestBuilder for GetOperation {
3624        fn request_options(&mut self) -> &mut crate::RequestOptions {
3625            &mut self.0.options
3626        }
3627    }
3628}
3629
3630pub mod tag_holds {
3631    use crate::Result;
3632
3633    /// A builder for [TagHolds][crate::client::TagHolds].
3634    ///
3635    /// ```
3636    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
3637    /// # use google_cloud_resourcemanager_v3::*;
3638    /// # use builder::tag_holds::ClientBuilder;
3639    /// # use client::TagHolds;
3640    /// let builder : ClientBuilder = TagHolds::builder();
3641    /// let client = builder
3642    ///     .with_endpoint("https://cloudresourcemanager.googleapis.com")
3643    ///     .build().await?;
3644    /// # Ok(()) }
3645    /// ```
3646    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
3647
3648    pub(crate) mod client {
3649        use super::super::super::client::TagHolds;
3650        pub struct Factory;
3651        impl crate::ClientFactory for Factory {
3652            type Client = TagHolds;
3653            type Credentials = gaxi::options::Credentials;
3654            async fn build(
3655                self,
3656                config: gaxi::options::ClientConfig,
3657            ) -> crate::ClientBuilderResult<Self::Client> {
3658                Self::Client::new(config).await
3659            }
3660        }
3661    }
3662
3663    /// Common implementation for [crate::client::TagHolds] request builders.
3664    #[derive(Clone, Debug)]
3665    pub(crate) struct RequestBuilder<R: std::default::Default> {
3666        stub: std::sync::Arc<dyn super::super::stub::dynamic::TagHolds>,
3667        request: R,
3668        options: crate::RequestOptions,
3669    }
3670
3671    impl<R> RequestBuilder<R>
3672    where
3673        R: std::default::Default,
3674    {
3675        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::TagHolds>) -> Self {
3676            Self {
3677                stub,
3678                request: R::default(),
3679                options: crate::RequestOptions::default(),
3680            }
3681        }
3682    }
3683
3684    /// The request builder for [TagHolds::create_tag_hold][crate::client::TagHolds::create_tag_hold] calls.
3685    ///
3686    /// # Example
3687    /// ```
3688    /// # use google_cloud_resourcemanager_v3::builder::tag_holds::CreateTagHold;
3689    /// # async fn sample() -> google_cloud_resourcemanager_v3::Result<()> {
3690    /// use google_cloud_lro::Poller;
3691    ///
3692    /// let builder = prepare_request_builder();
3693    /// let response = builder.poller().until_done().await?;
3694    /// # Ok(()) }
3695    ///
3696    /// fn prepare_request_builder() -> CreateTagHold {
3697    ///   # panic!();
3698    ///   // ... details omitted ...
3699    /// }
3700    /// ```
3701    #[derive(Clone, Debug)]
3702    pub struct CreateTagHold(RequestBuilder<crate::model::CreateTagHoldRequest>);
3703
3704    impl CreateTagHold {
3705        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::TagHolds>) -> Self {
3706            Self(RequestBuilder::new(stub))
3707        }
3708
3709        /// Sets the full request, replacing any prior values.
3710        pub fn with_request<V: Into<crate::model::CreateTagHoldRequest>>(mut self, v: V) -> Self {
3711            self.0.request = v.into();
3712            self
3713        }
3714
3715        /// Sets all the options, replacing any prior values.
3716        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3717            self.0.options = v.into();
3718            self
3719        }
3720
3721        /// Sends the request.
3722        ///
3723        /// # Long running operations
3724        ///
3725        /// This starts, but does not poll, a longrunning operation. More information
3726        /// on [create_tag_hold][crate::client::TagHolds::create_tag_hold].
3727        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3728            (*self.0.stub)
3729                .create_tag_hold(self.0.request, self.0.options)
3730                .await
3731                .map(crate::Response::into_body)
3732        }
3733
3734        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_tag_hold`.
3735        pub fn poller(
3736            self,
3737        ) -> impl google_cloud_lro::Poller<crate::model::TagHold, crate::model::CreateTagHoldMetadata>
3738        {
3739            type Operation = google_cloud_lro::internal::Operation<
3740                crate::model::TagHold,
3741                crate::model::CreateTagHoldMetadata,
3742            >;
3743            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3744            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3745
3746            let stub = self.0.stub.clone();
3747            let mut options = self.0.options.clone();
3748            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3749            let query = move |name| {
3750                let stub = stub.clone();
3751                let options = options.clone();
3752                async {
3753                    let op = GetOperation::new(stub)
3754                        .set_name(name)
3755                        .with_options(options)
3756                        .send()
3757                        .await?;
3758                    Ok(Operation::new(op))
3759                }
3760            };
3761
3762            let start = move || async {
3763                let op = self.send().await?;
3764                Ok(Operation::new(op))
3765            };
3766
3767            google_cloud_lro::internal::new_poller(
3768                polling_error_policy,
3769                polling_backoff_policy,
3770                start,
3771                query,
3772            )
3773        }
3774
3775        /// Sets the value of [parent][crate::model::CreateTagHoldRequest::parent].
3776        ///
3777        /// This is a **required** field for requests.
3778        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3779            self.0.request.parent = v.into();
3780            self
3781        }
3782
3783        /// Sets the value of [tag_hold][crate::model::CreateTagHoldRequest::tag_hold].
3784        ///
3785        /// This is a **required** field for requests.
3786        pub fn set_tag_hold<T>(mut self, v: T) -> Self
3787        where
3788            T: std::convert::Into<crate::model::TagHold>,
3789        {
3790            self.0.request.tag_hold = std::option::Option::Some(v.into());
3791            self
3792        }
3793
3794        /// Sets or clears the value of [tag_hold][crate::model::CreateTagHoldRequest::tag_hold].
3795        ///
3796        /// This is a **required** field for requests.
3797        pub fn set_or_clear_tag_hold<T>(mut self, v: std::option::Option<T>) -> Self
3798        where
3799            T: std::convert::Into<crate::model::TagHold>,
3800        {
3801            self.0.request.tag_hold = v.map(|x| x.into());
3802            self
3803        }
3804
3805        /// Sets the value of [validate_only][crate::model::CreateTagHoldRequest::validate_only].
3806        pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
3807            self.0.request.validate_only = v.into();
3808            self
3809        }
3810    }
3811
3812    #[doc(hidden)]
3813    impl crate::RequestBuilder for CreateTagHold {
3814        fn request_options(&mut self) -> &mut crate::RequestOptions {
3815            &mut self.0.options
3816        }
3817    }
3818
3819    /// The request builder for [TagHolds::delete_tag_hold][crate::client::TagHolds::delete_tag_hold] calls.
3820    ///
3821    /// # Example
3822    /// ```
3823    /// # use google_cloud_resourcemanager_v3::builder::tag_holds::DeleteTagHold;
3824    /// # async fn sample() -> google_cloud_resourcemanager_v3::Result<()> {
3825    /// use google_cloud_lro::Poller;
3826    ///
3827    /// let builder = prepare_request_builder();
3828    /// let response = builder.poller().until_done().await?;
3829    /// # Ok(()) }
3830    ///
3831    /// fn prepare_request_builder() -> DeleteTagHold {
3832    ///   # panic!();
3833    ///   // ... details omitted ...
3834    /// }
3835    /// ```
3836    #[derive(Clone, Debug)]
3837    pub struct DeleteTagHold(RequestBuilder<crate::model::DeleteTagHoldRequest>);
3838
3839    impl DeleteTagHold {
3840        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::TagHolds>) -> Self {
3841            Self(RequestBuilder::new(stub))
3842        }
3843
3844        /// Sets the full request, replacing any prior values.
3845        pub fn with_request<V: Into<crate::model::DeleteTagHoldRequest>>(mut self, v: V) -> Self {
3846            self.0.request = v.into();
3847            self
3848        }
3849
3850        /// Sets all the options, replacing any prior values.
3851        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3852            self.0.options = v.into();
3853            self
3854        }
3855
3856        /// Sends the request.
3857        ///
3858        /// # Long running operations
3859        ///
3860        /// This starts, but does not poll, a longrunning operation. More information
3861        /// on [delete_tag_hold][crate::client::TagHolds::delete_tag_hold].
3862        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3863            (*self.0.stub)
3864                .delete_tag_hold(self.0.request, self.0.options)
3865                .await
3866                .map(crate::Response::into_body)
3867        }
3868
3869        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_tag_hold`.
3870        pub fn poller(
3871            self,
3872        ) -> impl google_cloud_lro::Poller<(), crate::model::DeleteTagHoldMetadata> {
3873            type Operation = google_cloud_lro::internal::Operation<
3874                wkt::Empty,
3875                crate::model::DeleteTagHoldMetadata,
3876            >;
3877            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3878            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3879
3880            let stub = self.0.stub.clone();
3881            let mut options = self.0.options.clone();
3882            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3883            let query = move |name| {
3884                let stub = stub.clone();
3885                let options = options.clone();
3886                async {
3887                    let op = GetOperation::new(stub)
3888                        .set_name(name)
3889                        .with_options(options)
3890                        .send()
3891                        .await?;
3892                    Ok(Operation::new(op))
3893                }
3894            };
3895
3896            let start = move || async {
3897                let op = self.send().await?;
3898                Ok(Operation::new(op))
3899            };
3900
3901            google_cloud_lro::internal::new_unit_response_poller(
3902                polling_error_policy,
3903                polling_backoff_policy,
3904                start,
3905                query,
3906            )
3907        }
3908
3909        /// Sets the value of [name][crate::model::DeleteTagHoldRequest::name].
3910        ///
3911        /// This is a **required** field for requests.
3912        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3913            self.0.request.name = v.into();
3914            self
3915        }
3916
3917        /// Sets the value of [validate_only][crate::model::DeleteTagHoldRequest::validate_only].
3918        pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
3919            self.0.request.validate_only = v.into();
3920            self
3921        }
3922    }
3923
3924    #[doc(hidden)]
3925    impl crate::RequestBuilder for DeleteTagHold {
3926        fn request_options(&mut self) -> &mut crate::RequestOptions {
3927            &mut self.0.options
3928        }
3929    }
3930
3931    /// The request builder for [TagHolds::list_tag_holds][crate::client::TagHolds::list_tag_holds] calls.
3932    ///
3933    /// # Example
3934    /// ```
3935    /// # use google_cloud_resourcemanager_v3::builder::tag_holds::ListTagHolds;
3936    /// # async fn sample() -> google_cloud_resourcemanager_v3::Result<()> {
3937    /// use google_cloud_gax::paginator::ItemPaginator;
3938    ///
3939    /// let builder = prepare_request_builder();
3940    /// let mut items = builder.by_item();
3941    /// while let Some(result) = items.next().await {
3942    ///   let item = result?;
3943    /// }
3944    /// # Ok(()) }
3945    ///
3946    /// fn prepare_request_builder() -> ListTagHolds {
3947    ///   # panic!();
3948    ///   // ... details omitted ...
3949    /// }
3950    /// ```
3951    #[derive(Clone, Debug)]
3952    pub struct ListTagHolds(RequestBuilder<crate::model::ListTagHoldsRequest>);
3953
3954    impl ListTagHolds {
3955        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::TagHolds>) -> Self {
3956            Self(RequestBuilder::new(stub))
3957        }
3958
3959        /// Sets the full request, replacing any prior values.
3960        pub fn with_request<V: Into<crate::model::ListTagHoldsRequest>>(mut self, v: V) -> Self {
3961            self.0.request = v.into();
3962            self
3963        }
3964
3965        /// Sets all the options, replacing any prior values.
3966        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3967            self.0.options = v.into();
3968            self
3969        }
3970
3971        /// Sends the request.
3972        pub async fn send(self) -> Result<crate::model::ListTagHoldsResponse> {
3973            (*self.0.stub)
3974                .list_tag_holds(self.0.request, self.0.options)
3975                .await
3976                .map(crate::Response::into_body)
3977        }
3978
3979        /// Streams each page in the collection.
3980        pub fn by_page(
3981            self,
3982        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListTagHoldsResponse, crate::Error>
3983        {
3984            use std::clone::Clone;
3985            let token = self.0.request.page_token.clone();
3986            let execute = move |token: String| {
3987                let mut builder = self.clone();
3988                builder.0.request = builder.0.request.set_page_token(token);
3989                builder.send()
3990            };
3991            google_cloud_gax::paginator::internal::new_paginator(token, execute)
3992        }
3993
3994        /// Streams each item in the collection.
3995        pub fn by_item(
3996            self,
3997        ) -> impl google_cloud_gax::paginator::ItemPaginator<
3998            crate::model::ListTagHoldsResponse,
3999            crate::Error,
4000        > {
4001            use google_cloud_gax::paginator::Paginator;
4002            self.by_page().items()
4003        }
4004
4005        /// Sets the value of [parent][crate::model::ListTagHoldsRequest::parent].
4006        ///
4007        /// This is a **required** field for requests.
4008        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4009            self.0.request.parent = v.into();
4010            self
4011        }
4012
4013        /// Sets the value of [page_size][crate::model::ListTagHoldsRequest::page_size].
4014        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4015            self.0.request.page_size = v.into();
4016            self
4017        }
4018
4019        /// Sets the value of [page_token][crate::model::ListTagHoldsRequest::page_token].
4020        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4021            self.0.request.page_token = v.into();
4022            self
4023        }
4024
4025        /// Sets the value of [filter][crate::model::ListTagHoldsRequest::filter].
4026        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4027            self.0.request.filter = v.into();
4028            self
4029        }
4030    }
4031
4032    #[doc(hidden)]
4033    impl crate::RequestBuilder for ListTagHolds {
4034        fn request_options(&mut self) -> &mut crate::RequestOptions {
4035            &mut self.0.options
4036        }
4037    }
4038
4039    /// The request builder for [TagHolds::get_operation][crate::client::TagHolds::get_operation] calls.
4040    ///
4041    /// # Example
4042    /// ```
4043    /// # use google_cloud_resourcemanager_v3::builder::tag_holds::GetOperation;
4044    /// # async fn sample() -> google_cloud_resourcemanager_v3::Result<()> {
4045    ///
4046    /// let builder = prepare_request_builder();
4047    /// let response = builder.send().await?;
4048    /// # Ok(()) }
4049    ///
4050    /// fn prepare_request_builder() -> GetOperation {
4051    ///   # panic!();
4052    ///   // ... details omitted ...
4053    /// }
4054    /// ```
4055    #[derive(Clone, Debug)]
4056    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
4057
4058    impl GetOperation {
4059        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::TagHolds>) -> Self {
4060            Self(RequestBuilder::new(stub))
4061        }
4062
4063        /// Sets the full request, replacing any prior values.
4064        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
4065            mut self,
4066            v: V,
4067        ) -> Self {
4068            self.0.request = v.into();
4069            self
4070        }
4071
4072        /// Sets all the options, replacing any prior values.
4073        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4074            self.0.options = v.into();
4075            self
4076        }
4077
4078        /// Sends the request.
4079        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4080            (*self.0.stub)
4081                .get_operation(self.0.request, self.0.options)
4082                .await
4083                .map(crate::Response::into_body)
4084        }
4085
4086        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
4087        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4088            self.0.request.name = v.into();
4089            self
4090        }
4091    }
4092
4093    #[doc(hidden)]
4094    impl crate::RequestBuilder for GetOperation {
4095        fn request_options(&mut self) -> &mut crate::RequestOptions {
4096            &mut self.0.options
4097        }
4098    }
4099}
4100
4101pub mod tag_keys {
4102    use crate::Result;
4103
4104    /// A builder for [TagKeys][crate::client::TagKeys].
4105    ///
4106    /// ```
4107    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
4108    /// # use google_cloud_resourcemanager_v3::*;
4109    /// # use builder::tag_keys::ClientBuilder;
4110    /// # use client::TagKeys;
4111    /// let builder : ClientBuilder = TagKeys::builder();
4112    /// let client = builder
4113    ///     .with_endpoint("https://cloudresourcemanager.googleapis.com")
4114    ///     .build().await?;
4115    /// # Ok(()) }
4116    /// ```
4117    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
4118
4119    pub(crate) mod client {
4120        use super::super::super::client::TagKeys;
4121        pub struct Factory;
4122        impl crate::ClientFactory for Factory {
4123            type Client = TagKeys;
4124            type Credentials = gaxi::options::Credentials;
4125            async fn build(
4126                self,
4127                config: gaxi::options::ClientConfig,
4128            ) -> crate::ClientBuilderResult<Self::Client> {
4129                Self::Client::new(config).await
4130            }
4131        }
4132    }
4133
4134    /// Common implementation for [crate::client::TagKeys] request builders.
4135    #[derive(Clone, Debug)]
4136    pub(crate) struct RequestBuilder<R: std::default::Default> {
4137        stub: std::sync::Arc<dyn super::super::stub::dynamic::TagKeys>,
4138        request: R,
4139        options: crate::RequestOptions,
4140    }
4141
4142    impl<R> RequestBuilder<R>
4143    where
4144        R: std::default::Default,
4145    {
4146        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::TagKeys>) -> Self {
4147            Self {
4148                stub,
4149                request: R::default(),
4150                options: crate::RequestOptions::default(),
4151            }
4152        }
4153    }
4154
4155    /// The request builder for [TagKeys::list_tag_keys][crate::client::TagKeys::list_tag_keys] calls.
4156    ///
4157    /// # Example
4158    /// ```
4159    /// # use google_cloud_resourcemanager_v3::builder::tag_keys::ListTagKeys;
4160    /// # async fn sample() -> google_cloud_resourcemanager_v3::Result<()> {
4161    /// use google_cloud_gax::paginator::ItemPaginator;
4162    ///
4163    /// let builder = prepare_request_builder();
4164    /// let mut items = builder.by_item();
4165    /// while let Some(result) = items.next().await {
4166    ///   let item = result?;
4167    /// }
4168    /// # Ok(()) }
4169    ///
4170    /// fn prepare_request_builder() -> ListTagKeys {
4171    ///   # panic!();
4172    ///   // ... details omitted ...
4173    /// }
4174    /// ```
4175    #[derive(Clone, Debug)]
4176    pub struct ListTagKeys(RequestBuilder<crate::model::ListTagKeysRequest>);
4177
4178    impl ListTagKeys {
4179        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::TagKeys>) -> Self {
4180            Self(RequestBuilder::new(stub))
4181        }
4182
4183        /// Sets the full request, replacing any prior values.
4184        pub fn with_request<V: Into<crate::model::ListTagKeysRequest>>(mut self, v: V) -> Self {
4185            self.0.request = v.into();
4186            self
4187        }
4188
4189        /// Sets all the options, replacing any prior values.
4190        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4191            self.0.options = v.into();
4192            self
4193        }
4194
4195        /// Sends the request.
4196        pub async fn send(self) -> Result<crate::model::ListTagKeysResponse> {
4197            (*self.0.stub)
4198                .list_tag_keys(self.0.request, self.0.options)
4199                .await
4200                .map(crate::Response::into_body)
4201        }
4202
4203        /// Streams each page in the collection.
4204        pub fn by_page(
4205            self,
4206        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListTagKeysResponse, crate::Error>
4207        {
4208            use std::clone::Clone;
4209            let token = self.0.request.page_token.clone();
4210            let execute = move |token: String| {
4211                let mut builder = self.clone();
4212                builder.0.request = builder.0.request.set_page_token(token);
4213                builder.send()
4214            };
4215            google_cloud_gax::paginator::internal::new_paginator(token, execute)
4216        }
4217
4218        /// Streams each item in the collection.
4219        pub fn by_item(
4220            self,
4221        ) -> impl google_cloud_gax::paginator::ItemPaginator<
4222            crate::model::ListTagKeysResponse,
4223            crate::Error,
4224        > {
4225            use google_cloud_gax::paginator::Paginator;
4226            self.by_page().items()
4227        }
4228
4229        /// Sets the value of [parent][crate::model::ListTagKeysRequest::parent].
4230        ///
4231        /// This is a **required** field for requests.
4232        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4233            self.0.request.parent = v.into();
4234            self
4235        }
4236
4237        /// Sets the value of [page_size][crate::model::ListTagKeysRequest::page_size].
4238        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4239            self.0.request.page_size = v.into();
4240            self
4241        }
4242
4243        /// Sets the value of [page_token][crate::model::ListTagKeysRequest::page_token].
4244        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4245            self.0.request.page_token = v.into();
4246            self
4247        }
4248    }
4249
4250    #[doc(hidden)]
4251    impl crate::RequestBuilder for ListTagKeys {
4252        fn request_options(&mut self) -> &mut crate::RequestOptions {
4253            &mut self.0.options
4254        }
4255    }
4256
4257    /// The request builder for [TagKeys::get_tag_key][crate::client::TagKeys::get_tag_key] calls.
4258    ///
4259    /// # Example
4260    /// ```
4261    /// # use google_cloud_resourcemanager_v3::builder::tag_keys::GetTagKey;
4262    /// # async fn sample() -> google_cloud_resourcemanager_v3::Result<()> {
4263    ///
4264    /// let builder = prepare_request_builder();
4265    /// let response = builder.send().await?;
4266    /// # Ok(()) }
4267    ///
4268    /// fn prepare_request_builder() -> GetTagKey {
4269    ///   # panic!();
4270    ///   // ... details omitted ...
4271    /// }
4272    /// ```
4273    #[derive(Clone, Debug)]
4274    pub struct GetTagKey(RequestBuilder<crate::model::GetTagKeyRequest>);
4275
4276    impl GetTagKey {
4277        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::TagKeys>) -> Self {
4278            Self(RequestBuilder::new(stub))
4279        }
4280
4281        /// Sets the full request, replacing any prior values.
4282        pub fn with_request<V: Into<crate::model::GetTagKeyRequest>>(mut self, v: V) -> Self {
4283            self.0.request = v.into();
4284            self
4285        }
4286
4287        /// Sets all the options, replacing any prior values.
4288        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4289            self.0.options = v.into();
4290            self
4291        }
4292
4293        /// Sends the request.
4294        pub async fn send(self) -> Result<crate::model::TagKey> {
4295            (*self.0.stub)
4296                .get_tag_key(self.0.request, self.0.options)
4297                .await
4298                .map(crate::Response::into_body)
4299        }
4300
4301        /// Sets the value of [name][crate::model::GetTagKeyRequest::name].
4302        ///
4303        /// This is a **required** field for requests.
4304        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4305            self.0.request.name = v.into();
4306            self
4307        }
4308    }
4309
4310    #[doc(hidden)]
4311    impl crate::RequestBuilder for GetTagKey {
4312        fn request_options(&mut self) -> &mut crate::RequestOptions {
4313            &mut self.0.options
4314        }
4315    }
4316
4317    /// The request builder for [TagKeys::get_namespaced_tag_key][crate::client::TagKeys::get_namespaced_tag_key] calls.
4318    ///
4319    /// # Example
4320    /// ```
4321    /// # use google_cloud_resourcemanager_v3::builder::tag_keys::GetNamespacedTagKey;
4322    /// # async fn sample() -> google_cloud_resourcemanager_v3::Result<()> {
4323    ///
4324    /// let builder = prepare_request_builder();
4325    /// let response = builder.send().await?;
4326    /// # Ok(()) }
4327    ///
4328    /// fn prepare_request_builder() -> GetNamespacedTagKey {
4329    ///   # panic!();
4330    ///   // ... details omitted ...
4331    /// }
4332    /// ```
4333    #[derive(Clone, Debug)]
4334    pub struct GetNamespacedTagKey(RequestBuilder<crate::model::GetNamespacedTagKeyRequest>);
4335
4336    impl GetNamespacedTagKey {
4337        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::TagKeys>) -> Self {
4338            Self(RequestBuilder::new(stub))
4339        }
4340
4341        /// Sets the full request, replacing any prior values.
4342        pub fn with_request<V: Into<crate::model::GetNamespacedTagKeyRequest>>(
4343            mut self,
4344            v: V,
4345        ) -> Self {
4346            self.0.request = v.into();
4347            self
4348        }
4349
4350        /// Sets all the options, replacing any prior values.
4351        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4352            self.0.options = v.into();
4353            self
4354        }
4355
4356        /// Sends the request.
4357        pub async fn send(self) -> Result<crate::model::TagKey> {
4358            (*self.0.stub)
4359                .get_namespaced_tag_key(self.0.request, self.0.options)
4360                .await
4361                .map(crate::Response::into_body)
4362        }
4363
4364        /// Sets the value of [name][crate::model::GetNamespacedTagKeyRequest::name].
4365        ///
4366        /// This is a **required** field for requests.
4367        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4368            self.0.request.name = v.into();
4369            self
4370        }
4371    }
4372
4373    #[doc(hidden)]
4374    impl crate::RequestBuilder for GetNamespacedTagKey {
4375        fn request_options(&mut self) -> &mut crate::RequestOptions {
4376            &mut self.0.options
4377        }
4378    }
4379
4380    /// The request builder for [TagKeys::create_tag_key][crate::client::TagKeys::create_tag_key] calls.
4381    ///
4382    /// # Example
4383    /// ```
4384    /// # use google_cloud_resourcemanager_v3::builder::tag_keys::CreateTagKey;
4385    /// # async fn sample() -> google_cloud_resourcemanager_v3::Result<()> {
4386    /// use google_cloud_lro::Poller;
4387    ///
4388    /// let builder = prepare_request_builder();
4389    /// let response = builder.poller().until_done().await?;
4390    /// # Ok(()) }
4391    ///
4392    /// fn prepare_request_builder() -> CreateTagKey {
4393    ///   # panic!();
4394    ///   // ... details omitted ...
4395    /// }
4396    /// ```
4397    #[derive(Clone, Debug)]
4398    pub struct CreateTagKey(RequestBuilder<crate::model::CreateTagKeyRequest>);
4399
4400    impl CreateTagKey {
4401        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::TagKeys>) -> Self {
4402            Self(RequestBuilder::new(stub))
4403        }
4404
4405        /// Sets the full request, replacing any prior values.
4406        pub fn with_request<V: Into<crate::model::CreateTagKeyRequest>>(mut self, v: V) -> Self {
4407            self.0.request = v.into();
4408            self
4409        }
4410
4411        /// Sets all the options, replacing any prior values.
4412        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4413            self.0.options = v.into();
4414            self
4415        }
4416
4417        /// Sends the request.
4418        ///
4419        /// # Long running operations
4420        ///
4421        /// This starts, but does not poll, a longrunning operation. More information
4422        /// on [create_tag_key][crate::client::TagKeys::create_tag_key].
4423        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4424            (*self.0.stub)
4425                .create_tag_key(self.0.request, self.0.options)
4426                .await
4427                .map(crate::Response::into_body)
4428        }
4429
4430        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_tag_key`.
4431        pub fn poller(
4432            self,
4433        ) -> impl google_cloud_lro::Poller<crate::model::TagKey, crate::model::CreateTagKeyMetadata>
4434        {
4435            type Operation = google_cloud_lro::internal::Operation<
4436                crate::model::TagKey,
4437                crate::model::CreateTagKeyMetadata,
4438            >;
4439            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4440            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4441
4442            let stub = self.0.stub.clone();
4443            let mut options = self.0.options.clone();
4444            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4445            let query = move |name| {
4446                let stub = stub.clone();
4447                let options = options.clone();
4448                async {
4449                    let op = GetOperation::new(stub)
4450                        .set_name(name)
4451                        .with_options(options)
4452                        .send()
4453                        .await?;
4454                    Ok(Operation::new(op))
4455                }
4456            };
4457
4458            let start = move || async {
4459                let op = self.send().await?;
4460                Ok(Operation::new(op))
4461            };
4462
4463            google_cloud_lro::internal::new_poller(
4464                polling_error_policy,
4465                polling_backoff_policy,
4466                start,
4467                query,
4468            )
4469        }
4470
4471        /// Sets the value of [tag_key][crate::model::CreateTagKeyRequest::tag_key].
4472        ///
4473        /// This is a **required** field for requests.
4474        pub fn set_tag_key<T>(mut self, v: T) -> Self
4475        where
4476            T: std::convert::Into<crate::model::TagKey>,
4477        {
4478            self.0.request.tag_key = std::option::Option::Some(v.into());
4479            self
4480        }
4481
4482        /// Sets or clears the value of [tag_key][crate::model::CreateTagKeyRequest::tag_key].
4483        ///
4484        /// This is a **required** field for requests.
4485        pub fn set_or_clear_tag_key<T>(mut self, v: std::option::Option<T>) -> Self
4486        where
4487            T: std::convert::Into<crate::model::TagKey>,
4488        {
4489            self.0.request.tag_key = v.map(|x| x.into());
4490            self
4491        }
4492
4493        /// Sets the value of [validate_only][crate::model::CreateTagKeyRequest::validate_only].
4494        pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
4495            self.0.request.validate_only = v.into();
4496            self
4497        }
4498    }
4499
4500    #[doc(hidden)]
4501    impl crate::RequestBuilder for CreateTagKey {
4502        fn request_options(&mut self) -> &mut crate::RequestOptions {
4503            &mut self.0.options
4504        }
4505    }
4506
4507    /// The request builder for [TagKeys::update_tag_key][crate::client::TagKeys::update_tag_key] calls.
4508    ///
4509    /// # Example
4510    /// ```
4511    /// # use google_cloud_resourcemanager_v3::builder::tag_keys::UpdateTagKey;
4512    /// # async fn sample() -> google_cloud_resourcemanager_v3::Result<()> {
4513    /// use google_cloud_lro::Poller;
4514    ///
4515    /// let builder = prepare_request_builder();
4516    /// let response = builder.poller().until_done().await?;
4517    /// # Ok(()) }
4518    ///
4519    /// fn prepare_request_builder() -> UpdateTagKey {
4520    ///   # panic!();
4521    ///   // ... details omitted ...
4522    /// }
4523    /// ```
4524    #[derive(Clone, Debug)]
4525    pub struct UpdateTagKey(RequestBuilder<crate::model::UpdateTagKeyRequest>);
4526
4527    impl UpdateTagKey {
4528        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::TagKeys>) -> Self {
4529            Self(RequestBuilder::new(stub))
4530        }
4531
4532        /// Sets the full request, replacing any prior values.
4533        pub fn with_request<V: Into<crate::model::UpdateTagKeyRequest>>(mut self, v: V) -> Self {
4534            self.0.request = v.into();
4535            self
4536        }
4537
4538        /// Sets all the options, replacing any prior values.
4539        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4540            self.0.options = v.into();
4541            self
4542        }
4543
4544        /// Sends the request.
4545        ///
4546        /// # Long running operations
4547        ///
4548        /// This starts, but does not poll, a longrunning operation. More information
4549        /// on [update_tag_key][crate::client::TagKeys::update_tag_key].
4550        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4551            (*self.0.stub)
4552                .update_tag_key(self.0.request, self.0.options)
4553                .await
4554                .map(crate::Response::into_body)
4555        }
4556
4557        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_tag_key`.
4558        pub fn poller(
4559            self,
4560        ) -> impl google_cloud_lro::Poller<crate::model::TagKey, crate::model::UpdateTagKeyMetadata>
4561        {
4562            type Operation = google_cloud_lro::internal::Operation<
4563                crate::model::TagKey,
4564                crate::model::UpdateTagKeyMetadata,
4565            >;
4566            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4567            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4568
4569            let stub = self.0.stub.clone();
4570            let mut options = self.0.options.clone();
4571            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4572            let query = move |name| {
4573                let stub = stub.clone();
4574                let options = options.clone();
4575                async {
4576                    let op = GetOperation::new(stub)
4577                        .set_name(name)
4578                        .with_options(options)
4579                        .send()
4580                        .await?;
4581                    Ok(Operation::new(op))
4582                }
4583            };
4584
4585            let start = move || async {
4586                let op = self.send().await?;
4587                Ok(Operation::new(op))
4588            };
4589
4590            google_cloud_lro::internal::new_poller(
4591                polling_error_policy,
4592                polling_backoff_policy,
4593                start,
4594                query,
4595            )
4596        }
4597
4598        /// Sets the value of [tag_key][crate::model::UpdateTagKeyRequest::tag_key].
4599        ///
4600        /// This is a **required** field for requests.
4601        pub fn set_tag_key<T>(mut self, v: T) -> Self
4602        where
4603            T: std::convert::Into<crate::model::TagKey>,
4604        {
4605            self.0.request.tag_key = std::option::Option::Some(v.into());
4606            self
4607        }
4608
4609        /// Sets or clears the value of [tag_key][crate::model::UpdateTagKeyRequest::tag_key].
4610        ///
4611        /// This is a **required** field for requests.
4612        pub fn set_or_clear_tag_key<T>(mut self, v: std::option::Option<T>) -> Self
4613        where
4614            T: std::convert::Into<crate::model::TagKey>,
4615        {
4616            self.0.request.tag_key = v.map(|x| x.into());
4617            self
4618        }
4619
4620        /// Sets the value of [update_mask][crate::model::UpdateTagKeyRequest::update_mask].
4621        pub fn set_update_mask<T>(mut self, v: T) -> Self
4622        where
4623            T: std::convert::Into<wkt::FieldMask>,
4624        {
4625            self.0.request.update_mask = std::option::Option::Some(v.into());
4626            self
4627        }
4628
4629        /// Sets or clears the value of [update_mask][crate::model::UpdateTagKeyRequest::update_mask].
4630        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4631        where
4632            T: std::convert::Into<wkt::FieldMask>,
4633        {
4634            self.0.request.update_mask = v.map(|x| x.into());
4635            self
4636        }
4637
4638        /// Sets the value of [validate_only][crate::model::UpdateTagKeyRequest::validate_only].
4639        pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
4640            self.0.request.validate_only = v.into();
4641            self
4642        }
4643    }
4644
4645    #[doc(hidden)]
4646    impl crate::RequestBuilder for UpdateTagKey {
4647        fn request_options(&mut self) -> &mut crate::RequestOptions {
4648            &mut self.0.options
4649        }
4650    }
4651
4652    /// The request builder for [TagKeys::delete_tag_key][crate::client::TagKeys::delete_tag_key] calls.
4653    ///
4654    /// # Example
4655    /// ```
4656    /// # use google_cloud_resourcemanager_v3::builder::tag_keys::DeleteTagKey;
4657    /// # async fn sample() -> google_cloud_resourcemanager_v3::Result<()> {
4658    /// use google_cloud_lro::Poller;
4659    ///
4660    /// let builder = prepare_request_builder();
4661    /// let response = builder.poller().until_done().await?;
4662    /// # Ok(()) }
4663    ///
4664    /// fn prepare_request_builder() -> DeleteTagKey {
4665    ///   # panic!();
4666    ///   // ... details omitted ...
4667    /// }
4668    /// ```
4669    #[derive(Clone, Debug)]
4670    pub struct DeleteTagKey(RequestBuilder<crate::model::DeleteTagKeyRequest>);
4671
4672    impl DeleteTagKey {
4673        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::TagKeys>) -> Self {
4674            Self(RequestBuilder::new(stub))
4675        }
4676
4677        /// Sets the full request, replacing any prior values.
4678        pub fn with_request<V: Into<crate::model::DeleteTagKeyRequest>>(mut self, v: V) -> Self {
4679            self.0.request = v.into();
4680            self
4681        }
4682
4683        /// Sets all the options, replacing any prior values.
4684        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4685            self.0.options = v.into();
4686            self
4687        }
4688
4689        /// Sends the request.
4690        ///
4691        /// # Long running operations
4692        ///
4693        /// This starts, but does not poll, a longrunning operation. More information
4694        /// on [delete_tag_key][crate::client::TagKeys::delete_tag_key].
4695        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4696            (*self.0.stub)
4697                .delete_tag_key(self.0.request, self.0.options)
4698                .await
4699                .map(crate::Response::into_body)
4700        }
4701
4702        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_tag_key`.
4703        pub fn poller(
4704            self,
4705        ) -> impl google_cloud_lro::Poller<crate::model::TagKey, crate::model::DeleteTagKeyMetadata>
4706        {
4707            type Operation = google_cloud_lro::internal::Operation<
4708                crate::model::TagKey,
4709                crate::model::DeleteTagKeyMetadata,
4710            >;
4711            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4712            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4713
4714            let stub = self.0.stub.clone();
4715            let mut options = self.0.options.clone();
4716            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4717            let query = move |name| {
4718                let stub = stub.clone();
4719                let options = options.clone();
4720                async {
4721                    let op = GetOperation::new(stub)
4722                        .set_name(name)
4723                        .with_options(options)
4724                        .send()
4725                        .await?;
4726                    Ok(Operation::new(op))
4727                }
4728            };
4729
4730            let start = move || async {
4731                let op = self.send().await?;
4732                Ok(Operation::new(op))
4733            };
4734
4735            google_cloud_lro::internal::new_poller(
4736                polling_error_policy,
4737                polling_backoff_policy,
4738                start,
4739                query,
4740            )
4741        }
4742
4743        /// Sets the value of [name][crate::model::DeleteTagKeyRequest::name].
4744        ///
4745        /// This is a **required** field for requests.
4746        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4747            self.0.request.name = v.into();
4748            self
4749        }
4750
4751        /// Sets the value of [validate_only][crate::model::DeleteTagKeyRequest::validate_only].
4752        pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
4753            self.0.request.validate_only = v.into();
4754            self
4755        }
4756
4757        /// Sets the value of [etag][crate::model::DeleteTagKeyRequest::etag].
4758        pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
4759            self.0.request.etag = v.into();
4760            self
4761        }
4762    }
4763
4764    #[doc(hidden)]
4765    impl crate::RequestBuilder for DeleteTagKey {
4766        fn request_options(&mut self) -> &mut crate::RequestOptions {
4767            &mut self.0.options
4768        }
4769    }
4770
4771    /// The request builder for [TagKeys::get_iam_policy][crate::client::TagKeys::get_iam_policy] calls.
4772    ///
4773    /// # Example
4774    /// ```
4775    /// # use google_cloud_resourcemanager_v3::builder::tag_keys::GetIamPolicy;
4776    /// # async fn sample() -> google_cloud_resourcemanager_v3::Result<()> {
4777    ///
4778    /// let builder = prepare_request_builder();
4779    /// let response = builder.send().await?;
4780    /// # Ok(()) }
4781    ///
4782    /// fn prepare_request_builder() -> GetIamPolicy {
4783    ///   # panic!();
4784    ///   // ... details omitted ...
4785    /// }
4786    /// ```
4787    #[derive(Clone, Debug)]
4788    pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
4789
4790    impl GetIamPolicy {
4791        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::TagKeys>) -> Self {
4792            Self(RequestBuilder::new(stub))
4793        }
4794
4795        /// Sets the full request, replacing any prior values.
4796        pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
4797            mut self,
4798            v: V,
4799        ) -> Self {
4800            self.0.request = v.into();
4801            self
4802        }
4803
4804        /// Sets all the options, replacing any prior values.
4805        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4806            self.0.options = v.into();
4807            self
4808        }
4809
4810        /// Sends the request.
4811        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
4812            (*self.0.stub)
4813                .get_iam_policy(self.0.request, self.0.options)
4814                .await
4815                .map(crate::Response::into_body)
4816        }
4817
4818        /// Sets the value of [resource][google_cloud_iam_v1::model::GetIamPolicyRequest::resource].
4819        ///
4820        /// This is a **required** field for requests.
4821        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4822            self.0.request.resource = v.into();
4823            self
4824        }
4825
4826        /// Sets the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
4827        pub fn set_options<T>(mut self, v: T) -> Self
4828        where
4829            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
4830        {
4831            self.0.request.options = std::option::Option::Some(v.into());
4832            self
4833        }
4834
4835        /// Sets or clears the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
4836        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
4837        where
4838            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
4839        {
4840            self.0.request.options = v.map(|x| x.into());
4841            self
4842        }
4843    }
4844
4845    #[doc(hidden)]
4846    impl crate::RequestBuilder for GetIamPolicy {
4847        fn request_options(&mut self) -> &mut crate::RequestOptions {
4848            &mut self.0.options
4849        }
4850    }
4851
4852    /// The request builder for [TagKeys::set_iam_policy][crate::client::TagKeys::set_iam_policy] calls.
4853    ///
4854    /// # Example
4855    /// ```
4856    /// # use google_cloud_resourcemanager_v3::builder::tag_keys::SetIamPolicy;
4857    /// # async fn sample() -> google_cloud_resourcemanager_v3::Result<()> {
4858    ///
4859    /// let builder = prepare_request_builder();
4860    /// let response = builder.send().await?;
4861    /// # Ok(()) }
4862    ///
4863    /// fn prepare_request_builder() -> SetIamPolicy {
4864    ///   # panic!();
4865    ///   // ... details omitted ...
4866    /// }
4867    /// ```
4868    #[derive(Clone, Debug)]
4869    pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
4870
4871    impl SetIamPolicy {
4872        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::TagKeys>) -> Self {
4873            Self(RequestBuilder::new(stub))
4874        }
4875
4876        /// Sets the full request, replacing any prior values.
4877        pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
4878            mut self,
4879            v: V,
4880        ) -> Self {
4881            self.0.request = v.into();
4882            self
4883        }
4884
4885        /// Sets all the options, replacing any prior values.
4886        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4887            self.0.options = v.into();
4888            self
4889        }
4890
4891        /// Sends the request.
4892        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
4893            (*self.0.stub)
4894                .set_iam_policy(self.0.request, self.0.options)
4895                .await
4896                .map(crate::Response::into_body)
4897        }
4898
4899        /// Sets the value of [resource][google_cloud_iam_v1::model::SetIamPolicyRequest::resource].
4900        ///
4901        /// This is a **required** field for requests.
4902        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4903            self.0.request.resource = v.into();
4904            self
4905        }
4906
4907        /// Sets the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
4908        ///
4909        /// This is a **required** field for requests.
4910        pub fn set_policy<T>(mut self, v: T) -> Self
4911        where
4912            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
4913        {
4914            self.0.request.policy = std::option::Option::Some(v.into());
4915            self
4916        }
4917
4918        /// Sets or clears the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
4919        ///
4920        /// This is a **required** field for requests.
4921        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
4922        where
4923            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
4924        {
4925            self.0.request.policy = v.map(|x| x.into());
4926            self
4927        }
4928
4929        /// Sets the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
4930        pub fn set_update_mask<T>(mut self, v: T) -> Self
4931        where
4932            T: std::convert::Into<wkt::FieldMask>,
4933        {
4934            self.0.request.update_mask = std::option::Option::Some(v.into());
4935            self
4936        }
4937
4938        /// Sets or clears the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
4939        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4940        where
4941            T: std::convert::Into<wkt::FieldMask>,
4942        {
4943            self.0.request.update_mask = v.map(|x| x.into());
4944            self
4945        }
4946    }
4947
4948    #[doc(hidden)]
4949    impl crate::RequestBuilder for SetIamPolicy {
4950        fn request_options(&mut self) -> &mut crate::RequestOptions {
4951            &mut self.0.options
4952        }
4953    }
4954
4955    /// The request builder for [TagKeys::test_iam_permissions][crate::client::TagKeys::test_iam_permissions] calls.
4956    ///
4957    /// # Example
4958    /// ```
4959    /// # use google_cloud_resourcemanager_v3::builder::tag_keys::TestIamPermissions;
4960    /// # async fn sample() -> google_cloud_resourcemanager_v3::Result<()> {
4961    ///
4962    /// let builder = prepare_request_builder();
4963    /// let response = builder.send().await?;
4964    /// # Ok(()) }
4965    ///
4966    /// fn prepare_request_builder() -> TestIamPermissions {
4967    ///   # panic!();
4968    ///   // ... details omitted ...
4969    /// }
4970    /// ```
4971    #[derive(Clone, Debug)]
4972    pub struct TestIamPermissions(
4973        RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
4974    );
4975
4976    impl TestIamPermissions {
4977        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::TagKeys>) -> Self {
4978            Self(RequestBuilder::new(stub))
4979        }
4980
4981        /// Sets the full request, replacing any prior values.
4982        pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
4983            mut self,
4984            v: V,
4985        ) -> Self {
4986            self.0.request = v.into();
4987            self
4988        }
4989
4990        /// Sets all the options, replacing any prior values.
4991        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4992            self.0.options = v.into();
4993            self
4994        }
4995
4996        /// Sends the request.
4997        pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
4998            (*self.0.stub)
4999                .test_iam_permissions(self.0.request, self.0.options)
5000                .await
5001                .map(crate::Response::into_body)
5002        }
5003
5004        /// Sets the value of [resource][google_cloud_iam_v1::model::TestIamPermissionsRequest::resource].
5005        ///
5006        /// This is a **required** field for requests.
5007        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5008            self.0.request.resource = v.into();
5009            self
5010        }
5011
5012        /// Sets the value of [permissions][google_cloud_iam_v1::model::TestIamPermissionsRequest::permissions].
5013        ///
5014        /// This is a **required** field for requests.
5015        pub fn set_permissions<T, V>(mut self, v: T) -> Self
5016        where
5017            T: std::iter::IntoIterator<Item = V>,
5018            V: std::convert::Into<std::string::String>,
5019        {
5020            use std::iter::Iterator;
5021            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
5022            self
5023        }
5024    }
5025
5026    #[doc(hidden)]
5027    impl crate::RequestBuilder for TestIamPermissions {
5028        fn request_options(&mut self) -> &mut crate::RequestOptions {
5029            &mut self.0.options
5030        }
5031    }
5032
5033    /// The request builder for [TagKeys::get_operation][crate::client::TagKeys::get_operation] calls.
5034    ///
5035    /// # Example
5036    /// ```
5037    /// # use google_cloud_resourcemanager_v3::builder::tag_keys::GetOperation;
5038    /// # async fn sample() -> google_cloud_resourcemanager_v3::Result<()> {
5039    ///
5040    /// let builder = prepare_request_builder();
5041    /// let response = builder.send().await?;
5042    /// # Ok(()) }
5043    ///
5044    /// fn prepare_request_builder() -> GetOperation {
5045    ///   # panic!();
5046    ///   // ... details omitted ...
5047    /// }
5048    /// ```
5049    #[derive(Clone, Debug)]
5050    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
5051
5052    impl GetOperation {
5053        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::TagKeys>) -> Self {
5054            Self(RequestBuilder::new(stub))
5055        }
5056
5057        /// Sets the full request, replacing any prior values.
5058        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
5059            mut self,
5060            v: V,
5061        ) -> Self {
5062            self.0.request = v.into();
5063            self
5064        }
5065
5066        /// Sets all the options, replacing any prior values.
5067        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5068            self.0.options = v.into();
5069            self
5070        }
5071
5072        /// Sends the request.
5073        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5074            (*self.0.stub)
5075                .get_operation(self.0.request, self.0.options)
5076                .await
5077                .map(crate::Response::into_body)
5078        }
5079
5080        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
5081        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5082            self.0.request.name = v.into();
5083            self
5084        }
5085    }
5086
5087    #[doc(hidden)]
5088    impl crate::RequestBuilder for GetOperation {
5089        fn request_options(&mut self) -> &mut crate::RequestOptions {
5090            &mut self.0.options
5091        }
5092    }
5093}
5094
5095pub mod tag_values {
5096    use crate::Result;
5097
5098    /// A builder for [TagValues][crate::client::TagValues].
5099    ///
5100    /// ```
5101    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
5102    /// # use google_cloud_resourcemanager_v3::*;
5103    /// # use builder::tag_values::ClientBuilder;
5104    /// # use client::TagValues;
5105    /// let builder : ClientBuilder = TagValues::builder();
5106    /// let client = builder
5107    ///     .with_endpoint("https://cloudresourcemanager.googleapis.com")
5108    ///     .build().await?;
5109    /// # Ok(()) }
5110    /// ```
5111    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
5112
5113    pub(crate) mod client {
5114        use super::super::super::client::TagValues;
5115        pub struct Factory;
5116        impl crate::ClientFactory for Factory {
5117            type Client = TagValues;
5118            type Credentials = gaxi::options::Credentials;
5119            async fn build(
5120                self,
5121                config: gaxi::options::ClientConfig,
5122            ) -> crate::ClientBuilderResult<Self::Client> {
5123                Self::Client::new(config).await
5124            }
5125        }
5126    }
5127
5128    /// Common implementation for [crate::client::TagValues] request builders.
5129    #[derive(Clone, Debug)]
5130    pub(crate) struct RequestBuilder<R: std::default::Default> {
5131        stub: std::sync::Arc<dyn super::super::stub::dynamic::TagValues>,
5132        request: R,
5133        options: crate::RequestOptions,
5134    }
5135
5136    impl<R> RequestBuilder<R>
5137    where
5138        R: std::default::Default,
5139    {
5140        pub(crate) fn new(
5141            stub: std::sync::Arc<dyn super::super::stub::dynamic::TagValues>,
5142        ) -> Self {
5143            Self {
5144                stub,
5145                request: R::default(),
5146                options: crate::RequestOptions::default(),
5147            }
5148        }
5149    }
5150
5151    /// The request builder for [TagValues::list_tag_values][crate::client::TagValues::list_tag_values] calls.
5152    ///
5153    /// # Example
5154    /// ```
5155    /// # use google_cloud_resourcemanager_v3::builder::tag_values::ListTagValues;
5156    /// # async fn sample() -> google_cloud_resourcemanager_v3::Result<()> {
5157    /// use google_cloud_gax::paginator::ItemPaginator;
5158    ///
5159    /// let builder = prepare_request_builder();
5160    /// let mut items = builder.by_item();
5161    /// while let Some(result) = items.next().await {
5162    ///   let item = result?;
5163    /// }
5164    /// # Ok(()) }
5165    ///
5166    /// fn prepare_request_builder() -> ListTagValues {
5167    ///   # panic!();
5168    ///   // ... details omitted ...
5169    /// }
5170    /// ```
5171    #[derive(Clone, Debug)]
5172    pub struct ListTagValues(RequestBuilder<crate::model::ListTagValuesRequest>);
5173
5174    impl ListTagValues {
5175        pub(crate) fn new(
5176            stub: std::sync::Arc<dyn super::super::stub::dynamic::TagValues>,
5177        ) -> Self {
5178            Self(RequestBuilder::new(stub))
5179        }
5180
5181        /// Sets the full request, replacing any prior values.
5182        pub fn with_request<V: Into<crate::model::ListTagValuesRequest>>(mut self, v: V) -> Self {
5183            self.0.request = v.into();
5184            self
5185        }
5186
5187        /// Sets all the options, replacing any prior values.
5188        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5189            self.0.options = v.into();
5190            self
5191        }
5192
5193        /// Sends the request.
5194        pub async fn send(self) -> Result<crate::model::ListTagValuesResponse> {
5195            (*self.0.stub)
5196                .list_tag_values(self.0.request, self.0.options)
5197                .await
5198                .map(crate::Response::into_body)
5199        }
5200
5201        /// Streams each page in the collection.
5202        pub fn by_page(
5203            self,
5204        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListTagValuesResponse, crate::Error>
5205        {
5206            use std::clone::Clone;
5207            let token = self.0.request.page_token.clone();
5208            let execute = move |token: String| {
5209                let mut builder = self.clone();
5210                builder.0.request = builder.0.request.set_page_token(token);
5211                builder.send()
5212            };
5213            google_cloud_gax::paginator::internal::new_paginator(token, execute)
5214        }
5215
5216        /// Streams each item in the collection.
5217        pub fn by_item(
5218            self,
5219        ) -> impl google_cloud_gax::paginator::ItemPaginator<
5220            crate::model::ListTagValuesResponse,
5221            crate::Error,
5222        > {
5223            use google_cloud_gax::paginator::Paginator;
5224            self.by_page().items()
5225        }
5226
5227        /// Sets the value of [parent][crate::model::ListTagValuesRequest::parent].
5228        ///
5229        /// This is a **required** field for requests.
5230        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5231            self.0.request.parent = v.into();
5232            self
5233        }
5234
5235        /// Sets the value of [page_size][crate::model::ListTagValuesRequest::page_size].
5236        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5237            self.0.request.page_size = v.into();
5238            self
5239        }
5240
5241        /// Sets the value of [page_token][crate::model::ListTagValuesRequest::page_token].
5242        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5243            self.0.request.page_token = v.into();
5244            self
5245        }
5246    }
5247
5248    #[doc(hidden)]
5249    impl crate::RequestBuilder for ListTagValues {
5250        fn request_options(&mut self) -> &mut crate::RequestOptions {
5251            &mut self.0.options
5252        }
5253    }
5254
5255    /// The request builder for [TagValues::get_tag_value][crate::client::TagValues::get_tag_value] calls.
5256    ///
5257    /// # Example
5258    /// ```
5259    /// # use google_cloud_resourcemanager_v3::builder::tag_values::GetTagValue;
5260    /// # async fn sample() -> google_cloud_resourcemanager_v3::Result<()> {
5261    ///
5262    /// let builder = prepare_request_builder();
5263    /// let response = builder.send().await?;
5264    /// # Ok(()) }
5265    ///
5266    /// fn prepare_request_builder() -> GetTagValue {
5267    ///   # panic!();
5268    ///   // ... details omitted ...
5269    /// }
5270    /// ```
5271    #[derive(Clone, Debug)]
5272    pub struct GetTagValue(RequestBuilder<crate::model::GetTagValueRequest>);
5273
5274    impl GetTagValue {
5275        pub(crate) fn new(
5276            stub: std::sync::Arc<dyn super::super::stub::dynamic::TagValues>,
5277        ) -> Self {
5278            Self(RequestBuilder::new(stub))
5279        }
5280
5281        /// Sets the full request, replacing any prior values.
5282        pub fn with_request<V: Into<crate::model::GetTagValueRequest>>(mut self, v: V) -> Self {
5283            self.0.request = v.into();
5284            self
5285        }
5286
5287        /// Sets all the options, replacing any prior values.
5288        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5289            self.0.options = v.into();
5290            self
5291        }
5292
5293        /// Sends the request.
5294        pub async fn send(self) -> Result<crate::model::TagValue> {
5295            (*self.0.stub)
5296                .get_tag_value(self.0.request, self.0.options)
5297                .await
5298                .map(crate::Response::into_body)
5299        }
5300
5301        /// Sets the value of [name][crate::model::GetTagValueRequest::name].
5302        ///
5303        /// This is a **required** field for requests.
5304        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5305            self.0.request.name = v.into();
5306            self
5307        }
5308    }
5309
5310    #[doc(hidden)]
5311    impl crate::RequestBuilder for GetTagValue {
5312        fn request_options(&mut self) -> &mut crate::RequestOptions {
5313            &mut self.0.options
5314        }
5315    }
5316
5317    /// The request builder for [TagValues::get_namespaced_tag_value][crate::client::TagValues::get_namespaced_tag_value] calls.
5318    ///
5319    /// # Example
5320    /// ```
5321    /// # use google_cloud_resourcemanager_v3::builder::tag_values::GetNamespacedTagValue;
5322    /// # async fn sample() -> google_cloud_resourcemanager_v3::Result<()> {
5323    ///
5324    /// let builder = prepare_request_builder();
5325    /// let response = builder.send().await?;
5326    /// # Ok(()) }
5327    ///
5328    /// fn prepare_request_builder() -> GetNamespacedTagValue {
5329    ///   # panic!();
5330    ///   // ... details omitted ...
5331    /// }
5332    /// ```
5333    #[derive(Clone, Debug)]
5334    pub struct GetNamespacedTagValue(RequestBuilder<crate::model::GetNamespacedTagValueRequest>);
5335
5336    impl GetNamespacedTagValue {
5337        pub(crate) fn new(
5338            stub: std::sync::Arc<dyn super::super::stub::dynamic::TagValues>,
5339        ) -> Self {
5340            Self(RequestBuilder::new(stub))
5341        }
5342
5343        /// Sets the full request, replacing any prior values.
5344        pub fn with_request<V: Into<crate::model::GetNamespacedTagValueRequest>>(
5345            mut self,
5346            v: V,
5347        ) -> Self {
5348            self.0.request = v.into();
5349            self
5350        }
5351
5352        /// Sets all the options, replacing any prior values.
5353        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5354            self.0.options = v.into();
5355            self
5356        }
5357
5358        /// Sends the request.
5359        pub async fn send(self) -> Result<crate::model::TagValue> {
5360            (*self.0.stub)
5361                .get_namespaced_tag_value(self.0.request, self.0.options)
5362                .await
5363                .map(crate::Response::into_body)
5364        }
5365
5366        /// Sets the value of [name][crate::model::GetNamespacedTagValueRequest::name].
5367        ///
5368        /// This is a **required** field for requests.
5369        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5370            self.0.request.name = v.into();
5371            self
5372        }
5373    }
5374
5375    #[doc(hidden)]
5376    impl crate::RequestBuilder for GetNamespacedTagValue {
5377        fn request_options(&mut self) -> &mut crate::RequestOptions {
5378            &mut self.0.options
5379        }
5380    }
5381
5382    /// The request builder for [TagValues::create_tag_value][crate::client::TagValues::create_tag_value] calls.
5383    ///
5384    /// # Example
5385    /// ```
5386    /// # use google_cloud_resourcemanager_v3::builder::tag_values::CreateTagValue;
5387    /// # async fn sample() -> google_cloud_resourcemanager_v3::Result<()> {
5388    /// use google_cloud_lro::Poller;
5389    ///
5390    /// let builder = prepare_request_builder();
5391    /// let response = builder.poller().until_done().await?;
5392    /// # Ok(()) }
5393    ///
5394    /// fn prepare_request_builder() -> CreateTagValue {
5395    ///   # panic!();
5396    ///   // ... details omitted ...
5397    /// }
5398    /// ```
5399    #[derive(Clone, Debug)]
5400    pub struct CreateTagValue(RequestBuilder<crate::model::CreateTagValueRequest>);
5401
5402    impl CreateTagValue {
5403        pub(crate) fn new(
5404            stub: std::sync::Arc<dyn super::super::stub::dynamic::TagValues>,
5405        ) -> Self {
5406            Self(RequestBuilder::new(stub))
5407        }
5408
5409        /// Sets the full request, replacing any prior values.
5410        pub fn with_request<V: Into<crate::model::CreateTagValueRequest>>(mut self, v: V) -> Self {
5411            self.0.request = v.into();
5412            self
5413        }
5414
5415        /// Sets all the options, replacing any prior values.
5416        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5417            self.0.options = v.into();
5418            self
5419        }
5420
5421        /// Sends the request.
5422        ///
5423        /// # Long running operations
5424        ///
5425        /// This starts, but does not poll, a longrunning operation. More information
5426        /// on [create_tag_value][crate::client::TagValues::create_tag_value].
5427        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5428            (*self.0.stub)
5429                .create_tag_value(self.0.request, self.0.options)
5430                .await
5431                .map(crate::Response::into_body)
5432        }
5433
5434        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_tag_value`.
5435        pub fn poller(
5436            self,
5437        ) -> impl google_cloud_lro::Poller<crate::model::TagValue, crate::model::CreateTagValueMetadata>
5438        {
5439            type Operation = google_cloud_lro::internal::Operation<
5440                crate::model::TagValue,
5441                crate::model::CreateTagValueMetadata,
5442            >;
5443            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5444            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5445
5446            let stub = self.0.stub.clone();
5447            let mut options = self.0.options.clone();
5448            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5449            let query = move |name| {
5450                let stub = stub.clone();
5451                let options = options.clone();
5452                async {
5453                    let op = GetOperation::new(stub)
5454                        .set_name(name)
5455                        .with_options(options)
5456                        .send()
5457                        .await?;
5458                    Ok(Operation::new(op))
5459                }
5460            };
5461
5462            let start = move || async {
5463                let op = self.send().await?;
5464                Ok(Operation::new(op))
5465            };
5466
5467            google_cloud_lro::internal::new_poller(
5468                polling_error_policy,
5469                polling_backoff_policy,
5470                start,
5471                query,
5472            )
5473        }
5474
5475        /// Sets the value of [tag_value][crate::model::CreateTagValueRequest::tag_value].
5476        ///
5477        /// This is a **required** field for requests.
5478        pub fn set_tag_value<T>(mut self, v: T) -> Self
5479        where
5480            T: std::convert::Into<crate::model::TagValue>,
5481        {
5482            self.0.request.tag_value = std::option::Option::Some(v.into());
5483            self
5484        }
5485
5486        /// Sets or clears the value of [tag_value][crate::model::CreateTagValueRequest::tag_value].
5487        ///
5488        /// This is a **required** field for requests.
5489        pub fn set_or_clear_tag_value<T>(mut self, v: std::option::Option<T>) -> Self
5490        where
5491            T: std::convert::Into<crate::model::TagValue>,
5492        {
5493            self.0.request.tag_value = v.map(|x| x.into());
5494            self
5495        }
5496
5497        /// Sets the value of [validate_only][crate::model::CreateTagValueRequest::validate_only].
5498        pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
5499            self.0.request.validate_only = v.into();
5500            self
5501        }
5502    }
5503
5504    #[doc(hidden)]
5505    impl crate::RequestBuilder for CreateTagValue {
5506        fn request_options(&mut self) -> &mut crate::RequestOptions {
5507            &mut self.0.options
5508        }
5509    }
5510
5511    /// The request builder for [TagValues::update_tag_value][crate::client::TagValues::update_tag_value] calls.
5512    ///
5513    /// # Example
5514    /// ```
5515    /// # use google_cloud_resourcemanager_v3::builder::tag_values::UpdateTagValue;
5516    /// # async fn sample() -> google_cloud_resourcemanager_v3::Result<()> {
5517    /// use google_cloud_lro::Poller;
5518    ///
5519    /// let builder = prepare_request_builder();
5520    /// let response = builder.poller().until_done().await?;
5521    /// # Ok(()) }
5522    ///
5523    /// fn prepare_request_builder() -> UpdateTagValue {
5524    ///   # panic!();
5525    ///   // ... details omitted ...
5526    /// }
5527    /// ```
5528    #[derive(Clone, Debug)]
5529    pub struct UpdateTagValue(RequestBuilder<crate::model::UpdateTagValueRequest>);
5530
5531    impl UpdateTagValue {
5532        pub(crate) fn new(
5533            stub: std::sync::Arc<dyn super::super::stub::dynamic::TagValues>,
5534        ) -> Self {
5535            Self(RequestBuilder::new(stub))
5536        }
5537
5538        /// Sets the full request, replacing any prior values.
5539        pub fn with_request<V: Into<crate::model::UpdateTagValueRequest>>(mut self, v: V) -> Self {
5540            self.0.request = v.into();
5541            self
5542        }
5543
5544        /// Sets all the options, replacing any prior values.
5545        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5546            self.0.options = v.into();
5547            self
5548        }
5549
5550        /// Sends the request.
5551        ///
5552        /// # Long running operations
5553        ///
5554        /// This starts, but does not poll, a longrunning operation. More information
5555        /// on [update_tag_value][crate::client::TagValues::update_tag_value].
5556        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5557            (*self.0.stub)
5558                .update_tag_value(self.0.request, self.0.options)
5559                .await
5560                .map(crate::Response::into_body)
5561        }
5562
5563        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_tag_value`.
5564        pub fn poller(
5565            self,
5566        ) -> impl google_cloud_lro::Poller<crate::model::TagValue, crate::model::UpdateTagValueMetadata>
5567        {
5568            type Operation = google_cloud_lro::internal::Operation<
5569                crate::model::TagValue,
5570                crate::model::UpdateTagValueMetadata,
5571            >;
5572            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5573            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5574
5575            let stub = self.0.stub.clone();
5576            let mut options = self.0.options.clone();
5577            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5578            let query = move |name| {
5579                let stub = stub.clone();
5580                let options = options.clone();
5581                async {
5582                    let op = GetOperation::new(stub)
5583                        .set_name(name)
5584                        .with_options(options)
5585                        .send()
5586                        .await?;
5587                    Ok(Operation::new(op))
5588                }
5589            };
5590
5591            let start = move || async {
5592                let op = self.send().await?;
5593                Ok(Operation::new(op))
5594            };
5595
5596            google_cloud_lro::internal::new_poller(
5597                polling_error_policy,
5598                polling_backoff_policy,
5599                start,
5600                query,
5601            )
5602        }
5603
5604        /// Sets the value of [tag_value][crate::model::UpdateTagValueRequest::tag_value].
5605        ///
5606        /// This is a **required** field for requests.
5607        pub fn set_tag_value<T>(mut self, v: T) -> Self
5608        where
5609            T: std::convert::Into<crate::model::TagValue>,
5610        {
5611            self.0.request.tag_value = std::option::Option::Some(v.into());
5612            self
5613        }
5614
5615        /// Sets or clears the value of [tag_value][crate::model::UpdateTagValueRequest::tag_value].
5616        ///
5617        /// This is a **required** field for requests.
5618        pub fn set_or_clear_tag_value<T>(mut self, v: std::option::Option<T>) -> Self
5619        where
5620            T: std::convert::Into<crate::model::TagValue>,
5621        {
5622            self.0.request.tag_value = v.map(|x| x.into());
5623            self
5624        }
5625
5626        /// Sets the value of [update_mask][crate::model::UpdateTagValueRequest::update_mask].
5627        pub fn set_update_mask<T>(mut self, v: T) -> Self
5628        where
5629            T: std::convert::Into<wkt::FieldMask>,
5630        {
5631            self.0.request.update_mask = std::option::Option::Some(v.into());
5632            self
5633        }
5634
5635        /// Sets or clears the value of [update_mask][crate::model::UpdateTagValueRequest::update_mask].
5636        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5637        where
5638            T: std::convert::Into<wkt::FieldMask>,
5639        {
5640            self.0.request.update_mask = v.map(|x| x.into());
5641            self
5642        }
5643
5644        /// Sets the value of [validate_only][crate::model::UpdateTagValueRequest::validate_only].
5645        pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
5646            self.0.request.validate_only = v.into();
5647            self
5648        }
5649    }
5650
5651    #[doc(hidden)]
5652    impl crate::RequestBuilder for UpdateTagValue {
5653        fn request_options(&mut self) -> &mut crate::RequestOptions {
5654            &mut self.0.options
5655        }
5656    }
5657
5658    /// The request builder for [TagValues::delete_tag_value][crate::client::TagValues::delete_tag_value] calls.
5659    ///
5660    /// # Example
5661    /// ```
5662    /// # use google_cloud_resourcemanager_v3::builder::tag_values::DeleteTagValue;
5663    /// # async fn sample() -> google_cloud_resourcemanager_v3::Result<()> {
5664    /// use google_cloud_lro::Poller;
5665    ///
5666    /// let builder = prepare_request_builder();
5667    /// let response = builder.poller().until_done().await?;
5668    /// # Ok(()) }
5669    ///
5670    /// fn prepare_request_builder() -> DeleteTagValue {
5671    ///   # panic!();
5672    ///   // ... details omitted ...
5673    /// }
5674    /// ```
5675    #[derive(Clone, Debug)]
5676    pub struct DeleteTagValue(RequestBuilder<crate::model::DeleteTagValueRequest>);
5677
5678    impl DeleteTagValue {
5679        pub(crate) fn new(
5680            stub: std::sync::Arc<dyn super::super::stub::dynamic::TagValues>,
5681        ) -> Self {
5682            Self(RequestBuilder::new(stub))
5683        }
5684
5685        /// Sets the full request, replacing any prior values.
5686        pub fn with_request<V: Into<crate::model::DeleteTagValueRequest>>(mut self, v: V) -> Self {
5687            self.0.request = v.into();
5688            self
5689        }
5690
5691        /// Sets all the options, replacing any prior values.
5692        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5693            self.0.options = v.into();
5694            self
5695        }
5696
5697        /// Sends the request.
5698        ///
5699        /// # Long running operations
5700        ///
5701        /// This starts, but does not poll, a longrunning operation. More information
5702        /// on [delete_tag_value][crate::client::TagValues::delete_tag_value].
5703        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5704            (*self.0.stub)
5705                .delete_tag_value(self.0.request, self.0.options)
5706                .await
5707                .map(crate::Response::into_body)
5708        }
5709
5710        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_tag_value`.
5711        pub fn poller(
5712            self,
5713        ) -> impl google_cloud_lro::Poller<crate::model::TagValue, crate::model::DeleteTagValueMetadata>
5714        {
5715            type Operation = google_cloud_lro::internal::Operation<
5716                crate::model::TagValue,
5717                crate::model::DeleteTagValueMetadata,
5718            >;
5719            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5720            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5721
5722            let stub = self.0.stub.clone();
5723            let mut options = self.0.options.clone();
5724            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5725            let query = move |name| {
5726                let stub = stub.clone();
5727                let options = options.clone();
5728                async {
5729                    let op = GetOperation::new(stub)
5730                        .set_name(name)
5731                        .with_options(options)
5732                        .send()
5733                        .await?;
5734                    Ok(Operation::new(op))
5735                }
5736            };
5737
5738            let start = move || async {
5739                let op = self.send().await?;
5740                Ok(Operation::new(op))
5741            };
5742
5743            google_cloud_lro::internal::new_poller(
5744                polling_error_policy,
5745                polling_backoff_policy,
5746                start,
5747                query,
5748            )
5749        }
5750
5751        /// Sets the value of [name][crate::model::DeleteTagValueRequest::name].
5752        ///
5753        /// This is a **required** field for requests.
5754        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5755            self.0.request.name = v.into();
5756            self
5757        }
5758
5759        /// Sets the value of [validate_only][crate::model::DeleteTagValueRequest::validate_only].
5760        pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
5761            self.0.request.validate_only = v.into();
5762            self
5763        }
5764
5765        /// Sets the value of [etag][crate::model::DeleteTagValueRequest::etag].
5766        pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
5767            self.0.request.etag = v.into();
5768            self
5769        }
5770    }
5771
5772    #[doc(hidden)]
5773    impl crate::RequestBuilder for DeleteTagValue {
5774        fn request_options(&mut self) -> &mut crate::RequestOptions {
5775            &mut self.0.options
5776        }
5777    }
5778
5779    /// The request builder for [TagValues::get_iam_policy][crate::client::TagValues::get_iam_policy] calls.
5780    ///
5781    /// # Example
5782    /// ```
5783    /// # use google_cloud_resourcemanager_v3::builder::tag_values::GetIamPolicy;
5784    /// # async fn sample() -> google_cloud_resourcemanager_v3::Result<()> {
5785    ///
5786    /// let builder = prepare_request_builder();
5787    /// let response = builder.send().await?;
5788    /// # Ok(()) }
5789    ///
5790    /// fn prepare_request_builder() -> GetIamPolicy {
5791    ///   # panic!();
5792    ///   // ... details omitted ...
5793    /// }
5794    /// ```
5795    #[derive(Clone, Debug)]
5796    pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
5797
5798    impl GetIamPolicy {
5799        pub(crate) fn new(
5800            stub: std::sync::Arc<dyn super::super::stub::dynamic::TagValues>,
5801        ) -> Self {
5802            Self(RequestBuilder::new(stub))
5803        }
5804
5805        /// Sets the full request, replacing any prior values.
5806        pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
5807            mut self,
5808            v: V,
5809        ) -> Self {
5810            self.0.request = v.into();
5811            self
5812        }
5813
5814        /// Sets all the options, replacing any prior values.
5815        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5816            self.0.options = v.into();
5817            self
5818        }
5819
5820        /// Sends the request.
5821        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
5822            (*self.0.stub)
5823                .get_iam_policy(self.0.request, self.0.options)
5824                .await
5825                .map(crate::Response::into_body)
5826        }
5827
5828        /// Sets the value of [resource][google_cloud_iam_v1::model::GetIamPolicyRequest::resource].
5829        ///
5830        /// This is a **required** field for requests.
5831        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5832            self.0.request.resource = v.into();
5833            self
5834        }
5835
5836        /// Sets the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
5837        pub fn set_options<T>(mut self, v: T) -> Self
5838        where
5839            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
5840        {
5841            self.0.request.options = std::option::Option::Some(v.into());
5842            self
5843        }
5844
5845        /// Sets or clears the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
5846        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
5847        where
5848            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
5849        {
5850            self.0.request.options = v.map(|x| x.into());
5851            self
5852        }
5853    }
5854
5855    #[doc(hidden)]
5856    impl crate::RequestBuilder for GetIamPolicy {
5857        fn request_options(&mut self) -> &mut crate::RequestOptions {
5858            &mut self.0.options
5859        }
5860    }
5861
5862    /// The request builder for [TagValues::set_iam_policy][crate::client::TagValues::set_iam_policy] calls.
5863    ///
5864    /// # Example
5865    /// ```
5866    /// # use google_cloud_resourcemanager_v3::builder::tag_values::SetIamPolicy;
5867    /// # async fn sample() -> google_cloud_resourcemanager_v3::Result<()> {
5868    ///
5869    /// let builder = prepare_request_builder();
5870    /// let response = builder.send().await?;
5871    /// # Ok(()) }
5872    ///
5873    /// fn prepare_request_builder() -> SetIamPolicy {
5874    ///   # panic!();
5875    ///   // ... details omitted ...
5876    /// }
5877    /// ```
5878    #[derive(Clone, Debug)]
5879    pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
5880
5881    impl SetIamPolicy {
5882        pub(crate) fn new(
5883            stub: std::sync::Arc<dyn super::super::stub::dynamic::TagValues>,
5884        ) -> Self {
5885            Self(RequestBuilder::new(stub))
5886        }
5887
5888        /// Sets the full request, replacing any prior values.
5889        pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
5890            mut self,
5891            v: V,
5892        ) -> Self {
5893            self.0.request = v.into();
5894            self
5895        }
5896
5897        /// Sets all the options, replacing any prior values.
5898        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5899            self.0.options = v.into();
5900            self
5901        }
5902
5903        /// Sends the request.
5904        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
5905            (*self.0.stub)
5906                .set_iam_policy(self.0.request, self.0.options)
5907                .await
5908                .map(crate::Response::into_body)
5909        }
5910
5911        /// Sets the value of [resource][google_cloud_iam_v1::model::SetIamPolicyRequest::resource].
5912        ///
5913        /// This is a **required** field for requests.
5914        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5915            self.0.request.resource = v.into();
5916            self
5917        }
5918
5919        /// Sets the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
5920        ///
5921        /// This is a **required** field for requests.
5922        pub fn set_policy<T>(mut self, v: T) -> Self
5923        where
5924            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
5925        {
5926            self.0.request.policy = std::option::Option::Some(v.into());
5927            self
5928        }
5929
5930        /// Sets or clears the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
5931        ///
5932        /// This is a **required** field for requests.
5933        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
5934        where
5935            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
5936        {
5937            self.0.request.policy = v.map(|x| x.into());
5938            self
5939        }
5940
5941        /// Sets the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
5942        pub fn set_update_mask<T>(mut self, v: T) -> Self
5943        where
5944            T: std::convert::Into<wkt::FieldMask>,
5945        {
5946            self.0.request.update_mask = std::option::Option::Some(v.into());
5947            self
5948        }
5949
5950        /// Sets or clears the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
5951        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5952        where
5953            T: std::convert::Into<wkt::FieldMask>,
5954        {
5955            self.0.request.update_mask = v.map(|x| x.into());
5956            self
5957        }
5958    }
5959
5960    #[doc(hidden)]
5961    impl crate::RequestBuilder for SetIamPolicy {
5962        fn request_options(&mut self) -> &mut crate::RequestOptions {
5963            &mut self.0.options
5964        }
5965    }
5966
5967    /// The request builder for [TagValues::test_iam_permissions][crate::client::TagValues::test_iam_permissions] calls.
5968    ///
5969    /// # Example
5970    /// ```
5971    /// # use google_cloud_resourcemanager_v3::builder::tag_values::TestIamPermissions;
5972    /// # async fn sample() -> google_cloud_resourcemanager_v3::Result<()> {
5973    ///
5974    /// let builder = prepare_request_builder();
5975    /// let response = builder.send().await?;
5976    /// # Ok(()) }
5977    ///
5978    /// fn prepare_request_builder() -> TestIamPermissions {
5979    ///   # panic!();
5980    ///   // ... details omitted ...
5981    /// }
5982    /// ```
5983    #[derive(Clone, Debug)]
5984    pub struct TestIamPermissions(
5985        RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
5986    );
5987
5988    impl TestIamPermissions {
5989        pub(crate) fn new(
5990            stub: std::sync::Arc<dyn super::super::stub::dynamic::TagValues>,
5991        ) -> Self {
5992            Self(RequestBuilder::new(stub))
5993        }
5994
5995        /// Sets the full request, replacing any prior values.
5996        pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
5997            mut self,
5998            v: V,
5999        ) -> Self {
6000            self.0.request = v.into();
6001            self
6002        }
6003
6004        /// Sets all the options, replacing any prior values.
6005        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6006            self.0.options = v.into();
6007            self
6008        }
6009
6010        /// Sends the request.
6011        pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
6012            (*self.0.stub)
6013                .test_iam_permissions(self.0.request, self.0.options)
6014                .await
6015                .map(crate::Response::into_body)
6016        }
6017
6018        /// Sets the value of [resource][google_cloud_iam_v1::model::TestIamPermissionsRequest::resource].
6019        ///
6020        /// This is a **required** field for requests.
6021        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
6022            self.0.request.resource = v.into();
6023            self
6024        }
6025
6026        /// Sets the value of [permissions][google_cloud_iam_v1::model::TestIamPermissionsRequest::permissions].
6027        ///
6028        /// This is a **required** field for requests.
6029        pub fn set_permissions<T, V>(mut self, v: T) -> Self
6030        where
6031            T: std::iter::IntoIterator<Item = V>,
6032            V: std::convert::Into<std::string::String>,
6033        {
6034            use std::iter::Iterator;
6035            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
6036            self
6037        }
6038    }
6039
6040    #[doc(hidden)]
6041    impl crate::RequestBuilder for TestIamPermissions {
6042        fn request_options(&mut self) -> &mut crate::RequestOptions {
6043            &mut self.0.options
6044        }
6045    }
6046
6047    /// The request builder for [TagValues::get_operation][crate::client::TagValues::get_operation] calls.
6048    ///
6049    /// # Example
6050    /// ```
6051    /// # use google_cloud_resourcemanager_v3::builder::tag_values::GetOperation;
6052    /// # async fn sample() -> google_cloud_resourcemanager_v3::Result<()> {
6053    ///
6054    /// let builder = prepare_request_builder();
6055    /// let response = builder.send().await?;
6056    /// # Ok(()) }
6057    ///
6058    /// fn prepare_request_builder() -> GetOperation {
6059    ///   # panic!();
6060    ///   // ... details omitted ...
6061    /// }
6062    /// ```
6063    #[derive(Clone, Debug)]
6064    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
6065
6066    impl GetOperation {
6067        pub(crate) fn new(
6068            stub: std::sync::Arc<dyn super::super::stub::dynamic::TagValues>,
6069        ) -> Self {
6070            Self(RequestBuilder::new(stub))
6071        }
6072
6073        /// Sets the full request, replacing any prior values.
6074        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
6075            mut self,
6076            v: V,
6077        ) -> Self {
6078            self.0.request = v.into();
6079            self
6080        }
6081
6082        /// Sets all the options, replacing any prior values.
6083        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6084            self.0.options = v.into();
6085            self
6086        }
6087
6088        /// Sends the request.
6089        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6090            (*self.0.stub)
6091                .get_operation(self.0.request, self.0.options)
6092                .await
6093                .map(crate::Response::into_body)
6094        }
6095
6096        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
6097        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6098            self.0.request.name = v.into();
6099            self
6100        }
6101    }
6102
6103    #[doc(hidden)]
6104    impl crate::RequestBuilder for GetOperation {
6105        fn request_options(&mut self) -> &mut crate::RequestOptions {
6106            &mut self.0.options
6107        }
6108    }
6109}