google_cloud_resourcemanager_v3/
builder.rs

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