Skip to main content

google_cloud_resourcemanager_v3/
builder.rs

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