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