google_cloud_asset_v1/
builder.rs

1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17pub mod asset_service {
18    use crate::Result;
19
20    /// A builder for [AssetService][crate::client::AssetService].
21    ///
22    /// ```
23    /// # tokio_test::block_on(async {
24    /// # use google_cloud_asset_v1::*;
25    /// # use builder::asset_service::ClientBuilder;
26    /// # use client::AssetService;
27    /// let builder : ClientBuilder = AssetService::builder();
28    /// let client = builder
29    ///     .with_endpoint("https://cloudasset.googleapis.com")
30    ///     .build().await?;
31    /// # gax::client_builder::Result::<()>::Ok(()) });
32    /// ```
33    pub type ClientBuilder =
34        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
35
36    pub(crate) mod client {
37        use super::super::super::client::AssetService;
38        pub struct Factory;
39        impl gax::client_builder::internal::ClientFactory for Factory {
40            type Client = AssetService;
41            type Credentials = gaxi::options::Credentials;
42            async fn build(
43                self,
44                config: gaxi::options::ClientConfig,
45            ) -> gax::client_builder::Result<Self::Client> {
46                Self::Client::new(config).await
47            }
48        }
49    }
50
51    /// Common implementation for [crate::client::AssetService] 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::AssetService>,
55        request: R,
56        options: gax::options::RequestOptions,
57    }
58
59    impl<R> RequestBuilder<R>
60    where
61        R: std::default::Default,
62    {
63        pub(crate) fn new(
64            stub: std::sync::Arc<dyn super::super::stub::dynamic::AssetService>,
65        ) -> Self {
66            Self {
67                stub,
68                request: R::default(),
69                options: gax::options::RequestOptions::default(),
70            }
71        }
72    }
73
74    /// The request builder for [AssetService::export_assets][crate::client::AssetService::export_assets] calls.
75    ///
76    /// # Example
77    /// ```no_run
78    /// # use google_cloud_asset_v1::builder;
79    /// use builder::asset_service::ExportAssets;
80    /// # tokio_test::block_on(async {
81    /// use lro::Poller;
82    ///
83    /// let builder = prepare_request_builder();
84    /// let response = builder.poller().until_done().await?;
85    /// # gax::Result::<()>::Ok(()) });
86    ///
87    /// fn prepare_request_builder() -> ExportAssets {
88    ///   # panic!();
89    ///   // ... details omitted ...
90    /// }
91    /// ```
92    #[derive(Clone, Debug)]
93    pub struct ExportAssets(RequestBuilder<crate::model::ExportAssetsRequest>);
94
95    impl ExportAssets {
96        pub(crate) fn new(
97            stub: std::sync::Arc<dyn super::super::stub::dynamic::AssetService>,
98        ) -> Self {
99            Self(RequestBuilder::new(stub))
100        }
101
102        /// Sets the full request, replacing any prior values.
103        pub fn with_request<V: Into<crate::model::ExportAssetsRequest>>(mut self, v: V) -> Self {
104            self.0.request = v.into();
105            self
106        }
107
108        /// Sets all the options, replacing any prior values.
109        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
110            self.0.options = v.into();
111            self
112        }
113
114        /// Sends the request.
115        ///
116        /// # Long running operations
117        ///
118        /// This starts, but does not poll, a longrunning operation. More information
119        /// on [export_assets][crate::client::AssetService::export_assets].
120        pub async fn send(self) -> Result<longrunning::model::Operation> {
121            (*self.0.stub)
122                .export_assets(self.0.request, self.0.options)
123                .await
124                .map(gax::response::Response::into_body)
125        }
126
127        /// Creates a [Poller][lro::Poller] to work with `export_assets`.
128        pub fn poller(
129            self,
130        ) -> impl lro::Poller<crate::model::ExportAssetsResponse, crate::model::ExportAssetsRequest>
131        {
132            type Operation = lro::internal::Operation<
133                crate::model::ExportAssetsResponse,
134                crate::model::ExportAssetsRequest,
135            >;
136            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
137            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
138
139            let stub = self.0.stub.clone();
140            let mut options = self.0.options.clone();
141            options.set_retry_policy(gax::retry_policy::NeverRetry);
142            let query = move |name| {
143                let stub = stub.clone();
144                let options = options.clone();
145                async {
146                    let op = GetOperation::new(stub)
147                        .set_name(name)
148                        .with_options(options)
149                        .send()
150                        .await?;
151                    Ok(Operation::new(op))
152                }
153            };
154
155            let start = move || async {
156                let op = self.send().await?;
157                Ok(Operation::new(op))
158            };
159
160            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
161        }
162
163        /// Sets the value of [parent][crate::model::ExportAssetsRequest::parent].
164        ///
165        /// This is a **required** field for requests.
166        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
167            self.0.request.parent = v.into();
168            self
169        }
170
171        /// Sets the value of [read_time][crate::model::ExportAssetsRequest::read_time].
172        pub fn set_read_time<T>(mut self, v: T) -> Self
173        where
174            T: std::convert::Into<wkt::Timestamp>,
175        {
176            self.0.request.read_time = std::option::Option::Some(v.into());
177            self
178        }
179
180        /// Sets or clears the value of [read_time][crate::model::ExportAssetsRequest::read_time].
181        pub fn set_or_clear_read_time<T>(mut self, v: std::option::Option<T>) -> Self
182        where
183            T: std::convert::Into<wkt::Timestamp>,
184        {
185            self.0.request.read_time = v.map(|x| x.into());
186            self
187        }
188
189        /// Sets the value of [asset_types][crate::model::ExportAssetsRequest::asset_types].
190        pub fn set_asset_types<T, V>(mut self, v: T) -> Self
191        where
192            T: std::iter::IntoIterator<Item = V>,
193            V: std::convert::Into<std::string::String>,
194        {
195            use std::iter::Iterator;
196            self.0.request.asset_types = v.into_iter().map(|i| i.into()).collect();
197            self
198        }
199
200        /// Sets the value of [content_type][crate::model::ExportAssetsRequest::content_type].
201        pub fn set_content_type<T: Into<crate::model::ContentType>>(mut self, v: T) -> Self {
202            self.0.request.content_type = v.into();
203            self
204        }
205
206        /// Sets the value of [output_config][crate::model::ExportAssetsRequest::output_config].
207        ///
208        /// This is a **required** field for requests.
209        pub fn set_output_config<T>(mut self, v: T) -> Self
210        where
211            T: std::convert::Into<crate::model::OutputConfig>,
212        {
213            self.0.request.output_config = std::option::Option::Some(v.into());
214            self
215        }
216
217        /// Sets or clears the value of [output_config][crate::model::ExportAssetsRequest::output_config].
218        ///
219        /// This is a **required** field for requests.
220        pub fn set_or_clear_output_config<T>(mut self, v: std::option::Option<T>) -> Self
221        where
222            T: std::convert::Into<crate::model::OutputConfig>,
223        {
224            self.0.request.output_config = v.map(|x| x.into());
225            self
226        }
227
228        /// Sets the value of [relationship_types][crate::model::ExportAssetsRequest::relationship_types].
229        pub fn set_relationship_types<T, V>(mut self, v: T) -> Self
230        where
231            T: std::iter::IntoIterator<Item = V>,
232            V: std::convert::Into<std::string::String>,
233        {
234            use std::iter::Iterator;
235            self.0.request.relationship_types = v.into_iter().map(|i| i.into()).collect();
236            self
237        }
238    }
239
240    #[doc(hidden)]
241    impl gax::options::internal::RequestBuilder for ExportAssets {
242        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
243            &mut self.0.options
244        }
245    }
246
247    /// The request builder for [AssetService::list_assets][crate::client::AssetService::list_assets] calls.
248    ///
249    /// # Example
250    /// ```no_run
251    /// # use google_cloud_asset_v1::builder;
252    /// use builder::asset_service::ListAssets;
253    /// # tokio_test::block_on(async {
254    /// use gax::paginator::ItemPaginator;
255    ///
256    /// let builder = prepare_request_builder();
257    /// let mut items = builder.by_item();
258    /// while let Some(result) = items.next().await {
259    ///   let item = result?;
260    /// }
261    /// # gax::Result::<()>::Ok(()) });
262    ///
263    /// fn prepare_request_builder() -> ListAssets {
264    ///   # panic!();
265    ///   // ... details omitted ...
266    /// }
267    /// ```
268    #[derive(Clone, Debug)]
269    pub struct ListAssets(RequestBuilder<crate::model::ListAssetsRequest>);
270
271    impl ListAssets {
272        pub(crate) fn new(
273            stub: std::sync::Arc<dyn super::super::stub::dynamic::AssetService>,
274        ) -> Self {
275            Self(RequestBuilder::new(stub))
276        }
277
278        /// Sets the full request, replacing any prior values.
279        pub fn with_request<V: Into<crate::model::ListAssetsRequest>>(mut self, v: V) -> Self {
280            self.0.request = v.into();
281            self
282        }
283
284        /// Sets all the options, replacing any prior values.
285        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
286            self.0.options = v.into();
287            self
288        }
289
290        /// Sends the request.
291        pub async fn send(self) -> Result<crate::model::ListAssetsResponse> {
292            (*self.0.stub)
293                .list_assets(self.0.request, self.0.options)
294                .await
295                .map(gax::response::Response::into_body)
296        }
297
298        /// Streams each page in the collection.
299        pub fn by_page(
300            self,
301        ) -> impl gax::paginator::Paginator<crate::model::ListAssetsResponse, gax::error::Error>
302        {
303            use std::clone::Clone;
304            let token = self.0.request.page_token.clone();
305            let execute = move |token: String| {
306                let mut builder = self.clone();
307                builder.0.request = builder.0.request.set_page_token(token);
308                builder.send()
309            };
310            gax::paginator::internal::new_paginator(token, execute)
311        }
312
313        /// Streams each item in the collection.
314        pub fn by_item(
315            self,
316        ) -> impl gax::paginator::ItemPaginator<crate::model::ListAssetsResponse, gax::error::Error>
317        {
318            use gax::paginator::Paginator;
319            self.by_page().items()
320        }
321
322        /// Sets the value of [parent][crate::model::ListAssetsRequest::parent].
323        ///
324        /// This is a **required** field for requests.
325        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
326            self.0.request.parent = v.into();
327            self
328        }
329
330        /// Sets the value of [read_time][crate::model::ListAssetsRequest::read_time].
331        pub fn set_read_time<T>(mut self, v: T) -> Self
332        where
333            T: std::convert::Into<wkt::Timestamp>,
334        {
335            self.0.request.read_time = std::option::Option::Some(v.into());
336            self
337        }
338
339        /// Sets or clears the value of [read_time][crate::model::ListAssetsRequest::read_time].
340        pub fn set_or_clear_read_time<T>(mut self, v: std::option::Option<T>) -> Self
341        where
342            T: std::convert::Into<wkt::Timestamp>,
343        {
344            self.0.request.read_time = v.map(|x| x.into());
345            self
346        }
347
348        /// Sets the value of [asset_types][crate::model::ListAssetsRequest::asset_types].
349        pub fn set_asset_types<T, V>(mut self, v: T) -> Self
350        where
351            T: std::iter::IntoIterator<Item = V>,
352            V: std::convert::Into<std::string::String>,
353        {
354            use std::iter::Iterator;
355            self.0.request.asset_types = v.into_iter().map(|i| i.into()).collect();
356            self
357        }
358
359        /// Sets the value of [content_type][crate::model::ListAssetsRequest::content_type].
360        pub fn set_content_type<T: Into<crate::model::ContentType>>(mut self, v: T) -> Self {
361            self.0.request.content_type = v.into();
362            self
363        }
364
365        /// Sets the value of [page_size][crate::model::ListAssetsRequest::page_size].
366        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
367            self.0.request.page_size = v.into();
368            self
369        }
370
371        /// Sets the value of [page_token][crate::model::ListAssetsRequest::page_token].
372        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
373            self.0.request.page_token = v.into();
374            self
375        }
376
377        /// Sets the value of [relationship_types][crate::model::ListAssetsRequest::relationship_types].
378        pub fn set_relationship_types<T, V>(mut self, v: T) -> Self
379        where
380            T: std::iter::IntoIterator<Item = V>,
381            V: std::convert::Into<std::string::String>,
382        {
383            use std::iter::Iterator;
384            self.0.request.relationship_types = v.into_iter().map(|i| i.into()).collect();
385            self
386        }
387    }
388
389    #[doc(hidden)]
390    impl gax::options::internal::RequestBuilder for ListAssets {
391        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
392            &mut self.0.options
393        }
394    }
395
396    /// The request builder for [AssetService::batch_get_assets_history][crate::client::AssetService::batch_get_assets_history] calls.
397    ///
398    /// # Example
399    /// ```no_run
400    /// # use google_cloud_asset_v1::builder;
401    /// use builder::asset_service::BatchGetAssetsHistory;
402    /// # tokio_test::block_on(async {
403    ///
404    /// let builder = prepare_request_builder();
405    /// let response = builder.send().await?;
406    /// # gax::Result::<()>::Ok(()) });
407    ///
408    /// fn prepare_request_builder() -> BatchGetAssetsHistory {
409    ///   # panic!();
410    ///   // ... details omitted ...
411    /// }
412    /// ```
413    #[derive(Clone, Debug)]
414    pub struct BatchGetAssetsHistory(RequestBuilder<crate::model::BatchGetAssetsHistoryRequest>);
415
416    impl BatchGetAssetsHistory {
417        pub(crate) fn new(
418            stub: std::sync::Arc<dyn super::super::stub::dynamic::AssetService>,
419        ) -> Self {
420            Self(RequestBuilder::new(stub))
421        }
422
423        /// Sets the full request, replacing any prior values.
424        pub fn with_request<V: Into<crate::model::BatchGetAssetsHistoryRequest>>(
425            mut self,
426            v: V,
427        ) -> Self {
428            self.0.request = v.into();
429            self
430        }
431
432        /// Sets all the options, replacing any prior values.
433        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
434            self.0.options = v.into();
435            self
436        }
437
438        /// Sends the request.
439        pub async fn send(self) -> Result<crate::model::BatchGetAssetsHistoryResponse> {
440            (*self.0.stub)
441                .batch_get_assets_history(self.0.request, self.0.options)
442                .await
443                .map(gax::response::Response::into_body)
444        }
445
446        /// Sets the value of [parent][crate::model::BatchGetAssetsHistoryRequest::parent].
447        ///
448        /// This is a **required** field for requests.
449        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
450            self.0.request.parent = v.into();
451            self
452        }
453
454        /// Sets the value of [asset_names][crate::model::BatchGetAssetsHistoryRequest::asset_names].
455        pub fn set_asset_names<T, V>(mut self, v: T) -> Self
456        where
457            T: std::iter::IntoIterator<Item = V>,
458            V: std::convert::Into<std::string::String>,
459        {
460            use std::iter::Iterator;
461            self.0.request.asset_names = v.into_iter().map(|i| i.into()).collect();
462            self
463        }
464
465        /// Sets the value of [content_type][crate::model::BatchGetAssetsHistoryRequest::content_type].
466        pub fn set_content_type<T: Into<crate::model::ContentType>>(mut self, v: T) -> Self {
467            self.0.request.content_type = v.into();
468            self
469        }
470
471        /// Sets the value of [read_time_window][crate::model::BatchGetAssetsHistoryRequest::read_time_window].
472        pub fn set_read_time_window<T>(mut self, v: T) -> Self
473        where
474            T: std::convert::Into<crate::model::TimeWindow>,
475        {
476            self.0.request.read_time_window = std::option::Option::Some(v.into());
477            self
478        }
479
480        /// Sets or clears the value of [read_time_window][crate::model::BatchGetAssetsHistoryRequest::read_time_window].
481        pub fn set_or_clear_read_time_window<T>(mut self, v: std::option::Option<T>) -> Self
482        where
483            T: std::convert::Into<crate::model::TimeWindow>,
484        {
485            self.0.request.read_time_window = v.map(|x| x.into());
486            self
487        }
488
489        /// Sets the value of [relationship_types][crate::model::BatchGetAssetsHistoryRequest::relationship_types].
490        pub fn set_relationship_types<T, V>(mut self, v: T) -> Self
491        where
492            T: std::iter::IntoIterator<Item = V>,
493            V: std::convert::Into<std::string::String>,
494        {
495            use std::iter::Iterator;
496            self.0.request.relationship_types = v.into_iter().map(|i| i.into()).collect();
497            self
498        }
499    }
500
501    #[doc(hidden)]
502    impl gax::options::internal::RequestBuilder for BatchGetAssetsHistory {
503        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
504            &mut self.0.options
505        }
506    }
507
508    /// The request builder for [AssetService::create_feed][crate::client::AssetService::create_feed] calls.
509    ///
510    /// # Example
511    /// ```no_run
512    /// # use google_cloud_asset_v1::builder;
513    /// use builder::asset_service::CreateFeed;
514    /// # tokio_test::block_on(async {
515    ///
516    /// let builder = prepare_request_builder();
517    /// let response = builder.send().await?;
518    /// # gax::Result::<()>::Ok(()) });
519    ///
520    /// fn prepare_request_builder() -> CreateFeed {
521    ///   # panic!();
522    ///   // ... details omitted ...
523    /// }
524    /// ```
525    #[derive(Clone, Debug)]
526    pub struct CreateFeed(RequestBuilder<crate::model::CreateFeedRequest>);
527
528    impl CreateFeed {
529        pub(crate) fn new(
530            stub: std::sync::Arc<dyn super::super::stub::dynamic::AssetService>,
531        ) -> Self {
532            Self(RequestBuilder::new(stub))
533        }
534
535        /// Sets the full request, replacing any prior values.
536        pub fn with_request<V: Into<crate::model::CreateFeedRequest>>(mut self, v: V) -> Self {
537            self.0.request = v.into();
538            self
539        }
540
541        /// Sets all the options, replacing any prior values.
542        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
543            self.0.options = v.into();
544            self
545        }
546
547        /// Sends the request.
548        pub async fn send(self) -> Result<crate::model::Feed> {
549            (*self.0.stub)
550                .create_feed(self.0.request, self.0.options)
551                .await
552                .map(gax::response::Response::into_body)
553        }
554
555        /// Sets the value of [parent][crate::model::CreateFeedRequest::parent].
556        ///
557        /// This is a **required** field for requests.
558        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
559            self.0.request.parent = v.into();
560            self
561        }
562
563        /// Sets the value of [feed_id][crate::model::CreateFeedRequest::feed_id].
564        ///
565        /// This is a **required** field for requests.
566        pub fn set_feed_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
567            self.0.request.feed_id = v.into();
568            self
569        }
570
571        /// Sets the value of [feed][crate::model::CreateFeedRequest::feed].
572        ///
573        /// This is a **required** field for requests.
574        pub fn set_feed<T>(mut self, v: T) -> Self
575        where
576            T: std::convert::Into<crate::model::Feed>,
577        {
578            self.0.request.feed = std::option::Option::Some(v.into());
579            self
580        }
581
582        /// Sets or clears the value of [feed][crate::model::CreateFeedRequest::feed].
583        ///
584        /// This is a **required** field for requests.
585        pub fn set_or_clear_feed<T>(mut self, v: std::option::Option<T>) -> Self
586        where
587            T: std::convert::Into<crate::model::Feed>,
588        {
589            self.0.request.feed = v.map(|x| x.into());
590            self
591        }
592    }
593
594    #[doc(hidden)]
595    impl gax::options::internal::RequestBuilder for CreateFeed {
596        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
597            &mut self.0.options
598        }
599    }
600
601    /// The request builder for [AssetService::get_feed][crate::client::AssetService::get_feed] calls.
602    ///
603    /// # Example
604    /// ```no_run
605    /// # use google_cloud_asset_v1::builder;
606    /// use builder::asset_service::GetFeed;
607    /// # tokio_test::block_on(async {
608    ///
609    /// let builder = prepare_request_builder();
610    /// let response = builder.send().await?;
611    /// # gax::Result::<()>::Ok(()) });
612    ///
613    /// fn prepare_request_builder() -> GetFeed {
614    ///   # panic!();
615    ///   // ... details omitted ...
616    /// }
617    /// ```
618    #[derive(Clone, Debug)]
619    pub struct GetFeed(RequestBuilder<crate::model::GetFeedRequest>);
620
621    impl GetFeed {
622        pub(crate) fn new(
623            stub: std::sync::Arc<dyn super::super::stub::dynamic::AssetService>,
624        ) -> Self {
625            Self(RequestBuilder::new(stub))
626        }
627
628        /// Sets the full request, replacing any prior values.
629        pub fn with_request<V: Into<crate::model::GetFeedRequest>>(mut self, v: V) -> Self {
630            self.0.request = v.into();
631            self
632        }
633
634        /// Sets all the options, replacing any prior values.
635        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
636            self.0.options = v.into();
637            self
638        }
639
640        /// Sends the request.
641        pub async fn send(self) -> Result<crate::model::Feed> {
642            (*self.0.stub)
643                .get_feed(self.0.request, self.0.options)
644                .await
645                .map(gax::response::Response::into_body)
646        }
647
648        /// Sets the value of [name][crate::model::GetFeedRequest::name].
649        ///
650        /// This is a **required** field for requests.
651        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
652            self.0.request.name = v.into();
653            self
654        }
655    }
656
657    #[doc(hidden)]
658    impl gax::options::internal::RequestBuilder for GetFeed {
659        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
660            &mut self.0.options
661        }
662    }
663
664    /// The request builder for [AssetService::list_feeds][crate::client::AssetService::list_feeds] calls.
665    ///
666    /// # Example
667    /// ```no_run
668    /// # use google_cloud_asset_v1::builder;
669    /// use builder::asset_service::ListFeeds;
670    /// # tokio_test::block_on(async {
671    ///
672    /// let builder = prepare_request_builder();
673    /// let response = builder.send().await?;
674    /// # gax::Result::<()>::Ok(()) });
675    ///
676    /// fn prepare_request_builder() -> ListFeeds {
677    ///   # panic!();
678    ///   // ... details omitted ...
679    /// }
680    /// ```
681    #[derive(Clone, Debug)]
682    pub struct ListFeeds(RequestBuilder<crate::model::ListFeedsRequest>);
683
684    impl ListFeeds {
685        pub(crate) fn new(
686            stub: std::sync::Arc<dyn super::super::stub::dynamic::AssetService>,
687        ) -> Self {
688            Self(RequestBuilder::new(stub))
689        }
690
691        /// Sets the full request, replacing any prior values.
692        pub fn with_request<V: Into<crate::model::ListFeedsRequest>>(mut self, v: V) -> Self {
693            self.0.request = v.into();
694            self
695        }
696
697        /// Sets all the options, replacing any prior values.
698        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
699            self.0.options = v.into();
700            self
701        }
702
703        /// Sends the request.
704        pub async fn send(self) -> Result<crate::model::ListFeedsResponse> {
705            (*self.0.stub)
706                .list_feeds(self.0.request, self.0.options)
707                .await
708                .map(gax::response::Response::into_body)
709        }
710
711        /// Sets the value of [parent][crate::model::ListFeedsRequest::parent].
712        ///
713        /// This is a **required** field for requests.
714        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
715            self.0.request.parent = v.into();
716            self
717        }
718    }
719
720    #[doc(hidden)]
721    impl gax::options::internal::RequestBuilder for ListFeeds {
722        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
723            &mut self.0.options
724        }
725    }
726
727    /// The request builder for [AssetService::update_feed][crate::client::AssetService::update_feed] calls.
728    ///
729    /// # Example
730    /// ```no_run
731    /// # use google_cloud_asset_v1::builder;
732    /// use builder::asset_service::UpdateFeed;
733    /// # tokio_test::block_on(async {
734    ///
735    /// let builder = prepare_request_builder();
736    /// let response = builder.send().await?;
737    /// # gax::Result::<()>::Ok(()) });
738    ///
739    /// fn prepare_request_builder() -> UpdateFeed {
740    ///   # panic!();
741    ///   // ... details omitted ...
742    /// }
743    /// ```
744    #[derive(Clone, Debug)]
745    pub struct UpdateFeed(RequestBuilder<crate::model::UpdateFeedRequest>);
746
747    impl UpdateFeed {
748        pub(crate) fn new(
749            stub: std::sync::Arc<dyn super::super::stub::dynamic::AssetService>,
750        ) -> Self {
751            Self(RequestBuilder::new(stub))
752        }
753
754        /// Sets the full request, replacing any prior values.
755        pub fn with_request<V: Into<crate::model::UpdateFeedRequest>>(mut self, v: V) -> Self {
756            self.0.request = v.into();
757            self
758        }
759
760        /// Sets all the options, replacing any prior values.
761        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
762            self.0.options = v.into();
763            self
764        }
765
766        /// Sends the request.
767        pub async fn send(self) -> Result<crate::model::Feed> {
768            (*self.0.stub)
769                .update_feed(self.0.request, self.0.options)
770                .await
771                .map(gax::response::Response::into_body)
772        }
773
774        /// Sets the value of [feed][crate::model::UpdateFeedRequest::feed].
775        ///
776        /// This is a **required** field for requests.
777        pub fn set_feed<T>(mut self, v: T) -> Self
778        where
779            T: std::convert::Into<crate::model::Feed>,
780        {
781            self.0.request.feed = std::option::Option::Some(v.into());
782            self
783        }
784
785        /// Sets or clears the value of [feed][crate::model::UpdateFeedRequest::feed].
786        ///
787        /// This is a **required** field for requests.
788        pub fn set_or_clear_feed<T>(mut self, v: std::option::Option<T>) -> Self
789        where
790            T: std::convert::Into<crate::model::Feed>,
791        {
792            self.0.request.feed = v.map(|x| x.into());
793            self
794        }
795
796        /// Sets the value of [update_mask][crate::model::UpdateFeedRequest::update_mask].
797        ///
798        /// This is a **required** field for requests.
799        pub fn set_update_mask<T>(mut self, v: T) -> Self
800        where
801            T: std::convert::Into<wkt::FieldMask>,
802        {
803            self.0.request.update_mask = std::option::Option::Some(v.into());
804            self
805        }
806
807        /// Sets or clears the value of [update_mask][crate::model::UpdateFeedRequest::update_mask].
808        ///
809        /// This is a **required** field for requests.
810        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
811        where
812            T: std::convert::Into<wkt::FieldMask>,
813        {
814            self.0.request.update_mask = v.map(|x| x.into());
815            self
816        }
817    }
818
819    #[doc(hidden)]
820    impl gax::options::internal::RequestBuilder for UpdateFeed {
821        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
822            &mut self.0.options
823        }
824    }
825
826    /// The request builder for [AssetService::delete_feed][crate::client::AssetService::delete_feed] calls.
827    ///
828    /// # Example
829    /// ```no_run
830    /// # use google_cloud_asset_v1::builder;
831    /// use builder::asset_service::DeleteFeed;
832    /// # tokio_test::block_on(async {
833    ///
834    /// let builder = prepare_request_builder();
835    /// let response = builder.send().await?;
836    /// # gax::Result::<()>::Ok(()) });
837    ///
838    /// fn prepare_request_builder() -> DeleteFeed {
839    ///   # panic!();
840    ///   // ... details omitted ...
841    /// }
842    /// ```
843    #[derive(Clone, Debug)]
844    pub struct DeleteFeed(RequestBuilder<crate::model::DeleteFeedRequest>);
845
846    impl DeleteFeed {
847        pub(crate) fn new(
848            stub: std::sync::Arc<dyn super::super::stub::dynamic::AssetService>,
849        ) -> Self {
850            Self(RequestBuilder::new(stub))
851        }
852
853        /// Sets the full request, replacing any prior values.
854        pub fn with_request<V: Into<crate::model::DeleteFeedRequest>>(mut self, v: V) -> Self {
855            self.0.request = v.into();
856            self
857        }
858
859        /// Sets all the options, replacing any prior values.
860        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
861            self.0.options = v.into();
862            self
863        }
864
865        /// Sends the request.
866        pub async fn send(self) -> Result<()> {
867            (*self.0.stub)
868                .delete_feed(self.0.request, self.0.options)
869                .await
870                .map(gax::response::Response::into_body)
871        }
872
873        /// Sets the value of [name][crate::model::DeleteFeedRequest::name].
874        ///
875        /// This is a **required** field for requests.
876        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
877            self.0.request.name = v.into();
878            self
879        }
880    }
881
882    #[doc(hidden)]
883    impl gax::options::internal::RequestBuilder for DeleteFeed {
884        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
885            &mut self.0.options
886        }
887    }
888
889    /// The request builder for [AssetService::search_all_resources][crate::client::AssetService::search_all_resources] calls.
890    ///
891    /// # Example
892    /// ```no_run
893    /// # use google_cloud_asset_v1::builder;
894    /// use builder::asset_service::SearchAllResources;
895    /// # tokio_test::block_on(async {
896    /// use gax::paginator::ItemPaginator;
897    ///
898    /// let builder = prepare_request_builder();
899    /// let mut items = builder.by_item();
900    /// while let Some(result) = items.next().await {
901    ///   let item = result?;
902    /// }
903    /// # gax::Result::<()>::Ok(()) });
904    ///
905    /// fn prepare_request_builder() -> SearchAllResources {
906    ///   # panic!();
907    ///   // ... details omitted ...
908    /// }
909    /// ```
910    #[derive(Clone, Debug)]
911    pub struct SearchAllResources(RequestBuilder<crate::model::SearchAllResourcesRequest>);
912
913    impl SearchAllResources {
914        pub(crate) fn new(
915            stub: std::sync::Arc<dyn super::super::stub::dynamic::AssetService>,
916        ) -> Self {
917            Self(RequestBuilder::new(stub))
918        }
919
920        /// Sets the full request, replacing any prior values.
921        pub fn with_request<V: Into<crate::model::SearchAllResourcesRequest>>(
922            mut self,
923            v: V,
924        ) -> Self {
925            self.0.request = v.into();
926            self
927        }
928
929        /// Sets all the options, replacing any prior values.
930        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
931            self.0.options = v.into();
932            self
933        }
934
935        /// Sends the request.
936        pub async fn send(self) -> Result<crate::model::SearchAllResourcesResponse> {
937            (*self.0.stub)
938                .search_all_resources(self.0.request, self.0.options)
939                .await
940                .map(gax::response::Response::into_body)
941        }
942
943        /// Streams each page in the collection.
944        pub fn by_page(
945            self,
946        ) -> impl gax::paginator::Paginator<crate::model::SearchAllResourcesResponse, gax::error::Error>
947        {
948            use std::clone::Clone;
949            let token = self.0.request.page_token.clone();
950            let execute = move |token: String| {
951                let mut builder = self.clone();
952                builder.0.request = builder.0.request.set_page_token(token);
953                builder.send()
954            };
955            gax::paginator::internal::new_paginator(token, execute)
956        }
957
958        /// Streams each item in the collection.
959        pub fn by_item(
960            self,
961        ) -> impl gax::paginator::ItemPaginator<
962            crate::model::SearchAllResourcesResponse,
963            gax::error::Error,
964        > {
965            use gax::paginator::Paginator;
966            self.by_page().items()
967        }
968
969        /// Sets the value of [scope][crate::model::SearchAllResourcesRequest::scope].
970        ///
971        /// This is a **required** field for requests.
972        pub fn set_scope<T: Into<std::string::String>>(mut self, v: T) -> Self {
973            self.0.request.scope = v.into();
974            self
975        }
976
977        /// Sets the value of [query][crate::model::SearchAllResourcesRequest::query].
978        pub fn set_query<T: Into<std::string::String>>(mut self, v: T) -> Self {
979            self.0.request.query = v.into();
980            self
981        }
982
983        /// Sets the value of [asset_types][crate::model::SearchAllResourcesRequest::asset_types].
984        pub fn set_asset_types<T, V>(mut self, v: T) -> Self
985        where
986            T: std::iter::IntoIterator<Item = V>,
987            V: std::convert::Into<std::string::String>,
988        {
989            use std::iter::Iterator;
990            self.0.request.asset_types = v.into_iter().map(|i| i.into()).collect();
991            self
992        }
993
994        /// Sets the value of [page_size][crate::model::SearchAllResourcesRequest::page_size].
995        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
996            self.0.request.page_size = v.into();
997            self
998        }
999
1000        /// Sets the value of [page_token][crate::model::SearchAllResourcesRequest::page_token].
1001        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1002            self.0.request.page_token = v.into();
1003            self
1004        }
1005
1006        /// Sets the value of [order_by][crate::model::SearchAllResourcesRequest::order_by].
1007        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1008            self.0.request.order_by = v.into();
1009            self
1010        }
1011
1012        /// Sets the value of [read_mask][crate::model::SearchAllResourcesRequest::read_mask].
1013        pub fn set_read_mask<T>(mut self, v: T) -> Self
1014        where
1015            T: std::convert::Into<wkt::FieldMask>,
1016        {
1017            self.0.request.read_mask = std::option::Option::Some(v.into());
1018            self
1019        }
1020
1021        /// Sets or clears the value of [read_mask][crate::model::SearchAllResourcesRequest::read_mask].
1022        pub fn set_or_clear_read_mask<T>(mut self, v: std::option::Option<T>) -> Self
1023        where
1024            T: std::convert::Into<wkt::FieldMask>,
1025        {
1026            self.0.request.read_mask = v.map(|x| x.into());
1027            self
1028        }
1029    }
1030
1031    #[doc(hidden)]
1032    impl gax::options::internal::RequestBuilder for SearchAllResources {
1033        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1034            &mut self.0.options
1035        }
1036    }
1037
1038    /// The request builder for [AssetService::search_all_iam_policies][crate::client::AssetService::search_all_iam_policies] calls.
1039    ///
1040    /// # Example
1041    /// ```no_run
1042    /// # use google_cloud_asset_v1::builder;
1043    /// use builder::asset_service::SearchAllIamPolicies;
1044    /// # tokio_test::block_on(async {
1045    /// use gax::paginator::ItemPaginator;
1046    ///
1047    /// let builder = prepare_request_builder();
1048    /// let mut items = builder.by_item();
1049    /// while let Some(result) = items.next().await {
1050    ///   let item = result?;
1051    /// }
1052    /// # gax::Result::<()>::Ok(()) });
1053    ///
1054    /// fn prepare_request_builder() -> SearchAllIamPolicies {
1055    ///   # panic!();
1056    ///   // ... details omitted ...
1057    /// }
1058    /// ```
1059    #[derive(Clone, Debug)]
1060    pub struct SearchAllIamPolicies(RequestBuilder<crate::model::SearchAllIamPoliciesRequest>);
1061
1062    impl SearchAllIamPolicies {
1063        pub(crate) fn new(
1064            stub: std::sync::Arc<dyn super::super::stub::dynamic::AssetService>,
1065        ) -> Self {
1066            Self(RequestBuilder::new(stub))
1067        }
1068
1069        /// Sets the full request, replacing any prior values.
1070        pub fn with_request<V: Into<crate::model::SearchAllIamPoliciesRequest>>(
1071            mut self,
1072            v: V,
1073        ) -> Self {
1074            self.0.request = v.into();
1075            self
1076        }
1077
1078        /// Sets all the options, replacing any prior values.
1079        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1080            self.0.options = v.into();
1081            self
1082        }
1083
1084        /// Sends the request.
1085        pub async fn send(self) -> Result<crate::model::SearchAllIamPoliciesResponse> {
1086            (*self.0.stub)
1087                .search_all_iam_policies(self.0.request, self.0.options)
1088                .await
1089                .map(gax::response::Response::into_body)
1090        }
1091
1092        /// Streams each page in the collection.
1093        pub fn by_page(
1094            self,
1095        ) -> impl gax::paginator::Paginator<crate::model::SearchAllIamPoliciesResponse, gax::error::Error>
1096        {
1097            use std::clone::Clone;
1098            let token = self.0.request.page_token.clone();
1099            let execute = move |token: String| {
1100                let mut builder = self.clone();
1101                builder.0.request = builder.0.request.set_page_token(token);
1102                builder.send()
1103            };
1104            gax::paginator::internal::new_paginator(token, execute)
1105        }
1106
1107        /// Streams each item in the collection.
1108        pub fn by_item(
1109            self,
1110        ) -> impl gax::paginator::ItemPaginator<
1111            crate::model::SearchAllIamPoliciesResponse,
1112            gax::error::Error,
1113        > {
1114            use gax::paginator::Paginator;
1115            self.by_page().items()
1116        }
1117
1118        /// Sets the value of [scope][crate::model::SearchAllIamPoliciesRequest::scope].
1119        ///
1120        /// This is a **required** field for requests.
1121        pub fn set_scope<T: Into<std::string::String>>(mut self, v: T) -> Self {
1122            self.0.request.scope = v.into();
1123            self
1124        }
1125
1126        /// Sets the value of [query][crate::model::SearchAllIamPoliciesRequest::query].
1127        pub fn set_query<T: Into<std::string::String>>(mut self, v: T) -> Self {
1128            self.0.request.query = v.into();
1129            self
1130        }
1131
1132        /// Sets the value of [page_size][crate::model::SearchAllIamPoliciesRequest::page_size].
1133        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1134            self.0.request.page_size = v.into();
1135            self
1136        }
1137
1138        /// Sets the value of [page_token][crate::model::SearchAllIamPoliciesRequest::page_token].
1139        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1140            self.0.request.page_token = v.into();
1141            self
1142        }
1143
1144        /// Sets the value of [asset_types][crate::model::SearchAllIamPoliciesRequest::asset_types].
1145        pub fn set_asset_types<T, V>(mut self, v: T) -> Self
1146        where
1147            T: std::iter::IntoIterator<Item = V>,
1148            V: std::convert::Into<std::string::String>,
1149        {
1150            use std::iter::Iterator;
1151            self.0.request.asset_types = v.into_iter().map(|i| i.into()).collect();
1152            self
1153        }
1154
1155        /// Sets the value of [order_by][crate::model::SearchAllIamPoliciesRequest::order_by].
1156        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1157            self.0.request.order_by = v.into();
1158            self
1159        }
1160    }
1161
1162    #[doc(hidden)]
1163    impl gax::options::internal::RequestBuilder for SearchAllIamPolicies {
1164        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1165            &mut self.0.options
1166        }
1167    }
1168
1169    /// The request builder for [AssetService::analyze_iam_policy][crate::client::AssetService::analyze_iam_policy] calls.
1170    ///
1171    /// # Example
1172    /// ```no_run
1173    /// # use google_cloud_asset_v1::builder;
1174    /// use builder::asset_service::AnalyzeIamPolicy;
1175    /// # tokio_test::block_on(async {
1176    ///
1177    /// let builder = prepare_request_builder();
1178    /// let response = builder.send().await?;
1179    /// # gax::Result::<()>::Ok(()) });
1180    ///
1181    /// fn prepare_request_builder() -> AnalyzeIamPolicy {
1182    ///   # panic!();
1183    ///   // ... details omitted ...
1184    /// }
1185    /// ```
1186    #[derive(Clone, Debug)]
1187    pub struct AnalyzeIamPolicy(RequestBuilder<crate::model::AnalyzeIamPolicyRequest>);
1188
1189    impl AnalyzeIamPolicy {
1190        pub(crate) fn new(
1191            stub: std::sync::Arc<dyn super::super::stub::dynamic::AssetService>,
1192        ) -> Self {
1193            Self(RequestBuilder::new(stub))
1194        }
1195
1196        /// Sets the full request, replacing any prior values.
1197        pub fn with_request<V: Into<crate::model::AnalyzeIamPolicyRequest>>(
1198            mut self,
1199            v: V,
1200        ) -> Self {
1201            self.0.request = v.into();
1202            self
1203        }
1204
1205        /// Sets all the options, replacing any prior values.
1206        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1207            self.0.options = v.into();
1208            self
1209        }
1210
1211        /// Sends the request.
1212        pub async fn send(self) -> Result<crate::model::AnalyzeIamPolicyResponse> {
1213            (*self.0.stub)
1214                .analyze_iam_policy(self.0.request, self.0.options)
1215                .await
1216                .map(gax::response::Response::into_body)
1217        }
1218
1219        /// Sets the value of [analysis_query][crate::model::AnalyzeIamPolicyRequest::analysis_query].
1220        ///
1221        /// This is a **required** field for requests.
1222        pub fn set_analysis_query<T>(mut self, v: T) -> Self
1223        where
1224            T: std::convert::Into<crate::model::IamPolicyAnalysisQuery>,
1225        {
1226            self.0.request.analysis_query = std::option::Option::Some(v.into());
1227            self
1228        }
1229
1230        /// Sets or clears the value of [analysis_query][crate::model::AnalyzeIamPolicyRequest::analysis_query].
1231        ///
1232        /// This is a **required** field for requests.
1233        pub fn set_or_clear_analysis_query<T>(mut self, v: std::option::Option<T>) -> Self
1234        where
1235            T: std::convert::Into<crate::model::IamPolicyAnalysisQuery>,
1236        {
1237            self.0.request.analysis_query = v.map(|x| x.into());
1238            self
1239        }
1240
1241        /// Sets the value of [saved_analysis_query][crate::model::AnalyzeIamPolicyRequest::saved_analysis_query].
1242        pub fn set_saved_analysis_query<T: Into<std::string::String>>(mut self, v: T) -> Self {
1243            self.0.request.saved_analysis_query = v.into();
1244            self
1245        }
1246
1247        /// Sets the value of [execution_timeout][crate::model::AnalyzeIamPolicyRequest::execution_timeout].
1248        pub fn set_execution_timeout<T>(mut self, v: T) -> Self
1249        where
1250            T: std::convert::Into<wkt::Duration>,
1251        {
1252            self.0.request.execution_timeout = std::option::Option::Some(v.into());
1253            self
1254        }
1255
1256        /// Sets or clears the value of [execution_timeout][crate::model::AnalyzeIamPolicyRequest::execution_timeout].
1257        pub fn set_or_clear_execution_timeout<T>(mut self, v: std::option::Option<T>) -> Self
1258        where
1259            T: std::convert::Into<wkt::Duration>,
1260        {
1261            self.0.request.execution_timeout = v.map(|x| x.into());
1262            self
1263        }
1264    }
1265
1266    #[doc(hidden)]
1267    impl gax::options::internal::RequestBuilder for AnalyzeIamPolicy {
1268        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1269            &mut self.0.options
1270        }
1271    }
1272
1273    /// The request builder for [AssetService::analyze_iam_policy_longrunning][crate::client::AssetService::analyze_iam_policy_longrunning] calls.
1274    ///
1275    /// # Example
1276    /// ```no_run
1277    /// # use google_cloud_asset_v1::builder;
1278    /// use builder::asset_service::AnalyzeIamPolicyLongrunning;
1279    /// # tokio_test::block_on(async {
1280    /// use lro::Poller;
1281    ///
1282    /// let builder = prepare_request_builder();
1283    /// let response = builder.poller().until_done().await?;
1284    /// # gax::Result::<()>::Ok(()) });
1285    ///
1286    /// fn prepare_request_builder() -> AnalyzeIamPolicyLongrunning {
1287    ///   # panic!();
1288    ///   // ... details omitted ...
1289    /// }
1290    /// ```
1291    #[derive(Clone, Debug)]
1292    pub struct AnalyzeIamPolicyLongrunning(
1293        RequestBuilder<crate::model::AnalyzeIamPolicyLongrunningRequest>,
1294    );
1295
1296    impl AnalyzeIamPolicyLongrunning {
1297        pub(crate) fn new(
1298            stub: std::sync::Arc<dyn super::super::stub::dynamic::AssetService>,
1299        ) -> Self {
1300            Self(RequestBuilder::new(stub))
1301        }
1302
1303        /// Sets the full request, replacing any prior values.
1304        pub fn with_request<V: Into<crate::model::AnalyzeIamPolicyLongrunningRequest>>(
1305            mut self,
1306            v: V,
1307        ) -> Self {
1308            self.0.request = v.into();
1309            self
1310        }
1311
1312        /// Sets all the options, replacing any prior values.
1313        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1314            self.0.options = v.into();
1315            self
1316        }
1317
1318        /// Sends the request.
1319        ///
1320        /// # Long running operations
1321        ///
1322        /// This starts, but does not poll, a longrunning operation. More information
1323        /// on [analyze_iam_policy_longrunning][crate::client::AssetService::analyze_iam_policy_longrunning].
1324        pub async fn send(self) -> Result<longrunning::model::Operation> {
1325            (*self.0.stub)
1326                .analyze_iam_policy_longrunning(self.0.request, self.0.options)
1327                .await
1328                .map(gax::response::Response::into_body)
1329        }
1330
1331        /// Creates a [Poller][lro::Poller] to work with `analyze_iam_policy_longrunning`.
1332        pub fn poller(
1333            self,
1334        ) -> impl lro::Poller<
1335            crate::model::AnalyzeIamPolicyLongrunningResponse,
1336            crate::model::AnalyzeIamPolicyLongrunningMetadata,
1337        > {
1338            type Operation = lro::internal::Operation<
1339                crate::model::AnalyzeIamPolicyLongrunningResponse,
1340                crate::model::AnalyzeIamPolicyLongrunningMetadata,
1341            >;
1342            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1343            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1344
1345            let stub = self.0.stub.clone();
1346            let mut options = self.0.options.clone();
1347            options.set_retry_policy(gax::retry_policy::NeverRetry);
1348            let query = move |name| {
1349                let stub = stub.clone();
1350                let options = options.clone();
1351                async {
1352                    let op = GetOperation::new(stub)
1353                        .set_name(name)
1354                        .with_options(options)
1355                        .send()
1356                        .await?;
1357                    Ok(Operation::new(op))
1358                }
1359            };
1360
1361            let start = move || async {
1362                let op = self.send().await?;
1363                Ok(Operation::new(op))
1364            };
1365
1366            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1367        }
1368
1369        /// Sets the value of [analysis_query][crate::model::AnalyzeIamPolicyLongrunningRequest::analysis_query].
1370        ///
1371        /// This is a **required** field for requests.
1372        pub fn set_analysis_query<T>(mut self, v: T) -> Self
1373        where
1374            T: std::convert::Into<crate::model::IamPolicyAnalysisQuery>,
1375        {
1376            self.0.request.analysis_query = std::option::Option::Some(v.into());
1377            self
1378        }
1379
1380        /// Sets or clears the value of [analysis_query][crate::model::AnalyzeIamPolicyLongrunningRequest::analysis_query].
1381        ///
1382        /// This is a **required** field for requests.
1383        pub fn set_or_clear_analysis_query<T>(mut self, v: std::option::Option<T>) -> Self
1384        where
1385            T: std::convert::Into<crate::model::IamPolicyAnalysisQuery>,
1386        {
1387            self.0.request.analysis_query = v.map(|x| x.into());
1388            self
1389        }
1390
1391        /// Sets the value of [saved_analysis_query][crate::model::AnalyzeIamPolicyLongrunningRequest::saved_analysis_query].
1392        pub fn set_saved_analysis_query<T: Into<std::string::String>>(mut self, v: T) -> Self {
1393            self.0.request.saved_analysis_query = v.into();
1394            self
1395        }
1396
1397        /// Sets the value of [output_config][crate::model::AnalyzeIamPolicyLongrunningRequest::output_config].
1398        ///
1399        /// This is a **required** field for requests.
1400        pub fn set_output_config<T>(mut self, v: T) -> Self
1401        where
1402            T: std::convert::Into<crate::model::IamPolicyAnalysisOutputConfig>,
1403        {
1404            self.0.request.output_config = std::option::Option::Some(v.into());
1405            self
1406        }
1407
1408        /// Sets or clears the value of [output_config][crate::model::AnalyzeIamPolicyLongrunningRequest::output_config].
1409        ///
1410        /// This is a **required** field for requests.
1411        pub fn set_or_clear_output_config<T>(mut self, v: std::option::Option<T>) -> Self
1412        where
1413            T: std::convert::Into<crate::model::IamPolicyAnalysisOutputConfig>,
1414        {
1415            self.0.request.output_config = v.map(|x| x.into());
1416            self
1417        }
1418    }
1419
1420    #[doc(hidden)]
1421    impl gax::options::internal::RequestBuilder for AnalyzeIamPolicyLongrunning {
1422        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1423            &mut self.0.options
1424        }
1425    }
1426
1427    /// The request builder for [AssetService::analyze_move][crate::client::AssetService::analyze_move] calls.
1428    ///
1429    /// # Example
1430    /// ```no_run
1431    /// # use google_cloud_asset_v1::builder;
1432    /// use builder::asset_service::AnalyzeMove;
1433    /// # tokio_test::block_on(async {
1434    ///
1435    /// let builder = prepare_request_builder();
1436    /// let response = builder.send().await?;
1437    /// # gax::Result::<()>::Ok(()) });
1438    ///
1439    /// fn prepare_request_builder() -> AnalyzeMove {
1440    ///   # panic!();
1441    ///   // ... details omitted ...
1442    /// }
1443    /// ```
1444    #[derive(Clone, Debug)]
1445    pub struct AnalyzeMove(RequestBuilder<crate::model::AnalyzeMoveRequest>);
1446
1447    impl AnalyzeMove {
1448        pub(crate) fn new(
1449            stub: std::sync::Arc<dyn super::super::stub::dynamic::AssetService>,
1450        ) -> Self {
1451            Self(RequestBuilder::new(stub))
1452        }
1453
1454        /// Sets the full request, replacing any prior values.
1455        pub fn with_request<V: Into<crate::model::AnalyzeMoveRequest>>(mut self, v: V) -> Self {
1456            self.0.request = v.into();
1457            self
1458        }
1459
1460        /// Sets all the options, replacing any prior values.
1461        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1462            self.0.options = v.into();
1463            self
1464        }
1465
1466        /// Sends the request.
1467        pub async fn send(self) -> Result<crate::model::AnalyzeMoveResponse> {
1468            (*self.0.stub)
1469                .analyze_move(self.0.request, self.0.options)
1470                .await
1471                .map(gax::response::Response::into_body)
1472        }
1473
1474        /// Sets the value of [resource][crate::model::AnalyzeMoveRequest::resource].
1475        ///
1476        /// This is a **required** field for requests.
1477        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1478            self.0.request.resource = v.into();
1479            self
1480        }
1481
1482        /// Sets the value of [destination_parent][crate::model::AnalyzeMoveRequest::destination_parent].
1483        ///
1484        /// This is a **required** field for requests.
1485        pub fn set_destination_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1486            self.0.request.destination_parent = v.into();
1487            self
1488        }
1489
1490        /// Sets the value of [view][crate::model::AnalyzeMoveRequest::view].
1491        pub fn set_view<T: Into<crate::model::analyze_move_request::AnalysisView>>(
1492            mut self,
1493            v: T,
1494        ) -> Self {
1495            self.0.request.view = v.into();
1496            self
1497        }
1498    }
1499
1500    #[doc(hidden)]
1501    impl gax::options::internal::RequestBuilder for AnalyzeMove {
1502        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1503            &mut self.0.options
1504        }
1505    }
1506
1507    /// The request builder for [AssetService::query_assets][crate::client::AssetService::query_assets] calls.
1508    ///
1509    /// # Example
1510    /// ```no_run
1511    /// # use google_cloud_asset_v1::builder;
1512    /// use builder::asset_service::QueryAssets;
1513    /// # tokio_test::block_on(async {
1514    ///
1515    /// let builder = prepare_request_builder();
1516    /// let response = builder.send().await?;
1517    /// # gax::Result::<()>::Ok(()) });
1518    ///
1519    /// fn prepare_request_builder() -> QueryAssets {
1520    ///   # panic!();
1521    ///   // ... details omitted ...
1522    /// }
1523    /// ```
1524    #[derive(Clone, Debug)]
1525    pub struct QueryAssets(RequestBuilder<crate::model::QueryAssetsRequest>);
1526
1527    impl QueryAssets {
1528        pub(crate) fn new(
1529            stub: std::sync::Arc<dyn super::super::stub::dynamic::AssetService>,
1530        ) -> Self {
1531            Self(RequestBuilder::new(stub))
1532        }
1533
1534        /// Sets the full request, replacing any prior values.
1535        pub fn with_request<V: Into<crate::model::QueryAssetsRequest>>(mut self, v: V) -> Self {
1536            self.0.request = v.into();
1537            self
1538        }
1539
1540        /// Sets all the options, replacing any prior values.
1541        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1542            self.0.options = v.into();
1543            self
1544        }
1545
1546        /// Sends the request.
1547        pub async fn send(self) -> Result<crate::model::QueryAssetsResponse> {
1548            (*self.0.stub)
1549                .query_assets(self.0.request, self.0.options)
1550                .await
1551                .map(gax::response::Response::into_body)
1552        }
1553
1554        /// Sets the value of [parent][crate::model::QueryAssetsRequest::parent].
1555        ///
1556        /// This is a **required** field for requests.
1557        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1558            self.0.request.parent = v.into();
1559            self
1560        }
1561
1562        /// Sets the value of [page_size][crate::model::QueryAssetsRequest::page_size].
1563        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1564            self.0.request.page_size = v.into();
1565            self
1566        }
1567
1568        /// Sets the value of [page_token][crate::model::QueryAssetsRequest::page_token].
1569        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1570            self.0.request.page_token = v.into();
1571            self
1572        }
1573
1574        /// Sets the value of [timeout][crate::model::QueryAssetsRequest::timeout].
1575        pub fn set_timeout<T>(mut self, v: T) -> Self
1576        where
1577            T: std::convert::Into<wkt::Duration>,
1578        {
1579            self.0.request.timeout = std::option::Option::Some(v.into());
1580            self
1581        }
1582
1583        /// Sets or clears the value of [timeout][crate::model::QueryAssetsRequest::timeout].
1584        pub fn set_or_clear_timeout<T>(mut self, v: std::option::Option<T>) -> Self
1585        where
1586            T: std::convert::Into<wkt::Duration>,
1587        {
1588            self.0.request.timeout = v.map(|x| x.into());
1589            self
1590        }
1591
1592        /// Sets the value of [output_config][crate::model::QueryAssetsRequest::output_config].
1593        pub fn set_output_config<T>(mut self, v: T) -> Self
1594        where
1595            T: std::convert::Into<crate::model::QueryAssetsOutputConfig>,
1596        {
1597            self.0.request.output_config = std::option::Option::Some(v.into());
1598            self
1599        }
1600
1601        /// Sets or clears the value of [output_config][crate::model::QueryAssetsRequest::output_config].
1602        pub fn set_or_clear_output_config<T>(mut self, v: std::option::Option<T>) -> Self
1603        where
1604            T: std::convert::Into<crate::model::QueryAssetsOutputConfig>,
1605        {
1606            self.0.request.output_config = v.map(|x| x.into());
1607            self
1608        }
1609
1610        /// Sets the value of [query][crate::model::QueryAssetsRequest::query].
1611        ///
1612        /// Note that all the setters affecting `query` are
1613        /// mutually exclusive.
1614        pub fn set_query<T: Into<Option<crate::model::query_assets_request::Query>>>(
1615            mut self,
1616            v: T,
1617        ) -> Self {
1618            self.0.request.query = v.into();
1619            self
1620        }
1621
1622        /// Sets the value of [query][crate::model::QueryAssetsRequest::query]
1623        /// to hold a `Statement`.
1624        ///
1625        /// Note that all the setters affecting `query` are
1626        /// mutually exclusive.
1627        pub fn set_statement<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1628            self.0.request = self.0.request.set_statement(v);
1629            self
1630        }
1631
1632        /// Sets the value of [query][crate::model::QueryAssetsRequest::query]
1633        /// to hold a `JobReference`.
1634        ///
1635        /// Note that all the setters affecting `query` are
1636        /// mutually exclusive.
1637        pub fn set_job_reference<T: std::convert::Into<std::string::String>>(
1638            mut self,
1639            v: T,
1640        ) -> Self {
1641            self.0.request = self.0.request.set_job_reference(v);
1642            self
1643        }
1644
1645        /// Sets the value of [time][crate::model::QueryAssetsRequest::time].
1646        ///
1647        /// Note that all the setters affecting `time` are
1648        /// mutually exclusive.
1649        pub fn set_time<T: Into<Option<crate::model::query_assets_request::Time>>>(
1650            mut self,
1651            v: T,
1652        ) -> Self {
1653            self.0.request.time = v.into();
1654            self
1655        }
1656
1657        /// Sets the value of [time][crate::model::QueryAssetsRequest::time]
1658        /// to hold a `ReadTimeWindow`.
1659        ///
1660        /// Note that all the setters affecting `time` are
1661        /// mutually exclusive.
1662        pub fn set_read_time_window<
1663            T: std::convert::Into<std::boxed::Box<crate::model::TimeWindow>>,
1664        >(
1665            mut self,
1666            v: T,
1667        ) -> Self {
1668            self.0.request = self.0.request.set_read_time_window(v);
1669            self
1670        }
1671
1672        /// Sets the value of [time][crate::model::QueryAssetsRequest::time]
1673        /// to hold a `ReadTime`.
1674        ///
1675        /// Note that all the setters affecting `time` are
1676        /// mutually exclusive.
1677        pub fn set_read_time<T: std::convert::Into<std::boxed::Box<wkt::Timestamp>>>(
1678            mut self,
1679            v: T,
1680        ) -> Self {
1681            self.0.request = self.0.request.set_read_time(v);
1682            self
1683        }
1684    }
1685
1686    #[doc(hidden)]
1687    impl gax::options::internal::RequestBuilder for QueryAssets {
1688        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1689            &mut self.0.options
1690        }
1691    }
1692
1693    /// The request builder for [AssetService::create_saved_query][crate::client::AssetService::create_saved_query] calls.
1694    ///
1695    /// # Example
1696    /// ```no_run
1697    /// # use google_cloud_asset_v1::builder;
1698    /// use builder::asset_service::CreateSavedQuery;
1699    /// # tokio_test::block_on(async {
1700    ///
1701    /// let builder = prepare_request_builder();
1702    /// let response = builder.send().await?;
1703    /// # gax::Result::<()>::Ok(()) });
1704    ///
1705    /// fn prepare_request_builder() -> CreateSavedQuery {
1706    ///   # panic!();
1707    ///   // ... details omitted ...
1708    /// }
1709    /// ```
1710    #[derive(Clone, Debug)]
1711    pub struct CreateSavedQuery(RequestBuilder<crate::model::CreateSavedQueryRequest>);
1712
1713    impl CreateSavedQuery {
1714        pub(crate) fn new(
1715            stub: std::sync::Arc<dyn super::super::stub::dynamic::AssetService>,
1716        ) -> Self {
1717            Self(RequestBuilder::new(stub))
1718        }
1719
1720        /// Sets the full request, replacing any prior values.
1721        pub fn with_request<V: Into<crate::model::CreateSavedQueryRequest>>(
1722            mut self,
1723            v: V,
1724        ) -> Self {
1725            self.0.request = v.into();
1726            self
1727        }
1728
1729        /// Sets all the options, replacing any prior values.
1730        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1731            self.0.options = v.into();
1732            self
1733        }
1734
1735        /// Sends the request.
1736        pub async fn send(self) -> Result<crate::model::SavedQuery> {
1737            (*self.0.stub)
1738                .create_saved_query(self.0.request, self.0.options)
1739                .await
1740                .map(gax::response::Response::into_body)
1741        }
1742
1743        /// Sets the value of [parent][crate::model::CreateSavedQueryRequest::parent].
1744        ///
1745        /// This is a **required** field for requests.
1746        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1747            self.0.request.parent = v.into();
1748            self
1749        }
1750
1751        /// Sets the value of [saved_query][crate::model::CreateSavedQueryRequest::saved_query].
1752        ///
1753        /// This is a **required** field for requests.
1754        pub fn set_saved_query<T>(mut self, v: T) -> Self
1755        where
1756            T: std::convert::Into<crate::model::SavedQuery>,
1757        {
1758            self.0.request.saved_query = std::option::Option::Some(v.into());
1759            self
1760        }
1761
1762        /// Sets or clears the value of [saved_query][crate::model::CreateSavedQueryRequest::saved_query].
1763        ///
1764        /// This is a **required** field for requests.
1765        pub fn set_or_clear_saved_query<T>(mut self, v: std::option::Option<T>) -> Self
1766        where
1767            T: std::convert::Into<crate::model::SavedQuery>,
1768        {
1769            self.0.request.saved_query = v.map(|x| x.into());
1770            self
1771        }
1772
1773        /// Sets the value of [saved_query_id][crate::model::CreateSavedQueryRequest::saved_query_id].
1774        ///
1775        /// This is a **required** field for requests.
1776        pub fn set_saved_query_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1777            self.0.request.saved_query_id = v.into();
1778            self
1779        }
1780    }
1781
1782    #[doc(hidden)]
1783    impl gax::options::internal::RequestBuilder for CreateSavedQuery {
1784        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1785            &mut self.0.options
1786        }
1787    }
1788
1789    /// The request builder for [AssetService::get_saved_query][crate::client::AssetService::get_saved_query] calls.
1790    ///
1791    /// # Example
1792    /// ```no_run
1793    /// # use google_cloud_asset_v1::builder;
1794    /// use builder::asset_service::GetSavedQuery;
1795    /// # tokio_test::block_on(async {
1796    ///
1797    /// let builder = prepare_request_builder();
1798    /// let response = builder.send().await?;
1799    /// # gax::Result::<()>::Ok(()) });
1800    ///
1801    /// fn prepare_request_builder() -> GetSavedQuery {
1802    ///   # panic!();
1803    ///   // ... details omitted ...
1804    /// }
1805    /// ```
1806    #[derive(Clone, Debug)]
1807    pub struct GetSavedQuery(RequestBuilder<crate::model::GetSavedQueryRequest>);
1808
1809    impl GetSavedQuery {
1810        pub(crate) fn new(
1811            stub: std::sync::Arc<dyn super::super::stub::dynamic::AssetService>,
1812        ) -> Self {
1813            Self(RequestBuilder::new(stub))
1814        }
1815
1816        /// Sets the full request, replacing any prior values.
1817        pub fn with_request<V: Into<crate::model::GetSavedQueryRequest>>(mut self, v: V) -> Self {
1818            self.0.request = v.into();
1819            self
1820        }
1821
1822        /// Sets all the options, replacing any prior values.
1823        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1824            self.0.options = v.into();
1825            self
1826        }
1827
1828        /// Sends the request.
1829        pub async fn send(self) -> Result<crate::model::SavedQuery> {
1830            (*self.0.stub)
1831                .get_saved_query(self.0.request, self.0.options)
1832                .await
1833                .map(gax::response::Response::into_body)
1834        }
1835
1836        /// Sets the value of [name][crate::model::GetSavedQueryRequest::name].
1837        ///
1838        /// This is a **required** field for requests.
1839        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1840            self.0.request.name = v.into();
1841            self
1842        }
1843    }
1844
1845    #[doc(hidden)]
1846    impl gax::options::internal::RequestBuilder for GetSavedQuery {
1847        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1848            &mut self.0.options
1849        }
1850    }
1851
1852    /// The request builder for [AssetService::list_saved_queries][crate::client::AssetService::list_saved_queries] calls.
1853    ///
1854    /// # Example
1855    /// ```no_run
1856    /// # use google_cloud_asset_v1::builder;
1857    /// use builder::asset_service::ListSavedQueries;
1858    /// # tokio_test::block_on(async {
1859    /// use gax::paginator::ItemPaginator;
1860    ///
1861    /// let builder = prepare_request_builder();
1862    /// let mut items = builder.by_item();
1863    /// while let Some(result) = items.next().await {
1864    ///   let item = result?;
1865    /// }
1866    /// # gax::Result::<()>::Ok(()) });
1867    ///
1868    /// fn prepare_request_builder() -> ListSavedQueries {
1869    ///   # panic!();
1870    ///   // ... details omitted ...
1871    /// }
1872    /// ```
1873    #[derive(Clone, Debug)]
1874    pub struct ListSavedQueries(RequestBuilder<crate::model::ListSavedQueriesRequest>);
1875
1876    impl ListSavedQueries {
1877        pub(crate) fn new(
1878            stub: std::sync::Arc<dyn super::super::stub::dynamic::AssetService>,
1879        ) -> Self {
1880            Self(RequestBuilder::new(stub))
1881        }
1882
1883        /// Sets the full request, replacing any prior values.
1884        pub fn with_request<V: Into<crate::model::ListSavedQueriesRequest>>(
1885            mut self,
1886            v: V,
1887        ) -> Self {
1888            self.0.request = v.into();
1889            self
1890        }
1891
1892        /// Sets all the options, replacing any prior values.
1893        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1894            self.0.options = v.into();
1895            self
1896        }
1897
1898        /// Sends the request.
1899        pub async fn send(self) -> Result<crate::model::ListSavedQueriesResponse> {
1900            (*self.0.stub)
1901                .list_saved_queries(self.0.request, self.0.options)
1902                .await
1903                .map(gax::response::Response::into_body)
1904        }
1905
1906        /// Streams each page in the collection.
1907        pub fn by_page(
1908            self,
1909        ) -> impl gax::paginator::Paginator<crate::model::ListSavedQueriesResponse, gax::error::Error>
1910        {
1911            use std::clone::Clone;
1912            let token = self.0.request.page_token.clone();
1913            let execute = move |token: String| {
1914                let mut builder = self.clone();
1915                builder.0.request = builder.0.request.set_page_token(token);
1916                builder.send()
1917            };
1918            gax::paginator::internal::new_paginator(token, execute)
1919        }
1920
1921        /// Streams each item in the collection.
1922        pub fn by_item(
1923            self,
1924        ) -> impl gax::paginator::ItemPaginator<crate::model::ListSavedQueriesResponse, gax::error::Error>
1925        {
1926            use gax::paginator::Paginator;
1927            self.by_page().items()
1928        }
1929
1930        /// Sets the value of [parent][crate::model::ListSavedQueriesRequest::parent].
1931        ///
1932        /// This is a **required** field for requests.
1933        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1934            self.0.request.parent = v.into();
1935            self
1936        }
1937
1938        /// Sets the value of [filter][crate::model::ListSavedQueriesRequest::filter].
1939        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1940            self.0.request.filter = v.into();
1941            self
1942        }
1943
1944        /// Sets the value of [page_size][crate::model::ListSavedQueriesRequest::page_size].
1945        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1946            self.0.request.page_size = v.into();
1947            self
1948        }
1949
1950        /// Sets the value of [page_token][crate::model::ListSavedQueriesRequest::page_token].
1951        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1952            self.0.request.page_token = v.into();
1953            self
1954        }
1955    }
1956
1957    #[doc(hidden)]
1958    impl gax::options::internal::RequestBuilder for ListSavedQueries {
1959        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1960            &mut self.0.options
1961        }
1962    }
1963
1964    /// The request builder for [AssetService::update_saved_query][crate::client::AssetService::update_saved_query] calls.
1965    ///
1966    /// # Example
1967    /// ```no_run
1968    /// # use google_cloud_asset_v1::builder;
1969    /// use builder::asset_service::UpdateSavedQuery;
1970    /// # tokio_test::block_on(async {
1971    ///
1972    /// let builder = prepare_request_builder();
1973    /// let response = builder.send().await?;
1974    /// # gax::Result::<()>::Ok(()) });
1975    ///
1976    /// fn prepare_request_builder() -> UpdateSavedQuery {
1977    ///   # panic!();
1978    ///   // ... details omitted ...
1979    /// }
1980    /// ```
1981    #[derive(Clone, Debug)]
1982    pub struct UpdateSavedQuery(RequestBuilder<crate::model::UpdateSavedQueryRequest>);
1983
1984    impl UpdateSavedQuery {
1985        pub(crate) fn new(
1986            stub: std::sync::Arc<dyn super::super::stub::dynamic::AssetService>,
1987        ) -> Self {
1988            Self(RequestBuilder::new(stub))
1989        }
1990
1991        /// Sets the full request, replacing any prior values.
1992        pub fn with_request<V: Into<crate::model::UpdateSavedQueryRequest>>(
1993            mut self,
1994            v: V,
1995        ) -> Self {
1996            self.0.request = v.into();
1997            self
1998        }
1999
2000        /// Sets all the options, replacing any prior values.
2001        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2002            self.0.options = v.into();
2003            self
2004        }
2005
2006        /// Sends the request.
2007        pub async fn send(self) -> Result<crate::model::SavedQuery> {
2008            (*self.0.stub)
2009                .update_saved_query(self.0.request, self.0.options)
2010                .await
2011                .map(gax::response::Response::into_body)
2012        }
2013
2014        /// Sets the value of [saved_query][crate::model::UpdateSavedQueryRequest::saved_query].
2015        ///
2016        /// This is a **required** field for requests.
2017        pub fn set_saved_query<T>(mut self, v: T) -> Self
2018        where
2019            T: std::convert::Into<crate::model::SavedQuery>,
2020        {
2021            self.0.request.saved_query = std::option::Option::Some(v.into());
2022            self
2023        }
2024
2025        /// Sets or clears the value of [saved_query][crate::model::UpdateSavedQueryRequest::saved_query].
2026        ///
2027        /// This is a **required** field for requests.
2028        pub fn set_or_clear_saved_query<T>(mut self, v: std::option::Option<T>) -> Self
2029        where
2030            T: std::convert::Into<crate::model::SavedQuery>,
2031        {
2032            self.0.request.saved_query = v.map(|x| x.into());
2033            self
2034        }
2035
2036        /// Sets the value of [update_mask][crate::model::UpdateSavedQueryRequest::update_mask].
2037        ///
2038        /// This is a **required** field for requests.
2039        pub fn set_update_mask<T>(mut self, v: T) -> Self
2040        where
2041            T: std::convert::Into<wkt::FieldMask>,
2042        {
2043            self.0.request.update_mask = std::option::Option::Some(v.into());
2044            self
2045        }
2046
2047        /// Sets or clears the value of [update_mask][crate::model::UpdateSavedQueryRequest::update_mask].
2048        ///
2049        /// This is a **required** field for requests.
2050        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2051        where
2052            T: std::convert::Into<wkt::FieldMask>,
2053        {
2054            self.0.request.update_mask = v.map(|x| x.into());
2055            self
2056        }
2057    }
2058
2059    #[doc(hidden)]
2060    impl gax::options::internal::RequestBuilder for UpdateSavedQuery {
2061        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2062            &mut self.0.options
2063        }
2064    }
2065
2066    /// The request builder for [AssetService::delete_saved_query][crate::client::AssetService::delete_saved_query] calls.
2067    ///
2068    /// # Example
2069    /// ```no_run
2070    /// # use google_cloud_asset_v1::builder;
2071    /// use builder::asset_service::DeleteSavedQuery;
2072    /// # tokio_test::block_on(async {
2073    ///
2074    /// let builder = prepare_request_builder();
2075    /// let response = builder.send().await?;
2076    /// # gax::Result::<()>::Ok(()) });
2077    ///
2078    /// fn prepare_request_builder() -> DeleteSavedQuery {
2079    ///   # panic!();
2080    ///   // ... details omitted ...
2081    /// }
2082    /// ```
2083    #[derive(Clone, Debug)]
2084    pub struct DeleteSavedQuery(RequestBuilder<crate::model::DeleteSavedQueryRequest>);
2085
2086    impl DeleteSavedQuery {
2087        pub(crate) fn new(
2088            stub: std::sync::Arc<dyn super::super::stub::dynamic::AssetService>,
2089        ) -> Self {
2090            Self(RequestBuilder::new(stub))
2091        }
2092
2093        /// Sets the full request, replacing any prior values.
2094        pub fn with_request<V: Into<crate::model::DeleteSavedQueryRequest>>(
2095            mut self,
2096            v: V,
2097        ) -> Self {
2098            self.0.request = v.into();
2099            self
2100        }
2101
2102        /// Sets all the options, replacing any prior values.
2103        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2104            self.0.options = v.into();
2105            self
2106        }
2107
2108        /// Sends the request.
2109        pub async fn send(self) -> Result<()> {
2110            (*self.0.stub)
2111                .delete_saved_query(self.0.request, self.0.options)
2112                .await
2113                .map(gax::response::Response::into_body)
2114        }
2115
2116        /// Sets the value of [name][crate::model::DeleteSavedQueryRequest::name].
2117        ///
2118        /// This is a **required** field for requests.
2119        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2120            self.0.request.name = v.into();
2121            self
2122        }
2123    }
2124
2125    #[doc(hidden)]
2126    impl gax::options::internal::RequestBuilder for DeleteSavedQuery {
2127        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2128            &mut self.0.options
2129        }
2130    }
2131
2132    /// The request builder for [AssetService::batch_get_effective_iam_policies][crate::client::AssetService::batch_get_effective_iam_policies] calls.
2133    ///
2134    /// # Example
2135    /// ```no_run
2136    /// # use google_cloud_asset_v1::builder;
2137    /// use builder::asset_service::BatchGetEffectiveIamPolicies;
2138    /// # tokio_test::block_on(async {
2139    ///
2140    /// let builder = prepare_request_builder();
2141    /// let response = builder.send().await?;
2142    /// # gax::Result::<()>::Ok(()) });
2143    ///
2144    /// fn prepare_request_builder() -> BatchGetEffectiveIamPolicies {
2145    ///   # panic!();
2146    ///   // ... details omitted ...
2147    /// }
2148    /// ```
2149    #[derive(Clone, Debug)]
2150    pub struct BatchGetEffectiveIamPolicies(
2151        RequestBuilder<crate::model::BatchGetEffectiveIamPoliciesRequest>,
2152    );
2153
2154    impl BatchGetEffectiveIamPolicies {
2155        pub(crate) fn new(
2156            stub: std::sync::Arc<dyn super::super::stub::dynamic::AssetService>,
2157        ) -> Self {
2158            Self(RequestBuilder::new(stub))
2159        }
2160
2161        /// Sets the full request, replacing any prior values.
2162        pub fn with_request<V: Into<crate::model::BatchGetEffectiveIamPoliciesRequest>>(
2163            mut self,
2164            v: V,
2165        ) -> Self {
2166            self.0.request = v.into();
2167            self
2168        }
2169
2170        /// Sets all the options, replacing any prior values.
2171        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2172            self.0.options = v.into();
2173            self
2174        }
2175
2176        /// Sends the request.
2177        pub async fn send(self) -> Result<crate::model::BatchGetEffectiveIamPoliciesResponse> {
2178            (*self.0.stub)
2179                .batch_get_effective_iam_policies(self.0.request, self.0.options)
2180                .await
2181                .map(gax::response::Response::into_body)
2182        }
2183
2184        /// Sets the value of [scope][crate::model::BatchGetEffectiveIamPoliciesRequest::scope].
2185        ///
2186        /// This is a **required** field for requests.
2187        pub fn set_scope<T: Into<std::string::String>>(mut self, v: T) -> Self {
2188            self.0.request.scope = v.into();
2189            self
2190        }
2191
2192        /// Sets the value of [names][crate::model::BatchGetEffectiveIamPoliciesRequest::names].
2193        ///
2194        /// This is a **required** field for requests.
2195        pub fn set_names<T, V>(mut self, v: T) -> Self
2196        where
2197            T: std::iter::IntoIterator<Item = V>,
2198            V: std::convert::Into<std::string::String>,
2199        {
2200            use std::iter::Iterator;
2201            self.0.request.names = v.into_iter().map(|i| i.into()).collect();
2202            self
2203        }
2204    }
2205
2206    #[doc(hidden)]
2207    impl gax::options::internal::RequestBuilder for BatchGetEffectiveIamPolicies {
2208        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2209            &mut self.0.options
2210        }
2211    }
2212
2213    /// The request builder for [AssetService::analyze_org_policies][crate::client::AssetService::analyze_org_policies] calls.
2214    ///
2215    /// # Example
2216    /// ```no_run
2217    /// # use google_cloud_asset_v1::builder;
2218    /// use builder::asset_service::AnalyzeOrgPolicies;
2219    /// # tokio_test::block_on(async {
2220    /// use gax::paginator::ItemPaginator;
2221    ///
2222    /// let builder = prepare_request_builder();
2223    /// let mut items = builder.by_item();
2224    /// while let Some(result) = items.next().await {
2225    ///   let item = result?;
2226    /// }
2227    /// # gax::Result::<()>::Ok(()) });
2228    ///
2229    /// fn prepare_request_builder() -> AnalyzeOrgPolicies {
2230    ///   # panic!();
2231    ///   // ... details omitted ...
2232    /// }
2233    /// ```
2234    #[derive(Clone, Debug)]
2235    pub struct AnalyzeOrgPolicies(RequestBuilder<crate::model::AnalyzeOrgPoliciesRequest>);
2236
2237    impl AnalyzeOrgPolicies {
2238        pub(crate) fn new(
2239            stub: std::sync::Arc<dyn super::super::stub::dynamic::AssetService>,
2240        ) -> Self {
2241            Self(RequestBuilder::new(stub))
2242        }
2243
2244        /// Sets the full request, replacing any prior values.
2245        pub fn with_request<V: Into<crate::model::AnalyzeOrgPoliciesRequest>>(
2246            mut self,
2247            v: V,
2248        ) -> Self {
2249            self.0.request = v.into();
2250            self
2251        }
2252
2253        /// Sets all the options, replacing any prior values.
2254        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2255            self.0.options = v.into();
2256            self
2257        }
2258
2259        /// Sends the request.
2260        pub async fn send(self) -> Result<crate::model::AnalyzeOrgPoliciesResponse> {
2261            (*self.0.stub)
2262                .analyze_org_policies(self.0.request, self.0.options)
2263                .await
2264                .map(gax::response::Response::into_body)
2265        }
2266
2267        /// Streams each page in the collection.
2268        pub fn by_page(
2269            self,
2270        ) -> impl gax::paginator::Paginator<crate::model::AnalyzeOrgPoliciesResponse, gax::error::Error>
2271        {
2272            use std::clone::Clone;
2273            let token = self.0.request.page_token.clone();
2274            let execute = move |token: String| {
2275                let mut builder = self.clone();
2276                builder.0.request = builder.0.request.set_page_token(token);
2277                builder.send()
2278            };
2279            gax::paginator::internal::new_paginator(token, execute)
2280        }
2281
2282        /// Streams each item in the collection.
2283        pub fn by_item(
2284            self,
2285        ) -> impl gax::paginator::ItemPaginator<
2286            crate::model::AnalyzeOrgPoliciesResponse,
2287            gax::error::Error,
2288        > {
2289            use gax::paginator::Paginator;
2290            self.by_page().items()
2291        }
2292
2293        /// Sets the value of [scope][crate::model::AnalyzeOrgPoliciesRequest::scope].
2294        ///
2295        /// This is a **required** field for requests.
2296        pub fn set_scope<T: Into<std::string::String>>(mut self, v: T) -> Self {
2297            self.0.request.scope = v.into();
2298            self
2299        }
2300
2301        /// Sets the value of [constraint][crate::model::AnalyzeOrgPoliciesRequest::constraint].
2302        ///
2303        /// This is a **required** field for requests.
2304        pub fn set_constraint<T: Into<std::string::String>>(mut self, v: T) -> Self {
2305            self.0.request.constraint = v.into();
2306            self
2307        }
2308
2309        /// Sets the value of [filter][crate::model::AnalyzeOrgPoliciesRequest::filter].
2310        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2311            self.0.request.filter = v.into();
2312            self
2313        }
2314
2315        /// Sets the value of [page_size][crate::model::AnalyzeOrgPoliciesRequest::page_size].
2316        pub fn set_page_size<T>(mut self, v: T) -> Self
2317        where
2318            T: std::convert::Into<i32>,
2319        {
2320            self.0.request.page_size = std::option::Option::Some(v.into());
2321            self
2322        }
2323
2324        /// Sets or clears the value of [page_size][crate::model::AnalyzeOrgPoliciesRequest::page_size].
2325        pub fn set_or_clear_page_size<T>(mut self, v: std::option::Option<T>) -> Self
2326        where
2327            T: std::convert::Into<i32>,
2328        {
2329            self.0.request.page_size = v.map(|x| x.into());
2330            self
2331        }
2332
2333        /// Sets the value of [page_token][crate::model::AnalyzeOrgPoliciesRequest::page_token].
2334        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2335            self.0.request.page_token = v.into();
2336            self
2337        }
2338    }
2339
2340    #[doc(hidden)]
2341    impl gax::options::internal::RequestBuilder for AnalyzeOrgPolicies {
2342        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2343            &mut self.0.options
2344        }
2345    }
2346
2347    /// The request builder for [AssetService::analyze_org_policy_governed_containers][crate::client::AssetService::analyze_org_policy_governed_containers] calls.
2348    ///
2349    /// # Example
2350    /// ```no_run
2351    /// # use google_cloud_asset_v1::builder;
2352    /// use builder::asset_service::AnalyzeOrgPolicyGovernedContainers;
2353    /// # tokio_test::block_on(async {
2354    /// use gax::paginator::ItemPaginator;
2355    ///
2356    /// let builder = prepare_request_builder();
2357    /// let mut items = builder.by_item();
2358    /// while let Some(result) = items.next().await {
2359    ///   let item = result?;
2360    /// }
2361    /// # gax::Result::<()>::Ok(()) });
2362    ///
2363    /// fn prepare_request_builder() -> AnalyzeOrgPolicyGovernedContainers {
2364    ///   # panic!();
2365    ///   // ... details omitted ...
2366    /// }
2367    /// ```
2368    #[derive(Clone, Debug)]
2369    pub struct AnalyzeOrgPolicyGovernedContainers(
2370        RequestBuilder<crate::model::AnalyzeOrgPolicyGovernedContainersRequest>,
2371    );
2372
2373    impl AnalyzeOrgPolicyGovernedContainers {
2374        pub(crate) fn new(
2375            stub: std::sync::Arc<dyn super::super::stub::dynamic::AssetService>,
2376        ) -> Self {
2377            Self(RequestBuilder::new(stub))
2378        }
2379
2380        /// Sets the full request, replacing any prior values.
2381        pub fn with_request<V: Into<crate::model::AnalyzeOrgPolicyGovernedContainersRequest>>(
2382            mut self,
2383            v: V,
2384        ) -> Self {
2385            self.0.request = v.into();
2386            self
2387        }
2388
2389        /// Sets all the options, replacing any prior values.
2390        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2391            self.0.options = v.into();
2392            self
2393        }
2394
2395        /// Sends the request.
2396        pub async fn send(
2397            self,
2398        ) -> Result<crate::model::AnalyzeOrgPolicyGovernedContainersResponse> {
2399            (*self.0.stub)
2400                .analyze_org_policy_governed_containers(self.0.request, self.0.options)
2401                .await
2402                .map(gax::response::Response::into_body)
2403        }
2404
2405        /// Streams each page in the collection.
2406        pub fn by_page(
2407            self,
2408        ) -> impl gax::paginator::Paginator<
2409            crate::model::AnalyzeOrgPolicyGovernedContainersResponse,
2410            gax::error::Error,
2411        > {
2412            use std::clone::Clone;
2413            let token = self.0.request.page_token.clone();
2414            let execute = move |token: String| {
2415                let mut builder = self.clone();
2416                builder.0.request = builder.0.request.set_page_token(token);
2417                builder.send()
2418            };
2419            gax::paginator::internal::new_paginator(token, execute)
2420        }
2421
2422        /// Streams each item in the collection.
2423        pub fn by_item(
2424            self,
2425        ) -> impl gax::paginator::ItemPaginator<
2426            crate::model::AnalyzeOrgPolicyGovernedContainersResponse,
2427            gax::error::Error,
2428        > {
2429            use gax::paginator::Paginator;
2430            self.by_page().items()
2431        }
2432
2433        /// Sets the value of [scope][crate::model::AnalyzeOrgPolicyGovernedContainersRequest::scope].
2434        ///
2435        /// This is a **required** field for requests.
2436        pub fn set_scope<T: Into<std::string::String>>(mut self, v: T) -> Self {
2437            self.0.request.scope = v.into();
2438            self
2439        }
2440
2441        /// Sets the value of [constraint][crate::model::AnalyzeOrgPolicyGovernedContainersRequest::constraint].
2442        ///
2443        /// This is a **required** field for requests.
2444        pub fn set_constraint<T: Into<std::string::String>>(mut self, v: T) -> Self {
2445            self.0.request.constraint = v.into();
2446            self
2447        }
2448
2449        /// Sets the value of [filter][crate::model::AnalyzeOrgPolicyGovernedContainersRequest::filter].
2450        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2451            self.0.request.filter = v.into();
2452            self
2453        }
2454
2455        /// Sets the value of [page_size][crate::model::AnalyzeOrgPolicyGovernedContainersRequest::page_size].
2456        pub fn set_page_size<T>(mut self, v: T) -> Self
2457        where
2458            T: std::convert::Into<i32>,
2459        {
2460            self.0.request.page_size = std::option::Option::Some(v.into());
2461            self
2462        }
2463
2464        /// Sets or clears the value of [page_size][crate::model::AnalyzeOrgPolicyGovernedContainersRequest::page_size].
2465        pub fn set_or_clear_page_size<T>(mut self, v: std::option::Option<T>) -> Self
2466        where
2467            T: std::convert::Into<i32>,
2468        {
2469            self.0.request.page_size = v.map(|x| x.into());
2470            self
2471        }
2472
2473        /// Sets the value of [page_token][crate::model::AnalyzeOrgPolicyGovernedContainersRequest::page_token].
2474        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2475            self.0.request.page_token = v.into();
2476            self
2477        }
2478    }
2479
2480    #[doc(hidden)]
2481    impl gax::options::internal::RequestBuilder for AnalyzeOrgPolicyGovernedContainers {
2482        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2483            &mut self.0.options
2484        }
2485    }
2486
2487    /// The request builder for [AssetService::analyze_org_policy_governed_assets][crate::client::AssetService::analyze_org_policy_governed_assets] calls.
2488    ///
2489    /// # Example
2490    /// ```no_run
2491    /// # use google_cloud_asset_v1::builder;
2492    /// use builder::asset_service::AnalyzeOrgPolicyGovernedAssets;
2493    /// # tokio_test::block_on(async {
2494    /// use gax::paginator::ItemPaginator;
2495    ///
2496    /// let builder = prepare_request_builder();
2497    /// let mut items = builder.by_item();
2498    /// while let Some(result) = items.next().await {
2499    ///   let item = result?;
2500    /// }
2501    /// # gax::Result::<()>::Ok(()) });
2502    ///
2503    /// fn prepare_request_builder() -> AnalyzeOrgPolicyGovernedAssets {
2504    ///   # panic!();
2505    ///   // ... details omitted ...
2506    /// }
2507    /// ```
2508    #[derive(Clone, Debug)]
2509    pub struct AnalyzeOrgPolicyGovernedAssets(
2510        RequestBuilder<crate::model::AnalyzeOrgPolicyGovernedAssetsRequest>,
2511    );
2512
2513    impl AnalyzeOrgPolicyGovernedAssets {
2514        pub(crate) fn new(
2515            stub: std::sync::Arc<dyn super::super::stub::dynamic::AssetService>,
2516        ) -> Self {
2517            Self(RequestBuilder::new(stub))
2518        }
2519
2520        /// Sets the full request, replacing any prior values.
2521        pub fn with_request<V: Into<crate::model::AnalyzeOrgPolicyGovernedAssetsRequest>>(
2522            mut self,
2523            v: V,
2524        ) -> Self {
2525            self.0.request = v.into();
2526            self
2527        }
2528
2529        /// Sets all the options, replacing any prior values.
2530        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2531            self.0.options = v.into();
2532            self
2533        }
2534
2535        /// Sends the request.
2536        pub async fn send(self) -> Result<crate::model::AnalyzeOrgPolicyGovernedAssetsResponse> {
2537            (*self.0.stub)
2538                .analyze_org_policy_governed_assets(self.0.request, self.0.options)
2539                .await
2540                .map(gax::response::Response::into_body)
2541        }
2542
2543        /// Streams each page in the collection.
2544        pub fn by_page(
2545            self,
2546        ) -> impl gax::paginator::Paginator<
2547            crate::model::AnalyzeOrgPolicyGovernedAssetsResponse,
2548            gax::error::Error,
2549        > {
2550            use std::clone::Clone;
2551            let token = self.0.request.page_token.clone();
2552            let execute = move |token: String| {
2553                let mut builder = self.clone();
2554                builder.0.request = builder.0.request.set_page_token(token);
2555                builder.send()
2556            };
2557            gax::paginator::internal::new_paginator(token, execute)
2558        }
2559
2560        /// Streams each item in the collection.
2561        pub fn by_item(
2562            self,
2563        ) -> impl gax::paginator::ItemPaginator<
2564            crate::model::AnalyzeOrgPolicyGovernedAssetsResponse,
2565            gax::error::Error,
2566        > {
2567            use gax::paginator::Paginator;
2568            self.by_page().items()
2569        }
2570
2571        /// Sets the value of [scope][crate::model::AnalyzeOrgPolicyGovernedAssetsRequest::scope].
2572        ///
2573        /// This is a **required** field for requests.
2574        pub fn set_scope<T: Into<std::string::String>>(mut self, v: T) -> Self {
2575            self.0.request.scope = v.into();
2576            self
2577        }
2578
2579        /// Sets the value of [constraint][crate::model::AnalyzeOrgPolicyGovernedAssetsRequest::constraint].
2580        ///
2581        /// This is a **required** field for requests.
2582        pub fn set_constraint<T: Into<std::string::String>>(mut self, v: T) -> Self {
2583            self.0.request.constraint = v.into();
2584            self
2585        }
2586
2587        /// Sets the value of [filter][crate::model::AnalyzeOrgPolicyGovernedAssetsRequest::filter].
2588        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2589            self.0.request.filter = v.into();
2590            self
2591        }
2592
2593        /// Sets the value of [page_size][crate::model::AnalyzeOrgPolicyGovernedAssetsRequest::page_size].
2594        pub fn set_page_size<T>(mut self, v: T) -> Self
2595        where
2596            T: std::convert::Into<i32>,
2597        {
2598            self.0.request.page_size = std::option::Option::Some(v.into());
2599            self
2600        }
2601
2602        /// Sets or clears the value of [page_size][crate::model::AnalyzeOrgPolicyGovernedAssetsRequest::page_size].
2603        pub fn set_or_clear_page_size<T>(mut self, v: std::option::Option<T>) -> Self
2604        where
2605            T: std::convert::Into<i32>,
2606        {
2607            self.0.request.page_size = v.map(|x| x.into());
2608            self
2609        }
2610
2611        /// Sets the value of [page_token][crate::model::AnalyzeOrgPolicyGovernedAssetsRequest::page_token].
2612        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2613            self.0.request.page_token = v.into();
2614            self
2615        }
2616    }
2617
2618    #[doc(hidden)]
2619    impl gax::options::internal::RequestBuilder for AnalyzeOrgPolicyGovernedAssets {
2620        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2621            &mut self.0.options
2622        }
2623    }
2624
2625    /// The request builder for [AssetService::get_operation][crate::client::AssetService::get_operation] calls.
2626    ///
2627    /// # Example
2628    /// ```no_run
2629    /// # use google_cloud_asset_v1::builder;
2630    /// use builder::asset_service::GetOperation;
2631    /// # tokio_test::block_on(async {
2632    ///
2633    /// let builder = prepare_request_builder();
2634    /// let response = builder.send().await?;
2635    /// # gax::Result::<()>::Ok(()) });
2636    ///
2637    /// fn prepare_request_builder() -> GetOperation {
2638    ///   # panic!();
2639    ///   // ... details omitted ...
2640    /// }
2641    /// ```
2642    #[derive(Clone, Debug)]
2643    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
2644
2645    impl GetOperation {
2646        pub(crate) fn new(
2647            stub: std::sync::Arc<dyn super::super::stub::dynamic::AssetService>,
2648        ) -> Self {
2649            Self(RequestBuilder::new(stub))
2650        }
2651
2652        /// Sets the full request, replacing any prior values.
2653        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
2654            mut self,
2655            v: V,
2656        ) -> Self {
2657            self.0.request = v.into();
2658            self
2659        }
2660
2661        /// Sets all the options, replacing any prior values.
2662        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2663            self.0.options = v.into();
2664            self
2665        }
2666
2667        /// Sends the request.
2668        pub async fn send(self) -> Result<longrunning::model::Operation> {
2669            (*self.0.stub)
2670                .get_operation(self.0.request, self.0.options)
2671                .await
2672                .map(gax::response::Response::into_body)
2673        }
2674
2675        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
2676        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2677            self.0.request.name = v.into();
2678            self
2679        }
2680    }
2681
2682    #[doc(hidden)]
2683    impl gax::options::internal::RequestBuilder for GetOperation {
2684        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2685            &mut self.0.options
2686        }
2687    }
2688}