Skip to main content

google_cloud_networkconnectivity_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
17/// Request and client builders for [CrossNetworkAutomationService][crate::client::CrossNetworkAutomationService].
18pub mod cross_network_automation_service {
19    use crate::Result;
20
21    /// A builder for [CrossNetworkAutomationService][crate::client::CrossNetworkAutomationService].
22    ///
23    /// ```
24    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
25    /// # use google_cloud_networkconnectivity_v1::*;
26    /// # use builder::cross_network_automation_service::ClientBuilder;
27    /// # use client::CrossNetworkAutomationService;
28    /// let builder : ClientBuilder = CrossNetworkAutomationService::builder();
29    /// let client = builder
30    ///     .with_endpoint("https://networkconnectivity.googleapis.com")
31    ///     .build().await?;
32    /// # Ok(()) }
33    /// ```
34    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
35
36    pub(crate) mod client {
37        use super::super::super::client::CrossNetworkAutomationService;
38        pub struct Factory;
39        impl crate::ClientFactory for Factory {
40            type Client = CrossNetworkAutomationService;
41            type Credentials = gaxi::options::Credentials;
42            async fn build(
43                self,
44                config: gaxi::options::ClientConfig,
45            ) -> crate::ClientBuilderResult<Self::Client> {
46                Self::Client::new(config).await
47            }
48        }
49    }
50
51    /// Common implementation for [crate::client::CrossNetworkAutomationService] 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::CrossNetworkAutomationService>,
55        request: R,
56        options: crate::RequestOptions,
57    }
58
59    impl<R> RequestBuilder<R>
60    where
61        R: std::default::Default,
62    {
63        pub(crate) fn new(
64            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
65        ) -> Self {
66            Self {
67                stub,
68                request: R::default(),
69                options: crate::RequestOptions::default(),
70            }
71        }
72    }
73
74    /// The request builder for [CrossNetworkAutomationService::list_service_connection_maps][crate::client::CrossNetworkAutomationService::list_service_connection_maps] calls.
75    ///
76    /// # Example
77    /// ```
78    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::ListServiceConnectionMaps;
79    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
80    /// use google_cloud_gax::paginator::ItemPaginator;
81    ///
82    /// let builder = prepare_request_builder();
83    /// let mut items = builder.by_item();
84    /// while let Some(result) = items.next().await {
85    ///   let item = result?;
86    /// }
87    /// # Ok(()) }
88    ///
89    /// fn prepare_request_builder() -> ListServiceConnectionMaps {
90    ///   # panic!();
91    ///   // ... details omitted ...
92    /// }
93    /// ```
94    #[derive(Clone, Debug)]
95    pub struct ListServiceConnectionMaps(
96        RequestBuilder<crate::model::ListServiceConnectionMapsRequest>,
97    );
98
99    impl ListServiceConnectionMaps {
100        pub(crate) fn new(
101            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
102        ) -> Self {
103            Self(RequestBuilder::new(stub))
104        }
105
106        /// Sets the full request, replacing any prior values.
107        pub fn with_request<V: Into<crate::model::ListServiceConnectionMapsRequest>>(
108            mut self,
109            v: V,
110        ) -> Self {
111            self.0.request = v.into();
112            self
113        }
114
115        /// Sets all the options, replacing any prior values.
116        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
117            self.0.options = v.into();
118            self
119        }
120
121        /// Sends the request.
122        pub async fn send(self) -> Result<crate::model::ListServiceConnectionMapsResponse> {
123            (*self.0.stub)
124                .list_service_connection_maps(self.0.request, self.0.options)
125                .await
126                .map(crate::Response::into_body)
127        }
128
129        /// Streams each page in the collection.
130        pub fn by_page(
131            self,
132        ) -> impl google_cloud_gax::paginator::Paginator<
133            crate::model::ListServiceConnectionMapsResponse,
134            crate::Error,
135        > {
136            use std::clone::Clone;
137            let token = self.0.request.page_token.clone();
138            let execute = move |token: String| {
139                let mut builder = self.clone();
140                builder.0.request = builder.0.request.set_page_token(token);
141                builder.send()
142            };
143            google_cloud_gax::paginator::internal::new_paginator(token, execute)
144        }
145
146        /// Streams each item in the collection.
147        pub fn by_item(
148            self,
149        ) -> impl google_cloud_gax::paginator::ItemPaginator<
150            crate::model::ListServiceConnectionMapsResponse,
151            crate::Error,
152        > {
153            use google_cloud_gax::paginator::Paginator;
154            self.by_page().items()
155        }
156
157        /// Sets the value of [parent][crate::model::ListServiceConnectionMapsRequest::parent].
158        ///
159        /// This is a **required** field for requests.
160        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
161            self.0.request.parent = v.into();
162            self
163        }
164
165        /// Sets the value of [page_size][crate::model::ListServiceConnectionMapsRequest::page_size].
166        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
167            self.0.request.page_size = v.into();
168            self
169        }
170
171        /// Sets the value of [page_token][crate::model::ListServiceConnectionMapsRequest::page_token].
172        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
173            self.0.request.page_token = v.into();
174            self
175        }
176
177        /// Sets the value of [filter][crate::model::ListServiceConnectionMapsRequest::filter].
178        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
179            self.0.request.filter = v.into();
180            self
181        }
182
183        /// Sets the value of [order_by][crate::model::ListServiceConnectionMapsRequest::order_by].
184        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
185            self.0.request.order_by = v.into();
186            self
187        }
188    }
189
190    #[doc(hidden)]
191    impl crate::RequestBuilder for ListServiceConnectionMaps {
192        fn request_options(&mut self) -> &mut crate::RequestOptions {
193            &mut self.0.options
194        }
195    }
196
197    /// The request builder for [CrossNetworkAutomationService::get_service_connection_map][crate::client::CrossNetworkAutomationService::get_service_connection_map] calls.
198    ///
199    /// # Example
200    /// ```
201    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::GetServiceConnectionMap;
202    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
203    ///
204    /// let builder = prepare_request_builder();
205    /// let response = builder.send().await?;
206    /// # Ok(()) }
207    ///
208    /// fn prepare_request_builder() -> GetServiceConnectionMap {
209    ///   # panic!();
210    ///   // ... details omitted ...
211    /// }
212    /// ```
213    #[derive(Clone, Debug)]
214    pub struct GetServiceConnectionMap(
215        RequestBuilder<crate::model::GetServiceConnectionMapRequest>,
216    );
217
218    impl GetServiceConnectionMap {
219        pub(crate) fn new(
220            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
221        ) -> Self {
222            Self(RequestBuilder::new(stub))
223        }
224
225        /// Sets the full request, replacing any prior values.
226        pub fn with_request<V: Into<crate::model::GetServiceConnectionMapRequest>>(
227            mut self,
228            v: V,
229        ) -> Self {
230            self.0.request = v.into();
231            self
232        }
233
234        /// Sets all the options, replacing any prior values.
235        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
236            self.0.options = v.into();
237            self
238        }
239
240        /// Sends the request.
241        pub async fn send(self) -> Result<crate::model::ServiceConnectionMap> {
242            (*self.0.stub)
243                .get_service_connection_map(self.0.request, self.0.options)
244                .await
245                .map(crate::Response::into_body)
246        }
247
248        /// Sets the value of [name][crate::model::GetServiceConnectionMapRequest::name].
249        ///
250        /// This is a **required** field for requests.
251        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
252            self.0.request.name = v.into();
253            self
254        }
255    }
256
257    #[doc(hidden)]
258    impl crate::RequestBuilder for GetServiceConnectionMap {
259        fn request_options(&mut self) -> &mut crate::RequestOptions {
260            &mut self.0.options
261        }
262    }
263
264    /// The request builder for [CrossNetworkAutomationService::create_service_connection_map][crate::client::CrossNetworkAutomationService::create_service_connection_map] calls.
265    ///
266    /// # Example
267    /// ```
268    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::CreateServiceConnectionMap;
269    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
270    /// use google_cloud_lro::Poller;
271    ///
272    /// let builder = prepare_request_builder();
273    /// let response = builder.poller().until_done().await?;
274    /// # Ok(()) }
275    ///
276    /// fn prepare_request_builder() -> CreateServiceConnectionMap {
277    ///   # panic!();
278    ///   // ... details omitted ...
279    /// }
280    /// ```
281    #[derive(Clone, Debug)]
282    pub struct CreateServiceConnectionMap(
283        RequestBuilder<crate::model::CreateServiceConnectionMapRequest>,
284    );
285
286    impl CreateServiceConnectionMap {
287        pub(crate) fn new(
288            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
289        ) -> Self {
290            Self(RequestBuilder::new(stub))
291        }
292
293        /// Sets the full request, replacing any prior values.
294        pub fn with_request<V: Into<crate::model::CreateServiceConnectionMapRequest>>(
295            mut self,
296            v: V,
297        ) -> Self {
298            self.0.request = v.into();
299            self
300        }
301
302        /// Sets all the options, replacing any prior values.
303        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
304            self.0.options = v.into();
305            self
306        }
307
308        /// Sends the request.
309        ///
310        /// # Long running operations
311        ///
312        /// This starts, but does not poll, a longrunning operation. More information
313        /// on [create_service_connection_map][crate::client::CrossNetworkAutomationService::create_service_connection_map].
314        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
315            (*self.0.stub)
316                .create_service_connection_map(self.0.request, self.0.options)
317                .await
318                .map(crate::Response::into_body)
319        }
320
321        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_service_connection_map`.
322        pub fn poller(
323            self,
324        ) -> impl google_cloud_lro::Poller<
325            crate::model::ServiceConnectionMap,
326            crate::model::OperationMetadata,
327        > {
328            type Operation = google_cloud_lro::internal::Operation<
329                crate::model::ServiceConnectionMap,
330                crate::model::OperationMetadata,
331            >;
332            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
333            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
334            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
335            if let Some(ref mut details) = poller_options.tracing {
336                details.method_name = "google_cloud_networkconnectivity_v1::client::CrossNetworkAutomationService::create_service_connection_map::until_done";
337            }
338
339            let stub = self.0.stub.clone();
340            let mut options = self.0.options.clone();
341            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
342            let query = move |name| {
343                let stub = stub.clone();
344                let options = options.clone();
345                async {
346                    let op = GetOperation::new(stub)
347                        .set_name(name)
348                        .with_options(options)
349                        .send()
350                        .await?;
351                    Ok(Operation::new(op))
352                }
353            };
354
355            let start = move || async {
356                let op = self.send().await?;
357                Ok(Operation::new(op))
358            };
359
360            use google_cloud_lro::internal::PollerExt;
361            {
362                google_cloud_lro::internal::new_poller(
363                    polling_error_policy,
364                    polling_backoff_policy,
365                    start,
366                    query,
367                )
368            }
369            .with_options(poller_options)
370        }
371
372        /// Sets the value of [parent][crate::model::CreateServiceConnectionMapRequest::parent].
373        ///
374        /// This is a **required** field for requests.
375        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
376            self.0.request.parent = v.into();
377            self
378        }
379
380        /// Sets the value of [service_connection_map_id][crate::model::CreateServiceConnectionMapRequest::service_connection_map_id].
381        pub fn set_service_connection_map_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
382            self.0.request.service_connection_map_id = v.into();
383            self
384        }
385
386        /// Sets the value of [service_connection_map][crate::model::CreateServiceConnectionMapRequest::service_connection_map].
387        ///
388        /// This is a **required** field for requests.
389        pub fn set_service_connection_map<T>(mut self, v: T) -> Self
390        where
391            T: std::convert::Into<crate::model::ServiceConnectionMap>,
392        {
393            self.0.request.service_connection_map = std::option::Option::Some(v.into());
394            self
395        }
396
397        /// Sets or clears the value of [service_connection_map][crate::model::CreateServiceConnectionMapRequest::service_connection_map].
398        ///
399        /// This is a **required** field for requests.
400        pub fn set_or_clear_service_connection_map<T>(mut self, v: std::option::Option<T>) -> Self
401        where
402            T: std::convert::Into<crate::model::ServiceConnectionMap>,
403        {
404            self.0.request.service_connection_map = v.map(|x| x.into());
405            self
406        }
407
408        /// Sets the value of [request_id][crate::model::CreateServiceConnectionMapRequest::request_id].
409        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
410            self.0.request.request_id = v.into();
411            self
412        }
413    }
414
415    #[doc(hidden)]
416    impl crate::RequestBuilder for CreateServiceConnectionMap {
417        fn request_options(&mut self) -> &mut crate::RequestOptions {
418            &mut self.0.options
419        }
420    }
421
422    /// The request builder for [CrossNetworkAutomationService::update_service_connection_map][crate::client::CrossNetworkAutomationService::update_service_connection_map] calls.
423    ///
424    /// # Example
425    /// ```
426    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::UpdateServiceConnectionMap;
427    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
428    /// use google_cloud_lro::Poller;
429    ///
430    /// let builder = prepare_request_builder();
431    /// let response = builder.poller().until_done().await?;
432    /// # Ok(()) }
433    ///
434    /// fn prepare_request_builder() -> UpdateServiceConnectionMap {
435    ///   # panic!();
436    ///   // ... details omitted ...
437    /// }
438    /// ```
439    #[derive(Clone, Debug)]
440    pub struct UpdateServiceConnectionMap(
441        RequestBuilder<crate::model::UpdateServiceConnectionMapRequest>,
442    );
443
444    impl UpdateServiceConnectionMap {
445        pub(crate) fn new(
446            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
447        ) -> Self {
448            Self(RequestBuilder::new(stub))
449        }
450
451        /// Sets the full request, replacing any prior values.
452        pub fn with_request<V: Into<crate::model::UpdateServiceConnectionMapRequest>>(
453            mut self,
454            v: V,
455        ) -> Self {
456            self.0.request = v.into();
457            self
458        }
459
460        /// Sets all the options, replacing any prior values.
461        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
462            self.0.options = v.into();
463            self
464        }
465
466        /// Sends the request.
467        ///
468        /// # Long running operations
469        ///
470        /// This starts, but does not poll, a longrunning operation. More information
471        /// on [update_service_connection_map][crate::client::CrossNetworkAutomationService::update_service_connection_map].
472        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
473            (*self.0.stub)
474                .update_service_connection_map(self.0.request, self.0.options)
475                .await
476                .map(crate::Response::into_body)
477        }
478
479        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_service_connection_map`.
480        pub fn poller(
481            self,
482        ) -> impl google_cloud_lro::Poller<
483            crate::model::ServiceConnectionMap,
484            crate::model::OperationMetadata,
485        > {
486            type Operation = google_cloud_lro::internal::Operation<
487                crate::model::ServiceConnectionMap,
488                crate::model::OperationMetadata,
489            >;
490            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
491            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
492            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
493            if let Some(ref mut details) = poller_options.tracing {
494                details.method_name = "google_cloud_networkconnectivity_v1::client::CrossNetworkAutomationService::update_service_connection_map::until_done";
495            }
496
497            let stub = self.0.stub.clone();
498            let mut options = self.0.options.clone();
499            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
500            let query = move |name| {
501                let stub = stub.clone();
502                let options = options.clone();
503                async {
504                    let op = GetOperation::new(stub)
505                        .set_name(name)
506                        .with_options(options)
507                        .send()
508                        .await?;
509                    Ok(Operation::new(op))
510                }
511            };
512
513            let start = move || async {
514                let op = self.send().await?;
515                Ok(Operation::new(op))
516            };
517
518            use google_cloud_lro::internal::PollerExt;
519            {
520                google_cloud_lro::internal::new_poller(
521                    polling_error_policy,
522                    polling_backoff_policy,
523                    start,
524                    query,
525                )
526            }
527            .with_options(poller_options)
528        }
529
530        /// Sets the value of [update_mask][crate::model::UpdateServiceConnectionMapRequest::update_mask].
531        pub fn set_update_mask<T>(mut self, v: T) -> Self
532        where
533            T: std::convert::Into<wkt::FieldMask>,
534        {
535            self.0.request.update_mask = std::option::Option::Some(v.into());
536            self
537        }
538
539        /// Sets or clears the value of [update_mask][crate::model::UpdateServiceConnectionMapRequest::update_mask].
540        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
541        where
542            T: std::convert::Into<wkt::FieldMask>,
543        {
544            self.0.request.update_mask = v.map(|x| x.into());
545            self
546        }
547
548        /// Sets the value of [service_connection_map][crate::model::UpdateServiceConnectionMapRequest::service_connection_map].
549        ///
550        /// This is a **required** field for requests.
551        pub fn set_service_connection_map<T>(mut self, v: T) -> Self
552        where
553            T: std::convert::Into<crate::model::ServiceConnectionMap>,
554        {
555            self.0.request.service_connection_map = std::option::Option::Some(v.into());
556            self
557        }
558
559        /// Sets or clears the value of [service_connection_map][crate::model::UpdateServiceConnectionMapRequest::service_connection_map].
560        ///
561        /// This is a **required** field for requests.
562        pub fn set_or_clear_service_connection_map<T>(mut self, v: std::option::Option<T>) -> Self
563        where
564            T: std::convert::Into<crate::model::ServiceConnectionMap>,
565        {
566            self.0.request.service_connection_map = v.map(|x| x.into());
567            self
568        }
569
570        /// Sets the value of [request_id][crate::model::UpdateServiceConnectionMapRequest::request_id].
571        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
572            self.0.request.request_id = v.into();
573            self
574        }
575    }
576
577    #[doc(hidden)]
578    impl crate::RequestBuilder for UpdateServiceConnectionMap {
579        fn request_options(&mut self) -> &mut crate::RequestOptions {
580            &mut self.0.options
581        }
582    }
583
584    /// The request builder for [CrossNetworkAutomationService::delete_service_connection_map][crate::client::CrossNetworkAutomationService::delete_service_connection_map] calls.
585    ///
586    /// # Example
587    /// ```
588    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::DeleteServiceConnectionMap;
589    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
590    /// use google_cloud_lro::Poller;
591    ///
592    /// let builder = prepare_request_builder();
593    /// let response = builder.poller().until_done().await?;
594    /// # Ok(()) }
595    ///
596    /// fn prepare_request_builder() -> DeleteServiceConnectionMap {
597    ///   # panic!();
598    ///   // ... details omitted ...
599    /// }
600    /// ```
601    #[derive(Clone, Debug)]
602    pub struct DeleteServiceConnectionMap(
603        RequestBuilder<crate::model::DeleteServiceConnectionMapRequest>,
604    );
605
606    impl DeleteServiceConnectionMap {
607        pub(crate) fn new(
608            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
609        ) -> Self {
610            Self(RequestBuilder::new(stub))
611        }
612
613        /// Sets the full request, replacing any prior values.
614        pub fn with_request<V: Into<crate::model::DeleteServiceConnectionMapRequest>>(
615            mut self,
616            v: V,
617        ) -> Self {
618            self.0.request = v.into();
619            self
620        }
621
622        /// Sets all the options, replacing any prior values.
623        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
624            self.0.options = v.into();
625            self
626        }
627
628        /// Sends the request.
629        ///
630        /// # Long running operations
631        ///
632        /// This starts, but does not poll, a longrunning operation. More information
633        /// on [delete_service_connection_map][crate::client::CrossNetworkAutomationService::delete_service_connection_map].
634        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
635            (*self.0.stub)
636                .delete_service_connection_map(self.0.request, self.0.options)
637                .await
638                .map(crate::Response::into_body)
639        }
640
641        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_service_connection_map`.
642        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
643            type Operation =
644                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
645            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
646            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
647            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
648            if let Some(ref mut details) = poller_options.tracing {
649                details.method_name = "google_cloud_networkconnectivity_v1::client::CrossNetworkAutomationService::delete_service_connection_map::until_done";
650            }
651
652            let stub = self.0.stub.clone();
653            let mut options = self.0.options.clone();
654            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
655            let query = move |name| {
656                let stub = stub.clone();
657                let options = options.clone();
658                async {
659                    let op = GetOperation::new(stub)
660                        .set_name(name)
661                        .with_options(options)
662                        .send()
663                        .await?;
664                    Ok(Operation::new(op))
665                }
666            };
667
668            let start = move || async {
669                let op = self.send().await?;
670                Ok(Operation::new(op))
671            };
672
673            use google_cloud_lro::internal::PollerExt;
674            {
675                google_cloud_lro::internal::new_unit_response_poller(
676                    polling_error_policy,
677                    polling_backoff_policy,
678                    start,
679                    query,
680                )
681            }
682            .with_options(poller_options)
683        }
684
685        /// Sets the value of [name][crate::model::DeleteServiceConnectionMapRequest::name].
686        ///
687        /// This is a **required** field for requests.
688        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
689            self.0.request.name = v.into();
690            self
691        }
692
693        /// Sets the value of [request_id][crate::model::DeleteServiceConnectionMapRequest::request_id].
694        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
695            self.0.request.request_id = v.into();
696            self
697        }
698
699        /// Sets the value of [etag][crate::model::DeleteServiceConnectionMapRequest::etag].
700        pub fn set_etag<T>(mut self, v: T) -> Self
701        where
702            T: std::convert::Into<std::string::String>,
703        {
704            self.0.request.etag = std::option::Option::Some(v.into());
705            self
706        }
707
708        /// Sets or clears the value of [etag][crate::model::DeleteServiceConnectionMapRequest::etag].
709        pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
710        where
711            T: std::convert::Into<std::string::String>,
712        {
713            self.0.request.etag = v.map(|x| x.into());
714            self
715        }
716    }
717
718    #[doc(hidden)]
719    impl crate::RequestBuilder for DeleteServiceConnectionMap {
720        fn request_options(&mut self) -> &mut crate::RequestOptions {
721            &mut self.0.options
722        }
723    }
724
725    /// The request builder for [CrossNetworkAutomationService::list_service_connection_policies][crate::client::CrossNetworkAutomationService::list_service_connection_policies] calls.
726    ///
727    /// # Example
728    /// ```
729    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::ListServiceConnectionPolicies;
730    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
731    /// use google_cloud_gax::paginator::ItemPaginator;
732    ///
733    /// let builder = prepare_request_builder();
734    /// let mut items = builder.by_item();
735    /// while let Some(result) = items.next().await {
736    ///   let item = result?;
737    /// }
738    /// # Ok(()) }
739    ///
740    /// fn prepare_request_builder() -> ListServiceConnectionPolicies {
741    ///   # panic!();
742    ///   // ... details omitted ...
743    /// }
744    /// ```
745    #[derive(Clone, Debug)]
746    pub struct ListServiceConnectionPolicies(
747        RequestBuilder<crate::model::ListServiceConnectionPoliciesRequest>,
748    );
749
750    impl ListServiceConnectionPolicies {
751        pub(crate) fn new(
752            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
753        ) -> Self {
754            Self(RequestBuilder::new(stub))
755        }
756
757        /// Sets the full request, replacing any prior values.
758        pub fn with_request<V: Into<crate::model::ListServiceConnectionPoliciesRequest>>(
759            mut self,
760            v: V,
761        ) -> Self {
762            self.0.request = v.into();
763            self
764        }
765
766        /// Sets all the options, replacing any prior values.
767        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
768            self.0.options = v.into();
769            self
770        }
771
772        /// Sends the request.
773        pub async fn send(self) -> Result<crate::model::ListServiceConnectionPoliciesResponse> {
774            (*self.0.stub)
775                .list_service_connection_policies(self.0.request, self.0.options)
776                .await
777                .map(crate::Response::into_body)
778        }
779
780        /// Streams each page in the collection.
781        pub fn by_page(
782            self,
783        ) -> impl google_cloud_gax::paginator::Paginator<
784            crate::model::ListServiceConnectionPoliciesResponse,
785            crate::Error,
786        > {
787            use std::clone::Clone;
788            let token = self.0.request.page_token.clone();
789            let execute = move |token: String| {
790                let mut builder = self.clone();
791                builder.0.request = builder.0.request.set_page_token(token);
792                builder.send()
793            };
794            google_cloud_gax::paginator::internal::new_paginator(token, execute)
795        }
796
797        /// Streams each item in the collection.
798        pub fn by_item(
799            self,
800        ) -> impl google_cloud_gax::paginator::ItemPaginator<
801            crate::model::ListServiceConnectionPoliciesResponse,
802            crate::Error,
803        > {
804            use google_cloud_gax::paginator::Paginator;
805            self.by_page().items()
806        }
807
808        /// Sets the value of [parent][crate::model::ListServiceConnectionPoliciesRequest::parent].
809        ///
810        /// This is a **required** field for requests.
811        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
812            self.0.request.parent = v.into();
813            self
814        }
815
816        /// Sets the value of [page_size][crate::model::ListServiceConnectionPoliciesRequest::page_size].
817        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
818            self.0.request.page_size = v.into();
819            self
820        }
821
822        /// Sets the value of [page_token][crate::model::ListServiceConnectionPoliciesRequest::page_token].
823        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
824            self.0.request.page_token = v.into();
825            self
826        }
827
828        /// Sets the value of [filter][crate::model::ListServiceConnectionPoliciesRequest::filter].
829        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
830            self.0.request.filter = v.into();
831            self
832        }
833
834        /// Sets the value of [order_by][crate::model::ListServiceConnectionPoliciesRequest::order_by].
835        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
836            self.0.request.order_by = v.into();
837            self
838        }
839    }
840
841    #[doc(hidden)]
842    impl crate::RequestBuilder for ListServiceConnectionPolicies {
843        fn request_options(&mut self) -> &mut crate::RequestOptions {
844            &mut self.0.options
845        }
846    }
847
848    /// The request builder for [CrossNetworkAutomationService::get_service_connection_policy][crate::client::CrossNetworkAutomationService::get_service_connection_policy] calls.
849    ///
850    /// # Example
851    /// ```
852    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::GetServiceConnectionPolicy;
853    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
854    ///
855    /// let builder = prepare_request_builder();
856    /// let response = builder.send().await?;
857    /// # Ok(()) }
858    ///
859    /// fn prepare_request_builder() -> GetServiceConnectionPolicy {
860    ///   # panic!();
861    ///   // ... details omitted ...
862    /// }
863    /// ```
864    #[derive(Clone, Debug)]
865    pub struct GetServiceConnectionPolicy(
866        RequestBuilder<crate::model::GetServiceConnectionPolicyRequest>,
867    );
868
869    impl GetServiceConnectionPolicy {
870        pub(crate) fn new(
871            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
872        ) -> Self {
873            Self(RequestBuilder::new(stub))
874        }
875
876        /// Sets the full request, replacing any prior values.
877        pub fn with_request<V: Into<crate::model::GetServiceConnectionPolicyRequest>>(
878            mut self,
879            v: V,
880        ) -> Self {
881            self.0.request = v.into();
882            self
883        }
884
885        /// Sets all the options, replacing any prior values.
886        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
887            self.0.options = v.into();
888            self
889        }
890
891        /// Sends the request.
892        pub async fn send(self) -> Result<crate::model::ServiceConnectionPolicy> {
893            (*self.0.stub)
894                .get_service_connection_policy(self.0.request, self.0.options)
895                .await
896                .map(crate::Response::into_body)
897        }
898
899        /// Sets the value of [name][crate::model::GetServiceConnectionPolicyRequest::name].
900        ///
901        /// This is a **required** field for requests.
902        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
903            self.0.request.name = v.into();
904            self
905        }
906    }
907
908    #[doc(hidden)]
909    impl crate::RequestBuilder for GetServiceConnectionPolicy {
910        fn request_options(&mut self) -> &mut crate::RequestOptions {
911            &mut self.0.options
912        }
913    }
914
915    /// The request builder for [CrossNetworkAutomationService::create_service_connection_policy][crate::client::CrossNetworkAutomationService::create_service_connection_policy] calls.
916    ///
917    /// # Example
918    /// ```
919    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::CreateServiceConnectionPolicy;
920    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
921    /// use google_cloud_lro::Poller;
922    ///
923    /// let builder = prepare_request_builder();
924    /// let response = builder.poller().until_done().await?;
925    /// # Ok(()) }
926    ///
927    /// fn prepare_request_builder() -> CreateServiceConnectionPolicy {
928    ///   # panic!();
929    ///   // ... details omitted ...
930    /// }
931    /// ```
932    #[derive(Clone, Debug)]
933    pub struct CreateServiceConnectionPolicy(
934        RequestBuilder<crate::model::CreateServiceConnectionPolicyRequest>,
935    );
936
937    impl CreateServiceConnectionPolicy {
938        pub(crate) fn new(
939            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
940        ) -> Self {
941            Self(RequestBuilder::new(stub))
942        }
943
944        /// Sets the full request, replacing any prior values.
945        pub fn with_request<V: Into<crate::model::CreateServiceConnectionPolicyRequest>>(
946            mut self,
947            v: V,
948        ) -> Self {
949            self.0.request = v.into();
950            self
951        }
952
953        /// Sets all the options, replacing any prior values.
954        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
955            self.0.options = v.into();
956            self
957        }
958
959        /// Sends the request.
960        ///
961        /// # Long running operations
962        ///
963        /// This starts, but does not poll, a longrunning operation. More information
964        /// on [create_service_connection_policy][crate::client::CrossNetworkAutomationService::create_service_connection_policy].
965        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
966            (*self.0.stub)
967                .create_service_connection_policy(self.0.request, self.0.options)
968                .await
969                .map(crate::Response::into_body)
970        }
971
972        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_service_connection_policy`.
973        pub fn poller(
974            self,
975        ) -> impl google_cloud_lro::Poller<
976            crate::model::ServiceConnectionPolicy,
977            crate::model::OperationMetadata,
978        > {
979            type Operation = google_cloud_lro::internal::Operation<
980                crate::model::ServiceConnectionPolicy,
981                crate::model::OperationMetadata,
982            >;
983            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
984            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
985            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
986            if let Some(ref mut details) = poller_options.tracing {
987                details.method_name = "google_cloud_networkconnectivity_v1::client::CrossNetworkAutomationService::create_service_connection_policy::until_done";
988            }
989
990            let stub = self.0.stub.clone();
991            let mut options = self.0.options.clone();
992            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
993            let query = move |name| {
994                let stub = stub.clone();
995                let options = options.clone();
996                async {
997                    let op = GetOperation::new(stub)
998                        .set_name(name)
999                        .with_options(options)
1000                        .send()
1001                        .await?;
1002                    Ok(Operation::new(op))
1003                }
1004            };
1005
1006            let start = move || async {
1007                let op = self.send().await?;
1008                Ok(Operation::new(op))
1009            };
1010
1011            use google_cloud_lro::internal::PollerExt;
1012            {
1013                google_cloud_lro::internal::new_poller(
1014                    polling_error_policy,
1015                    polling_backoff_policy,
1016                    start,
1017                    query,
1018                )
1019            }
1020            .with_options(poller_options)
1021        }
1022
1023        /// Sets the value of [parent][crate::model::CreateServiceConnectionPolicyRequest::parent].
1024        ///
1025        /// This is a **required** field for requests.
1026        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1027            self.0.request.parent = v.into();
1028            self
1029        }
1030
1031        /// Sets the value of [service_connection_policy_id][crate::model::CreateServiceConnectionPolicyRequest::service_connection_policy_id].
1032        pub fn set_service_connection_policy_id<T: Into<std::string::String>>(
1033            mut self,
1034            v: T,
1035        ) -> Self {
1036            self.0.request.service_connection_policy_id = v.into();
1037            self
1038        }
1039
1040        /// Sets the value of [service_connection_policy][crate::model::CreateServiceConnectionPolicyRequest::service_connection_policy].
1041        ///
1042        /// This is a **required** field for requests.
1043        pub fn set_service_connection_policy<T>(mut self, v: T) -> Self
1044        where
1045            T: std::convert::Into<crate::model::ServiceConnectionPolicy>,
1046        {
1047            self.0.request.service_connection_policy = std::option::Option::Some(v.into());
1048            self
1049        }
1050
1051        /// Sets or clears the value of [service_connection_policy][crate::model::CreateServiceConnectionPolicyRequest::service_connection_policy].
1052        ///
1053        /// This is a **required** field for requests.
1054        pub fn set_or_clear_service_connection_policy<T>(
1055            mut self,
1056            v: std::option::Option<T>,
1057        ) -> Self
1058        where
1059            T: std::convert::Into<crate::model::ServiceConnectionPolicy>,
1060        {
1061            self.0.request.service_connection_policy = v.map(|x| x.into());
1062            self
1063        }
1064
1065        /// Sets the value of [request_id][crate::model::CreateServiceConnectionPolicyRequest::request_id].
1066        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1067            self.0.request.request_id = v.into();
1068            self
1069        }
1070    }
1071
1072    #[doc(hidden)]
1073    impl crate::RequestBuilder for CreateServiceConnectionPolicy {
1074        fn request_options(&mut self) -> &mut crate::RequestOptions {
1075            &mut self.0.options
1076        }
1077    }
1078
1079    /// The request builder for [CrossNetworkAutomationService::update_service_connection_policy][crate::client::CrossNetworkAutomationService::update_service_connection_policy] calls.
1080    ///
1081    /// # Example
1082    /// ```
1083    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::UpdateServiceConnectionPolicy;
1084    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
1085    /// use google_cloud_lro::Poller;
1086    ///
1087    /// let builder = prepare_request_builder();
1088    /// let response = builder.poller().until_done().await?;
1089    /// # Ok(()) }
1090    ///
1091    /// fn prepare_request_builder() -> UpdateServiceConnectionPolicy {
1092    ///   # panic!();
1093    ///   // ... details omitted ...
1094    /// }
1095    /// ```
1096    #[derive(Clone, Debug)]
1097    pub struct UpdateServiceConnectionPolicy(
1098        RequestBuilder<crate::model::UpdateServiceConnectionPolicyRequest>,
1099    );
1100
1101    impl UpdateServiceConnectionPolicy {
1102        pub(crate) fn new(
1103            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1104        ) -> Self {
1105            Self(RequestBuilder::new(stub))
1106        }
1107
1108        /// Sets the full request, replacing any prior values.
1109        pub fn with_request<V: Into<crate::model::UpdateServiceConnectionPolicyRequest>>(
1110            mut self,
1111            v: V,
1112        ) -> Self {
1113            self.0.request = v.into();
1114            self
1115        }
1116
1117        /// Sets all the options, replacing any prior values.
1118        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1119            self.0.options = v.into();
1120            self
1121        }
1122
1123        /// Sends the request.
1124        ///
1125        /// # Long running operations
1126        ///
1127        /// This starts, but does not poll, a longrunning operation. More information
1128        /// on [update_service_connection_policy][crate::client::CrossNetworkAutomationService::update_service_connection_policy].
1129        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1130            (*self.0.stub)
1131                .update_service_connection_policy(self.0.request, self.0.options)
1132                .await
1133                .map(crate::Response::into_body)
1134        }
1135
1136        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_service_connection_policy`.
1137        pub fn poller(
1138            self,
1139        ) -> impl google_cloud_lro::Poller<
1140            crate::model::ServiceConnectionPolicy,
1141            crate::model::OperationMetadata,
1142        > {
1143            type Operation = google_cloud_lro::internal::Operation<
1144                crate::model::ServiceConnectionPolicy,
1145                crate::model::OperationMetadata,
1146            >;
1147            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1148            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1149            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1150            if let Some(ref mut details) = poller_options.tracing {
1151                details.method_name = "google_cloud_networkconnectivity_v1::client::CrossNetworkAutomationService::update_service_connection_policy::until_done";
1152            }
1153
1154            let stub = self.0.stub.clone();
1155            let mut options = self.0.options.clone();
1156            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1157            let query = move |name| {
1158                let stub = stub.clone();
1159                let options = options.clone();
1160                async {
1161                    let op = GetOperation::new(stub)
1162                        .set_name(name)
1163                        .with_options(options)
1164                        .send()
1165                        .await?;
1166                    Ok(Operation::new(op))
1167                }
1168            };
1169
1170            let start = move || async {
1171                let op = self.send().await?;
1172                Ok(Operation::new(op))
1173            };
1174
1175            use google_cloud_lro::internal::PollerExt;
1176            {
1177                google_cloud_lro::internal::new_poller(
1178                    polling_error_policy,
1179                    polling_backoff_policy,
1180                    start,
1181                    query,
1182                )
1183            }
1184            .with_options(poller_options)
1185        }
1186
1187        /// Sets the value of [update_mask][crate::model::UpdateServiceConnectionPolicyRequest::update_mask].
1188        pub fn set_update_mask<T>(mut self, v: T) -> Self
1189        where
1190            T: std::convert::Into<wkt::FieldMask>,
1191        {
1192            self.0.request.update_mask = std::option::Option::Some(v.into());
1193            self
1194        }
1195
1196        /// Sets or clears the value of [update_mask][crate::model::UpdateServiceConnectionPolicyRequest::update_mask].
1197        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1198        where
1199            T: std::convert::Into<wkt::FieldMask>,
1200        {
1201            self.0.request.update_mask = v.map(|x| x.into());
1202            self
1203        }
1204
1205        /// Sets the value of [service_connection_policy][crate::model::UpdateServiceConnectionPolicyRequest::service_connection_policy].
1206        ///
1207        /// This is a **required** field for requests.
1208        pub fn set_service_connection_policy<T>(mut self, v: T) -> Self
1209        where
1210            T: std::convert::Into<crate::model::ServiceConnectionPolicy>,
1211        {
1212            self.0.request.service_connection_policy = std::option::Option::Some(v.into());
1213            self
1214        }
1215
1216        /// Sets or clears the value of [service_connection_policy][crate::model::UpdateServiceConnectionPolicyRequest::service_connection_policy].
1217        ///
1218        /// This is a **required** field for requests.
1219        pub fn set_or_clear_service_connection_policy<T>(
1220            mut self,
1221            v: std::option::Option<T>,
1222        ) -> Self
1223        where
1224            T: std::convert::Into<crate::model::ServiceConnectionPolicy>,
1225        {
1226            self.0.request.service_connection_policy = v.map(|x| x.into());
1227            self
1228        }
1229
1230        /// Sets the value of [request_id][crate::model::UpdateServiceConnectionPolicyRequest::request_id].
1231        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1232            self.0.request.request_id = v.into();
1233            self
1234        }
1235    }
1236
1237    #[doc(hidden)]
1238    impl crate::RequestBuilder for UpdateServiceConnectionPolicy {
1239        fn request_options(&mut self) -> &mut crate::RequestOptions {
1240            &mut self.0.options
1241        }
1242    }
1243
1244    /// The request builder for [CrossNetworkAutomationService::delete_service_connection_policy][crate::client::CrossNetworkAutomationService::delete_service_connection_policy] calls.
1245    ///
1246    /// # Example
1247    /// ```
1248    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::DeleteServiceConnectionPolicy;
1249    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
1250    /// use google_cloud_lro::Poller;
1251    ///
1252    /// let builder = prepare_request_builder();
1253    /// let response = builder.poller().until_done().await?;
1254    /// # Ok(()) }
1255    ///
1256    /// fn prepare_request_builder() -> DeleteServiceConnectionPolicy {
1257    ///   # panic!();
1258    ///   // ... details omitted ...
1259    /// }
1260    /// ```
1261    #[derive(Clone, Debug)]
1262    pub struct DeleteServiceConnectionPolicy(
1263        RequestBuilder<crate::model::DeleteServiceConnectionPolicyRequest>,
1264    );
1265
1266    impl DeleteServiceConnectionPolicy {
1267        pub(crate) fn new(
1268            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1269        ) -> Self {
1270            Self(RequestBuilder::new(stub))
1271        }
1272
1273        /// Sets the full request, replacing any prior values.
1274        pub fn with_request<V: Into<crate::model::DeleteServiceConnectionPolicyRequest>>(
1275            mut self,
1276            v: V,
1277        ) -> Self {
1278            self.0.request = v.into();
1279            self
1280        }
1281
1282        /// Sets all the options, replacing any prior values.
1283        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1284            self.0.options = v.into();
1285            self
1286        }
1287
1288        /// Sends the request.
1289        ///
1290        /// # Long running operations
1291        ///
1292        /// This starts, but does not poll, a longrunning operation. More information
1293        /// on [delete_service_connection_policy][crate::client::CrossNetworkAutomationService::delete_service_connection_policy].
1294        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1295            (*self.0.stub)
1296                .delete_service_connection_policy(self.0.request, self.0.options)
1297                .await
1298                .map(crate::Response::into_body)
1299        }
1300
1301        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_service_connection_policy`.
1302        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
1303            type Operation =
1304                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
1305            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1306            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1307            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1308            if let Some(ref mut details) = poller_options.tracing {
1309                details.method_name = "google_cloud_networkconnectivity_v1::client::CrossNetworkAutomationService::delete_service_connection_policy::until_done";
1310            }
1311
1312            let stub = self.0.stub.clone();
1313            let mut options = self.0.options.clone();
1314            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1315            let query = move |name| {
1316                let stub = stub.clone();
1317                let options = options.clone();
1318                async {
1319                    let op = GetOperation::new(stub)
1320                        .set_name(name)
1321                        .with_options(options)
1322                        .send()
1323                        .await?;
1324                    Ok(Operation::new(op))
1325                }
1326            };
1327
1328            let start = move || async {
1329                let op = self.send().await?;
1330                Ok(Operation::new(op))
1331            };
1332
1333            use google_cloud_lro::internal::PollerExt;
1334            {
1335                google_cloud_lro::internal::new_unit_response_poller(
1336                    polling_error_policy,
1337                    polling_backoff_policy,
1338                    start,
1339                    query,
1340                )
1341            }
1342            .with_options(poller_options)
1343        }
1344
1345        /// Sets the value of [name][crate::model::DeleteServiceConnectionPolicyRequest::name].
1346        ///
1347        /// This is a **required** field for requests.
1348        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1349            self.0.request.name = v.into();
1350            self
1351        }
1352
1353        /// Sets the value of [request_id][crate::model::DeleteServiceConnectionPolicyRequest::request_id].
1354        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1355            self.0.request.request_id = v.into();
1356            self
1357        }
1358
1359        /// Sets the value of [etag][crate::model::DeleteServiceConnectionPolicyRequest::etag].
1360        pub fn set_etag<T>(mut self, v: T) -> Self
1361        where
1362            T: std::convert::Into<std::string::String>,
1363        {
1364            self.0.request.etag = std::option::Option::Some(v.into());
1365            self
1366        }
1367
1368        /// Sets or clears the value of [etag][crate::model::DeleteServiceConnectionPolicyRequest::etag].
1369        pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
1370        where
1371            T: std::convert::Into<std::string::String>,
1372        {
1373            self.0.request.etag = v.map(|x| x.into());
1374            self
1375        }
1376    }
1377
1378    #[doc(hidden)]
1379    impl crate::RequestBuilder for DeleteServiceConnectionPolicy {
1380        fn request_options(&mut self) -> &mut crate::RequestOptions {
1381            &mut self.0.options
1382        }
1383    }
1384
1385    /// The request builder for [CrossNetworkAutomationService::list_service_classes][crate::client::CrossNetworkAutomationService::list_service_classes] calls.
1386    ///
1387    /// # Example
1388    /// ```
1389    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::ListServiceClasses;
1390    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
1391    /// use google_cloud_gax::paginator::ItemPaginator;
1392    ///
1393    /// let builder = prepare_request_builder();
1394    /// let mut items = builder.by_item();
1395    /// while let Some(result) = items.next().await {
1396    ///   let item = result?;
1397    /// }
1398    /// # Ok(()) }
1399    ///
1400    /// fn prepare_request_builder() -> ListServiceClasses {
1401    ///   # panic!();
1402    ///   // ... details omitted ...
1403    /// }
1404    /// ```
1405    #[derive(Clone, Debug)]
1406    pub struct ListServiceClasses(RequestBuilder<crate::model::ListServiceClassesRequest>);
1407
1408    impl ListServiceClasses {
1409        pub(crate) fn new(
1410            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1411        ) -> Self {
1412            Self(RequestBuilder::new(stub))
1413        }
1414
1415        /// Sets the full request, replacing any prior values.
1416        pub fn with_request<V: Into<crate::model::ListServiceClassesRequest>>(
1417            mut self,
1418            v: V,
1419        ) -> Self {
1420            self.0.request = v.into();
1421            self
1422        }
1423
1424        /// Sets all the options, replacing any prior values.
1425        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1426            self.0.options = v.into();
1427            self
1428        }
1429
1430        /// Sends the request.
1431        pub async fn send(self) -> Result<crate::model::ListServiceClassesResponse> {
1432            (*self.0.stub)
1433                .list_service_classes(self.0.request, self.0.options)
1434                .await
1435                .map(crate::Response::into_body)
1436        }
1437
1438        /// Streams each page in the collection.
1439        pub fn by_page(
1440            self,
1441        ) -> impl google_cloud_gax::paginator::Paginator<
1442            crate::model::ListServiceClassesResponse,
1443            crate::Error,
1444        > {
1445            use std::clone::Clone;
1446            let token = self.0.request.page_token.clone();
1447            let execute = move |token: String| {
1448                let mut builder = self.clone();
1449                builder.0.request = builder.0.request.set_page_token(token);
1450                builder.send()
1451            };
1452            google_cloud_gax::paginator::internal::new_paginator(token, execute)
1453        }
1454
1455        /// Streams each item in the collection.
1456        pub fn by_item(
1457            self,
1458        ) -> impl google_cloud_gax::paginator::ItemPaginator<
1459            crate::model::ListServiceClassesResponse,
1460            crate::Error,
1461        > {
1462            use google_cloud_gax::paginator::Paginator;
1463            self.by_page().items()
1464        }
1465
1466        /// Sets the value of [parent][crate::model::ListServiceClassesRequest::parent].
1467        ///
1468        /// This is a **required** field for requests.
1469        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1470            self.0.request.parent = v.into();
1471            self
1472        }
1473
1474        /// Sets the value of [page_size][crate::model::ListServiceClassesRequest::page_size].
1475        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1476            self.0.request.page_size = v.into();
1477            self
1478        }
1479
1480        /// Sets the value of [page_token][crate::model::ListServiceClassesRequest::page_token].
1481        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1482            self.0.request.page_token = v.into();
1483            self
1484        }
1485
1486        /// Sets the value of [filter][crate::model::ListServiceClassesRequest::filter].
1487        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1488            self.0.request.filter = v.into();
1489            self
1490        }
1491
1492        /// Sets the value of [order_by][crate::model::ListServiceClassesRequest::order_by].
1493        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1494            self.0.request.order_by = v.into();
1495            self
1496        }
1497    }
1498
1499    #[doc(hidden)]
1500    impl crate::RequestBuilder for ListServiceClasses {
1501        fn request_options(&mut self) -> &mut crate::RequestOptions {
1502            &mut self.0.options
1503        }
1504    }
1505
1506    /// The request builder for [CrossNetworkAutomationService::get_service_class][crate::client::CrossNetworkAutomationService::get_service_class] calls.
1507    ///
1508    /// # Example
1509    /// ```
1510    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::GetServiceClass;
1511    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
1512    ///
1513    /// let builder = prepare_request_builder();
1514    /// let response = builder.send().await?;
1515    /// # Ok(()) }
1516    ///
1517    /// fn prepare_request_builder() -> GetServiceClass {
1518    ///   # panic!();
1519    ///   // ... details omitted ...
1520    /// }
1521    /// ```
1522    #[derive(Clone, Debug)]
1523    pub struct GetServiceClass(RequestBuilder<crate::model::GetServiceClassRequest>);
1524
1525    impl GetServiceClass {
1526        pub(crate) fn new(
1527            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1528        ) -> Self {
1529            Self(RequestBuilder::new(stub))
1530        }
1531
1532        /// Sets the full request, replacing any prior values.
1533        pub fn with_request<V: Into<crate::model::GetServiceClassRequest>>(mut self, v: V) -> Self {
1534            self.0.request = v.into();
1535            self
1536        }
1537
1538        /// Sets all the options, replacing any prior values.
1539        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1540            self.0.options = v.into();
1541            self
1542        }
1543
1544        /// Sends the request.
1545        pub async fn send(self) -> Result<crate::model::ServiceClass> {
1546            (*self.0.stub)
1547                .get_service_class(self.0.request, self.0.options)
1548                .await
1549                .map(crate::Response::into_body)
1550        }
1551
1552        /// Sets the value of [name][crate::model::GetServiceClassRequest::name].
1553        ///
1554        /// This is a **required** field for requests.
1555        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1556            self.0.request.name = v.into();
1557            self
1558        }
1559    }
1560
1561    #[doc(hidden)]
1562    impl crate::RequestBuilder for GetServiceClass {
1563        fn request_options(&mut self) -> &mut crate::RequestOptions {
1564            &mut self.0.options
1565        }
1566    }
1567
1568    /// The request builder for [CrossNetworkAutomationService::update_service_class][crate::client::CrossNetworkAutomationService::update_service_class] calls.
1569    ///
1570    /// # Example
1571    /// ```
1572    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::UpdateServiceClass;
1573    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
1574    /// use google_cloud_lro::Poller;
1575    ///
1576    /// let builder = prepare_request_builder();
1577    /// let response = builder.poller().until_done().await?;
1578    /// # Ok(()) }
1579    ///
1580    /// fn prepare_request_builder() -> UpdateServiceClass {
1581    ///   # panic!();
1582    ///   // ... details omitted ...
1583    /// }
1584    /// ```
1585    #[derive(Clone, Debug)]
1586    pub struct UpdateServiceClass(RequestBuilder<crate::model::UpdateServiceClassRequest>);
1587
1588    impl UpdateServiceClass {
1589        pub(crate) fn new(
1590            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1591        ) -> Self {
1592            Self(RequestBuilder::new(stub))
1593        }
1594
1595        /// Sets the full request, replacing any prior values.
1596        pub fn with_request<V: Into<crate::model::UpdateServiceClassRequest>>(
1597            mut self,
1598            v: V,
1599        ) -> Self {
1600            self.0.request = v.into();
1601            self
1602        }
1603
1604        /// Sets all the options, replacing any prior values.
1605        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1606            self.0.options = v.into();
1607            self
1608        }
1609
1610        /// Sends the request.
1611        ///
1612        /// # Long running operations
1613        ///
1614        /// This starts, but does not poll, a longrunning operation. More information
1615        /// on [update_service_class][crate::client::CrossNetworkAutomationService::update_service_class].
1616        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1617            (*self.0.stub)
1618                .update_service_class(self.0.request, self.0.options)
1619                .await
1620                .map(crate::Response::into_body)
1621        }
1622
1623        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_service_class`.
1624        pub fn poller(
1625            self,
1626        ) -> impl google_cloud_lro::Poller<crate::model::ServiceClass, crate::model::OperationMetadata>
1627        {
1628            type Operation = google_cloud_lro::internal::Operation<
1629                crate::model::ServiceClass,
1630                crate::model::OperationMetadata,
1631            >;
1632            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1633            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1634            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1635            if let Some(ref mut details) = poller_options.tracing {
1636                details.method_name = "google_cloud_networkconnectivity_v1::client::CrossNetworkAutomationService::update_service_class::until_done";
1637            }
1638
1639            let stub = self.0.stub.clone();
1640            let mut options = self.0.options.clone();
1641            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1642            let query = move |name| {
1643                let stub = stub.clone();
1644                let options = options.clone();
1645                async {
1646                    let op = GetOperation::new(stub)
1647                        .set_name(name)
1648                        .with_options(options)
1649                        .send()
1650                        .await?;
1651                    Ok(Operation::new(op))
1652                }
1653            };
1654
1655            let start = move || async {
1656                let op = self.send().await?;
1657                Ok(Operation::new(op))
1658            };
1659
1660            use google_cloud_lro::internal::PollerExt;
1661            {
1662                google_cloud_lro::internal::new_poller(
1663                    polling_error_policy,
1664                    polling_backoff_policy,
1665                    start,
1666                    query,
1667                )
1668            }
1669            .with_options(poller_options)
1670        }
1671
1672        /// Sets the value of [update_mask][crate::model::UpdateServiceClassRequest::update_mask].
1673        pub fn set_update_mask<T>(mut self, v: T) -> Self
1674        where
1675            T: std::convert::Into<wkt::FieldMask>,
1676        {
1677            self.0.request.update_mask = std::option::Option::Some(v.into());
1678            self
1679        }
1680
1681        /// Sets or clears the value of [update_mask][crate::model::UpdateServiceClassRequest::update_mask].
1682        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1683        where
1684            T: std::convert::Into<wkt::FieldMask>,
1685        {
1686            self.0.request.update_mask = v.map(|x| x.into());
1687            self
1688        }
1689
1690        /// Sets the value of [service_class][crate::model::UpdateServiceClassRequest::service_class].
1691        ///
1692        /// This is a **required** field for requests.
1693        pub fn set_service_class<T>(mut self, v: T) -> Self
1694        where
1695            T: std::convert::Into<crate::model::ServiceClass>,
1696        {
1697            self.0.request.service_class = std::option::Option::Some(v.into());
1698            self
1699        }
1700
1701        /// Sets or clears the value of [service_class][crate::model::UpdateServiceClassRequest::service_class].
1702        ///
1703        /// This is a **required** field for requests.
1704        pub fn set_or_clear_service_class<T>(mut self, v: std::option::Option<T>) -> Self
1705        where
1706            T: std::convert::Into<crate::model::ServiceClass>,
1707        {
1708            self.0.request.service_class = v.map(|x| x.into());
1709            self
1710        }
1711
1712        /// Sets the value of [request_id][crate::model::UpdateServiceClassRequest::request_id].
1713        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1714            self.0.request.request_id = v.into();
1715            self
1716        }
1717    }
1718
1719    #[doc(hidden)]
1720    impl crate::RequestBuilder for UpdateServiceClass {
1721        fn request_options(&mut self) -> &mut crate::RequestOptions {
1722            &mut self.0.options
1723        }
1724    }
1725
1726    /// The request builder for [CrossNetworkAutomationService::delete_service_class][crate::client::CrossNetworkAutomationService::delete_service_class] calls.
1727    ///
1728    /// # Example
1729    /// ```
1730    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::DeleteServiceClass;
1731    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
1732    /// use google_cloud_lro::Poller;
1733    ///
1734    /// let builder = prepare_request_builder();
1735    /// let response = builder.poller().until_done().await?;
1736    /// # Ok(()) }
1737    ///
1738    /// fn prepare_request_builder() -> DeleteServiceClass {
1739    ///   # panic!();
1740    ///   // ... details omitted ...
1741    /// }
1742    /// ```
1743    #[derive(Clone, Debug)]
1744    pub struct DeleteServiceClass(RequestBuilder<crate::model::DeleteServiceClassRequest>);
1745
1746    impl DeleteServiceClass {
1747        pub(crate) fn new(
1748            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1749        ) -> Self {
1750            Self(RequestBuilder::new(stub))
1751        }
1752
1753        /// Sets the full request, replacing any prior values.
1754        pub fn with_request<V: Into<crate::model::DeleteServiceClassRequest>>(
1755            mut self,
1756            v: V,
1757        ) -> Self {
1758            self.0.request = v.into();
1759            self
1760        }
1761
1762        /// Sets all the options, replacing any prior values.
1763        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1764            self.0.options = v.into();
1765            self
1766        }
1767
1768        /// Sends the request.
1769        ///
1770        /// # Long running operations
1771        ///
1772        /// This starts, but does not poll, a longrunning operation. More information
1773        /// on [delete_service_class][crate::client::CrossNetworkAutomationService::delete_service_class].
1774        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1775            (*self.0.stub)
1776                .delete_service_class(self.0.request, self.0.options)
1777                .await
1778                .map(crate::Response::into_body)
1779        }
1780
1781        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_service_class`.
1782        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
1783            type Operation =
1784                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
1785            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1786            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1787            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1788            if let Some(ref mut details) = poller_options.tracing {
1789                details.method_name = "google_cloud_networkconnectivity_v1::client::CrossNetworkAutomationService::delete_service_class::until_done";
1790            }
1791
1792            let stub = self.0.stub.clone();
1793            let mut options = self.0.options.clone();
1794            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1795            let query = move |name| {
1796                let stub = stub.clone();
1797                let options = options.clone();
1798                async {
1799                    let op = GetOperation::new(stub)
1800                        .set_name(name)
1801                        .with_options(options)
1802                        .send()
1803                        .await?;
1804                    Ok(Operation::new(op))
1805                }
1806            };
1807
1808            let start = move || async {
1809                let op = self.send().await?;
1810                Ok(Operation::new(op))
1811            };
1812
1813            use google_cloud_lro::internal::PollerExt;
1814            {
1815                google_cloud_lro::internal::new_unit_response_poller(
1816                    polling_error_policy,
1817                    polling_backoff_policy,
1818                    start,
1819                    query,
1820                )
1821            }
1822            .with_options(poller_options)
1823        }
1824
1825        /// Sets the value of [name][crate::model::DeleteServiceClassRequest::name].
1826        ///
1827        /// This is a **required** field for requests.
1828        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1829            self.0.request.name = v.into();
1830            self
1831        }
1832
1833        /// Sets the value of [request_id][crate::model::DeleteServiceClassRequest::request_id].
1834        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1835            self.0.request.request_id = v.into();
1836            self
1837        }
1838
1839        /// Sets the value of [etag][crate::model::DeleteServiceClassRequest::etag].
1840        pub fn set_etag<T>(mut self, v: T) -> Self
1841        where
1842            T: std::convert::Into<std::string::String>,
1843        {
1844            self.0.request.etag = std::option::Option::Some(v.into());
1845            self
1846        }
1847
1848        /// Sets or clears the value of [etag][crate::model::DeleteServiceClassRequest::etag].
1849        pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
1850        where
1851            T: std::convert::Into<std::string::String>,
1852        {
1853            self.0.request.etag = v.map(|x| x.into());
1854            self
1855        }
1856    }
1857
1858    #[doc(hidden)]
1859    impl crate::RequestBuilder for DeleteServiceClass {
1860        fn request_options(&mut self) -> &mut crate::RequestOptions {
1861            &mut self.0.options
1862        }
1863    }
1864
1865    /// The request builder for [CrossNetworkAutomationService::get_service_connection_token][crate::client::CrossNetworkAutomationService::get_service_connection_token] calls.
1866    ///
1867    /// # Example
1868    /// ```
1869    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::GetServiceConnectionToken;
1870    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
1871    ///
1872    /// let builder = prepare_request_builder();
1873    /// let response = builder.send().await?;
1874    /// # Ok(()) }
1875    ///
1876    /// fn prepare_request_builder() -> GetServiceConnectionToken {
1877    ///   # panic!();
1878    ///   // ... details omitted ...
1879    /// }
1880    /// ```
1881    #[derive(Clone, Debug)]
1882    pub struct GetServiceConnectionToken(
1883        RequestBuilder<crate::model::GetServiceConnectionTokenRequest>,
1884    );
1885
1886    impl GetServiceConnectionToken {
1887        pub(crate) fn new(
1888            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1889        ) -> Self {
1890            Self(RequestBuilder::new(stub))
1891        }
1892
1893        /// Sets the full request, replacing any prior values.
1894        pub fn with_request<V: Into<crate::model::GetServiceConnectionTokenRequest>>(
1895            mut self,
1896            v: V,
1897        ) -> Self {
1898            self.0.request = v.into();
1899            self
1900        }
1901
1902        /// Sets all the options, replacing any prior values.
1903        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1904            self.0.options = v.into();
1905            self
1906        }
1907
1908        /// Sends the request.
1909        pub async fn send(self) -> Result<crate::model::ServiceConnectionToken> {
1910            (*self.0.stub)
1911                .get_service_connection_token(self.0.request, self.0.options)
1912                .await
1913                .map(crate::Response::into_body)
1914        }
1915
1916        /// Sets the value of [name][crate::model::GetServiceConnectionTokenRequest::name].
1917        ///
1918        /// This is a **required** field for requests.
1919        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1920            self.0.request.name = v.into();
1921            self
1922        }
1923    }
1924
1925    #[doc(hidden)]
1926    impl crate::RequestBuilder for GetServiceConnectionToken {
1927        fn request_options(&mut self) -> &mut crate::RequestOptions {
1928            &mut self.0.options
1929        }
1930    }
1931
1932    /// The request builder for [CrossNetworkAutomationService::list_service_connection_tokens][crate::client::CrossNetworkAutomationService::list_service_connection_tokens] calls.
1933    ///
1934    /// # Example
1935    /// ```
1936    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::ListServiceConnectionTokens;
1937    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
1938    /// use google_cloud_gax::paginator::ItemPaginator;
1939    ///
1940    /// let builder = prepare_request_builder();
1941    /// let mut items = builder.by_item();
1942    /// while let Some(result) = items.next().await {
1943    ///   let item = result?;
1944    /// }
1945    /// # Ok(()) }
1946    ///
1947    /// fn prepare_request_builder() -> ListServiceConnectionTokens {
1948    ///   # panic!();
1949    ///   // ... details omitted ...
1950    /// }
1951    /// ```
1952    #[derive(Clone, Debug)]
1953    pub struct ListServiceConnectionTokens(
1954        RequestBuilder<crate::model::ListServiceConnectionTokensRequest>,
1955    );
1956
1957    impl ListServiceConnectionTokens {
1958        pub(crate) fn new(
1959            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1960        ) -> Self {
1961            Self(RequestBuilder::new(stub))
1962        }
1963
1964        /// Sets the full request, replacing any prior values.
1965        pub fn with_request<V: Into<crate::model::ListServiceConnectionTokensRequest>>(
1966            mut self,
1967            v: V,
1968        ) -> Self {
1969            self.0.request = v.into();
1970            self
1971        }
1972
1973        /// Sets all the options, replacing any prior values.
1974        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1975            self.0.options = v.into();
1976            self
1977        }
1978
1979        /// Sends the request.
1980        pub async fn send(self) -> Result<crate::model::ListServiceConnectionTokensResponse> {
1981            (*self.0.stub)
1982                .list_service_connection_tokens(self.0.request, self.0.options)
1983                .await
1984                .map(crate::Response::into_body)
1985        }
1986
1987        /// Streams each page in the collection.
1988        pub fn by_page(
1989            self,
1990        ) -> impl google_cloud_gax::paginator::Paginator<
1991            crate::model::ListServiceConnectionTokensResponse,
1992            crate::Error,
1993        > {
1994            use std::clone::Clone;
1995            let token = self.0.request.page_token.clone();
1996            let execute = move |token: String| {
1997                let mut builder = self.clone();
1998                builder.0.request = builder.0.request.set_page_token(token);
1999                builder.send()
2000            };
2001            google_cloud_gax::paginator::internal::new_paginator(token, execute)
2002        }
2003
2004        /// Streams each item in the collection.
2005        pub fn by_item(
2006            self,
2007        ) -> impl google_cloud_gax::paginator::ItemPaginator<
2008            crate::model::ListServiceConnectionTokensResponse,
2009            crate::Error,
2010        > {
2011            use google_cloud_gax::paginator::Paginator;
2012            self.by_page().items()
2013        }
2014
2015        /// Sets the value of [parent][crate::model::ListServiceConnectionTokensRequest::parent].
2016        ///
2017        /// This is a **required** field for requests.
2018        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2019            self.0.request.parent = v.into();
2020            self
2021        }
2022
2023        /// Sets the value of [page_size][crate::model::ListServiceConnectionTokensRequest::page_size].
2024        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2025            self.0.request.page_size = v.into();
2026            self
2027        }
2028
2029        /// Sets the value of [page_token][crate::model::ListServiceConnectionTokensRequest::page_token].
2030        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2031            self.0.request.page_token = v.into();
2032            self
2033        }
2034
2035        /// Sets the value of [filter][crate::model::ListServiceConnectionTokensRequest::filter].
2036        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2037            self.0.request.filter = v.into();
2038            self
2039        }
2040
2041        /// Sets the value of [order_by][crate::model::ListServiceConnectionTokensRequest::order_by].
2042        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
2043            self.0.request.order_by = v.into();
2044            self
2045        }
2046    }
2047
2048    #[doc(hidden)]
2049    impl crate::RequestBuilder for ListServiceConnectionTokens {
2050        fn request_options(&mut self) -> &mut crate::RequestOptions {
2051            &mut self.0.options
2052        }
2053    }
2054
2055    /// The request builder for [CrossNetworkAutomationService::create_service_connection_token][crate::client::CrossNetworkAutomationService::create_service_connection_token] calls.
2056    ///
2057    /// # Example
2058    /// ```
2059    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::CreateServiceConnectionToken;
2060    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
2061    /// use google_cloud_lro::Poller;
2062    ///
2063    /// let builder = prepare_request_builder();
2064    /// let response = builder.poller().until_done().await?;
2065    /// # Ok(()) }
2066    ///
2067    /// fn prepare_request_builder() -> CreateServiceConnectionToken {
2068    ///   # panic!();
2069    ///   // ... details omitted ...
2070    /// }
2071    /// ```
2072    #[derive(Clone, Debug)]
2073    pub struct CreateServiceConnectionToken(
2074        RequestBuilder<crate::model::CreateServiceConnectionTokenRequest>,
2075    );
2076
2077    impl CreateServiceConnectionToken {
2078        pub(crate) fn new(
2079            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2080        ) -> Self {
2081            Self(RequestBuilder::new(stub))
2082        }
2083
2084        /// Sets the full request, replacing any prior values.
2085        pub fn with_request<V: Into<crate::model::CreateServiceConnectionTokenRequest>>(
2086            mut self,
2087            v: V,
2088        ) -> Self {
2089            self.0.request = v.into();
2090            self
2091        }
2092
2093        /// Sets all the options, replacing any prior values.
2094        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2095            self.0.options = v.into();
2096            self
2097        }
2098
2099        /// Sends the request.
2100        ///
2101        /// # Long running operations
2102        ///
2103        /// This starts, but does not poll, a longrunning operation. More information
2104        /// on [create_service_connection_token][crate::client::CrossNetworkAutomationService::create_service_connection_token].
2105        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2106            (*self.0.stub)
2107                .create_service_connection_token(self.0.request, self.0.options)
2108                .await
2109                .map(crate::Response::into_body)
2110        }
2111
2112        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_service_connection_token`.
2113        pub fn poller(
2114            self,
2115        ) -> impl google_cloud_lro::Poller<
2116            crate::model::ServiceConnectionToken,
2117            crate::model::OperationMetadata,
2118        > {
2119            type Operation = google_cloud_lro::internal::Operation<
2120                crate::model::ServiceConnectionToken,
2121                crate::model::OperationMetadata,
2122            >;
2123            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2124            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2125            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
2126            if let Some(ref mut details) = poller_options.tracing {
2127                details.method_name = "google_cloud_networkconnectivity_v1::client::CrossNetworkAutomationService::create_service_connection_token::until_done";
2128            }
2129
2130            let stub = self.0.stub.clone();
2131            let mut options = self.0.options.clone();
2132            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2133            let query = move |name| {
2134                let stub = stub.clone();
2135                let options = options.clone();
2136                async {
2137                    let op = GetOperation::new(stub)
2138                        .set_name(name)
2139                        .with_options(options)
2140                        .send()
2141                        .await?;
2142                    Ok(Operation::new(op))
2143                }
2144            };
2145
2146            let start = move || async {
2147                let op = self.send().await?;
2148                Ok(Operation::new(op))
2149            };
2150
2151            use google_cloud_lro::internal::PollerExt;
2152            {
2153                google_cloud_lro::internal::new_poller(
2154                    polling_error_policy,
2155                    polling_backoff_policy,
2156                    start,
2157                    query,
2158                )
2159            }
2160            .with_options(poller_options)
2161        }
2162
2163        /// Sets the value of [parent][crate::model::CreateServiceConnectionTokenRequest::parent].
2164        ///
2165        /// This is a **required** field for requests.
2166        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2167            self.0.request.parent = v.into();
2168            self
2169        }
2170
2171        /// Sets the value of [service_connection_token_id][crate::model::CreateServiceConnectionTokenRequest::service_connection_token_id].
2172        pub fn set_service_connection_token_id<T: Into<std::string::String>>(
2173            mut self,
2174            v: T,
2175        ) -> Self {
2176            self.0.request.service_connection_token_id = v.into();
2177            self
2178        }
2179
2180        /// Sets the value of [service_connection_token][crate::model::CreateServiceConnectionTokenRequest::service_connection_token].
2181        ///
2182        /// This is a **required** field for requests.
2183        pub fn set_service_connection_token<T>(mut self, v: T) -> Self
2184        where
2185            T: std::convert::Into<crate::model::ServiceConnectionToken>,
2186        {
2187            self.0.request.service_connection_token = std::option::Option::Some(v.into());
2188            self
2189        }
2190
2191        /// Sets or clears the value of [service_connection_token][crate::model::CreateServiceConnectionTokenRequest::service_connection_token].
2192        ///
2193        /// This is a **required** field for requests.
2194        pub fn set_or_clear_service_connection_token<T>(mut self, v: std::option::Option<T>) -> Self
2195        where
2196            T: std::convert::Into<crate::model::ServiceConnectionToken>,
2197        {
2198            self.0.request.service_connection_token = v.map(|x| x.into());
2199            self
2200        }
2201
2202        /// Sets the value of [request_id][crate::model::CreateServiceConnectionTokenRequest::request_id].
2203        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2204            self.0.request.request_id = v.into();
2205            self
2206        }
2207    }
2208
2209    #[doc(hidden)]
2210    impl crate::RequestBuilder for CreateServiceConnectionToken {
2211        fn request_options(&mut self) -> &mut crate::RequestOptions {
2212            &mut self.0.options
2213        }
2214    }
2215
2216    /// The request builder for [CrossNetworkAutomationService::delete_service_connection_token][crate::client::CrossNetworkAutomationService::delete_service_connection_token] calls.
2217    ///
2218    /// # Example
2219    /// ```
2220    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::DeleteServiceConnectionToken;
2221    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
2222    /// use google_cloud_lro::Poller;
2223    ///
2224    /// let builder = prepare_request_builder();
2225    /// let response = builder.poller().until_done().await?;
2226    /// # Ok(()) }
2227    ///
2228    /// fn prepare_request_builder() -> DeleteServiceConnectionToken {
2229    ///   # panic!();
2230    ///   // ... details omitted ...
2231    /// }
2232    /// ```
2233    #[derive(Clone, Debug)]
2234    pub struct DeleteServiceConnectionToken(
2235        RequestBuilder<crate::model::DeleteServiceConnectionTokenRequest>,
2236    );
2237
2238    impl DeleteServiceConnectionToken {
2239        pub(crate) fn new(
2240            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2241        ) -> Self {
2242            Self(RequestBuilder::new(stub))
2243        }
2244
2245        /// Sets the full request, replacing any prior values.
2246        pub fn with_request<V: Into<crate::model::DeleteServiceConnectionTokenRequest>>(
2247            mut self,
2248            v: V,
2249        ) -> Self {
2250            self.0.request = v.into();
2251            self
2252        }
2253
2254        /// Sets all the options, replacing any prior values.
2255        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2256            self.0.options = v.into();
2257            self
2258        }
2259
2260        /// Sends the request.
2261        ///
2262        /// # Long running operations
2263        ///
2264        /// This starts, but does not poll, a longrunning operation. More information
2265        /// on [delete_service_connection_token][crate::client::CrossNetworkAutomationService::delete_service_connection_token].
2266        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2267            (*self.0.stub)
2268                .delete_service_connection_token(self.0.request, self.0.options)
2269                .await
2270                .map(crate::Response::into_body)
2271        }
2272
2273        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_service_connection_token`.
2274        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
2275            type Operation =
2276                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2277            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2278            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2279            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
2280            if let Some(ref mut details) = poller_options.tracing {
2281                details.method_name = "google_cloud_networkconnectivity_v1::client::CrossNetworkAutomationService::delete_service_connection_token::until_done";
2282            }
2283
2284            let stub = self.0.stub.clone();
2285            let mut options = self.0.options.clone();
2286            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2287            let query = move |name| {
2288                let stub = stub.clone();
2289                let options = options.clone();
2290                async {
2291                    let op = GetOperation::new(stub)
2292                        .set_name(name)
2293                        .with_options(options)
2294                        .send()
2295                        .await?;
2296                    Ok(Operation::new(op))
2297                }
2298            };
2299
2300            let start = move || async {
2301                let op = self.send().await?;
2302                Ok(Operation::new(op))
2303            };
2304
2305            use google_cloud_lro::internal::PollerExt;
2306            {
2307                google_cloud_lro::internal::new_unit_response_poller(
2308                    polling_error_policy,
2309                    polling_backoff_policy,
2310                    start,
2311                    query,
2312                )
2313            }
2314            .with_options(poller_options)
2315        }
2316
2317        /// Sets the value of [name][crate::model::DeleteServiceConnectionTokenRequest::name].
2318        ///
2319        /// This is a **required** field for requests.
2320        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2321            self.0.request.name = v.into();
2322            self
2323        }
2324
2325        /// Sets the value of [request_id][crate::model::DeleteServiceConnectionTokenRequest::request_id].
2326        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2327            self.0.request.request_id = v.into();
2328            self
2329        }
2330
2331        /// Sets the value of [etag][crate::model::DeleteServiceConnectionTokenRequest::etag].
2332        pub fn set_etag<T>(mut self, v: T) -> Self
2333        where
2334            T: std::convert::Into<std::string::String>,
2335        {
2336            self.0.request.etag = std::option::Option::Some(v.into());
2337            self
2338        }
2339
2340        /// Sets or clears the value of [etag][crate::model::DeleteServiceConnectionTokenRequest::etag].
2341        pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
2342        where
2343            T: std::convert::Into<std::string::String>,
2344        {
2345            self.0.request.etag = v.map(|x| x.into());
2346            self
2347        }
2348    }
2349
2350    #[doc(hidden)]
2351    impl crate::RequestBuilder for DeleteServiceConnectionToken {
2352        fn request_options(&mut self) -> &mut crate::RequestOptions {
2353            &mut self.0.options
2354        }
2355    }
2356
2357    /// The request builder for [CrossNetworkAutomationService::list_locations][crate::client::CrossNetworkAutomationService::list_locations] calls.
2358    ///
2359    /// # Example
2360    /// ```
2361    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::ListLocations;
2362    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
2363    /// use google_cloud_gax::paginator::ItemPaginator;
2364    ///
2365    /// let builder = prepare_request_builder();
2366    /// let mut items = builder.by_item();
2367    /// while let Some(result) = items.next().await {
2368    ///   let item = result?;
2369    /// }
2370    /// # Ok(()) }
2371    ///
2372    /// fn prepare_request_builder() -> ListLocations {
2373    ///   # panic!();
2374    ///   // ... details omitted ...
2375    /// }
2376    /// ```
2377    #[derive(Clone, Debug)]
2378    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
2379
2380    impl ListLocations {
2381        pub(crate) fn new(
2382            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2383        ) -> Self {
2384            Self(RequestBuilder::new(stub))
2385        }
2386
2387        /// Sets the full request, replacing any prior values.
2388        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
2389            mut self,
2390            v: V,
2391        ) -> Self {
2392            self.0.request = v.into();
2393            self
2394        }
2395
2396        /// Sets all the options, replacing any prior values.
2397        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2398            self.0.options = v.into();
2399            self
2400        }
2401
2402        /// Sends the request.
2403        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
2404            (*self.0.stub)
2405                .list_locations(self.0.request, self.0.options)
2406                .await
2407                .map(crate::Response::into_body)
2408        }
2409
2410        /// Streams each page in the collection.
2411        pub fn by_page(
2412            self,
2413        ) -> impl google_cloud_gax::paginator::Paginator<
2414            google_cloud_location::model::ListLocationsResponse,
2415            crate::Error,
2416        > {
2417            use std::clone::Clone;
2418            let token = self.0.request.page_token.clone();
2419            let execute = move |token: String| {
2420                let mut builder = self.clone();
2421                builder.0.request = builder.0.request.set_page_token(token);
2422                builder.send()
2423            };
2424            google_cloud_gax::paginator::internal::new_paginator(token, execute)
2425        }
2426
2427        /// Streams each item in the collection.
2428        pub fn by_item(
2429            self,
2430        ) -> impl google_cloud_gax::paginator::ItemPaginator<
2431            google_cloud_location::model::ListLocationsResponse,
2432            crate::Error,
2433        > {
2434            use google_cloud_gax::paginator::Paginator;
2435            self.by_page().items()
2436        }
2437
2438        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
2439        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2440            self.0.request.name = v.into();
2441            self
2442        }
2443
2444        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
2445        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2446            self.0.request.filter = v.into();
2447            self
2448        }
2449
2450        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
2451        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2452            self.0.request.page_size = v.into();
2453            self
2454        }
2455
2456        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
2457        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2458            self.0.request.page_token = v.into();
2459            self
2460        }
2461    }
2462
2463    #[doc(hidden)]
2464    impl crate::RequestBuilder for ListLocations {
2465        fn request_options(&mut self) -> &mut crate::RequestOptions {
2466            &mut self.0.options
2467        }
2468    }
2469
2470    /// The request builder for [CrossNetworkAutomationService::get_location][crate::client::CrossNetworkAutomationService::get_location] calls.
2471    ///
2472    /// # Example
2473    /// ```
2474    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::GetLocation;
2475    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
2476    ///
2477    /// let builder = prepare_request_builder();
2478    /// let response = builder.send().await?;
2479    /// # Ok(()) }
2480    ///
2481    /// fn prepare_request_builder() -> GetLocation {
2482    ///   # panic!();
2483    ///   // ... details omitted ...
2484    /// }
2485    /// ```
2486    #[derive(Clone, Debug)]
2487    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
2488
2489    impl GetLocation {
2490        pub(crate) fn new(
2491            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2492        ) -> Self {
2493            Self(RequestBuilder::new(stub))
2494        }
2495
2496        /// Sets the full request, replacing any prior values.
2497        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
2498            mut self,
2499            v: V,
2500        ) -> Self {
2501            self.0.request = v.into();
2502            self
2503        }
2504
2505        /// Sets all the options, replacing any prior values.
2506        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2507            self.0.options = v.into();
2508            self
2509        }
2510
2511        /// Sends the request.
2512        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
2513            (*self.0.stub)
2514                .get_location(self.0.request, self.0.options)
2515                .await
2516                .map(crate::Response::into_body)
2517        }
2518
2519        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
2520        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2521            self.0.request.name = v.into();
2522            self
2523        }
2524    }
2525
2526    #[doc(hidden)]
2527    impl crate::RequestBuilder for GetLocation {
2528        fn request_options(&mut self) -> &mut crate::RequestOptions {
2529            &mut self.0.options
2530        }
2531    }
2532
2533    /// The request builder for [CrossNetworkAutomationService::set_iam_policy][crate::client::CrossNetworkAutomationService::set_iam_policy] calls.
2534    ///
2535    /// # Example
2536    /// ```
2537    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::SetIamPolicy;
2538    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
2539    ///
2540    /// let builder = prepare_request_builder();
2541    /// let response = builder.send().await?;
2542    /// # Ok(()) }
2543    ///
2544    /// fn prepare_request_builder() -> SetIamPolicy {
2545    ///   # panic!();
2546    ///   // ... details omitted ...
2547    /// }
2548    /// ```
2549    #[derive(Clone, Debug)]
2550    pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
2551
2552    impl SetIamPolicy {
2553        pub(crate) fn new(
2554            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2555        ) -> Self {
2556            Self(RequestBuilder::new(stub))
2557        }
2558
2559        /// Sets the full request, replacing any prior values.
2560        pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
2561            mut self,
2562            v: V,
2563        ) -> Self {
2564            self.0.request = v.into();
2565            self
2566        }
2567
2568        /// Sets all the options, replacing any prior values.
2569        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2570            self.0.options = v.into();
2571            self
2572        }
2573
2574        /// Sends the request.
2575        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
2576            (*self.0.stub)
2577                .set_iam_policy(self.0.request, self.0.options)
2578                .await
2579                .map(crate::Response::into_body)
2580        }
2581
2582        /// Sets the value of [resource][google_cloud_iam_v1::model::SetIamPolicyRequest::resource].
2583        ///
2584        /// This is a **required** field for requests.
2585        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2586            self.0.request.resource = v.into();
2587            self
2588        }
2589
2590        /// Sets the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
2591        ///
2592        /// This is a **required** field for requests.
2593        pub fn set_policy<T>(mut self, v: T) -> Self
2594        where
2595            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
2596        {
2597            self.0.request.policy = std::option::Option::Some(v.into());
2598            self
2599        }
2600
2601        /// Sets or clears the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
2602        ///
2603        /// This is a **required** field for requests.
2604        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
2605        where
2606            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
2607        {
2608            self.0.request.policy = v.map(|x| x.into());
2609            self
2610        }
2611
2612        /// Sets the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
2613        pub fn set_update_mask<T>(mut self, v: T) -> Self
2614        where
2615            T: std::convert::Into<wkt::FieldMask>,
2616        {
2617            self.0.request.update_mask = std::option::Option::Some(v.into());
2618            self
2619        }
2620
2621        /// Sets or clears the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
2622        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2623        where
2624            T: std::convert::Into<wkt::FieldMask>,
2625        {
2626            self.0.request.update_mask = v.map(|x| x.into());
2627            self
2628        }
2629    }
2630
2631    #[doc(hidden)]
2632    impl crate::RequestBuilder for SetIamPolicy {
2633        fn request_options(&mut self) -> &mut crate::RequestOptions {
2634            &mut self.0.options
2635        }
2636    }
2637
2638    /// The request builder for [CrossNetworkAutomationService::get_iam_policy][crate::client::CrossNetworkAutomationService::get_iam_policy] calls.
2639    ///
2640    /// # Example
2641    /// ```
2642    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::GetIamPolicy;
2643    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
2644    ///
2645    /// let builder = prepare_request_builder();
2646    /// let response = builder.send().await?;
2647    /// # Ok(()) }
2648    ///
2649    /// fn prepare_request_builder() -> GetIamPolicy {
2650    ///   # panic!();
2651    ///   // ... details omitted ...
2652    /// }
2653    /// ```
2654    #[derive(Clone, Debug)]
2655    pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
2656
2657    impl GetIamPolicy {
2658        pub(crate) fn new(
2659            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2660        ) -> Self {
2661            Self(RequestBuilder::new(stub))
2662        }
2663
2664        /// Sets the full request, replacing any prior values.
2665        pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
2666            mut self,
2667            v: V,
2668        ) -> Self {
2669            self.0.request = v.into();
2670            self
2671        }
2672
2673        /// Sets all the options, replacing any prior values.
2674        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2675            self.0.options = v.into();
2676            self
2677        }
2678
2679        /// Sends the request.
2680        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
2681            (*self.0.stub)
2682                .get_iam_policy(self.0.request, self.0.options)
2683                .await
2684                .map(crate::Response::into_body)
2685        }
2686
2687        /// Sets the value of [resource][google_cloud_iam_v1::model::GetIamPolicyRequest::resource].
2688        ///
2689        /// This is a **required** field for requests.
2690        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2691            self.0.request.resource = v.into();
2692            self
2693        }
2694
2695        /// Sets the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
2696        pub fn set_options<T>(mut self, v: T) -> Self
2697        where
2698            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
2699        {
2700            self.0.request.options = std::option::Option::Some(v.into());
2701            self
2702        }
2703
2704        /// Sets or clears the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
2705        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
2706        where
2707            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
2708        {
2709            self.0.request.options = v.map(|x| x.into());
2710            self
2711        }
2712    }
2713
2714    #[doc(hidden)]
2715    impl crate::RequestBuilder for GetIamPolicy {
2716        fn request_options(&mut self) -> &mut crate::RequestOptions {
2717            &mut self.0.options
2718        }
2719    }
2720
2721    /// The request builder for [CrossNetworkAutomationService::test_iam_permissions][crate::client::CrossNetworkAutomationService::test_iam_permissions] calls.
2722    ///
2723    /// # Example
2724    /// ```
2725    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::TestIamPermissions;
2726    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
2727    ///
2728    /// let builder = prepare_request_builder();
2729    /// let response = builder.send().await?;
2730    /// # Ok(()) }
2731    ///
2732    /// fn prepare_request_builder() -> TestIamPermissions {
2733    ///   # panic!();
2734    ///   // ... details omitted ...
2735    /// }
2736    /// ```
2737    #[derive(Clone, Debug)]
2738    pub struct TestIamPermissions(
2739        RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
2740    );
2741
2742    impl TestIamPermissions {
2743        pub(crate) fn new(
2744            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2745        ) -> Self {
2746            Self(RequestBuilder::new(stub))
2747        }
2748
2749        /// Sets the full request, replacing any prior values.
2750        pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
2751            mut self,
2752            v: V,
2753        ) -> Self {
2754            self.0.request = v.into();
2755            self
2756        }
2757
2758        /// Sets all the options, replacing any prior values.
2759        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2760            self.0.options = v.into();
2761            self
2762        }
2763
2764        /// Sends the request.
2765        pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
2766            (*self.0.stub)
2767                .test_iam_permissions(self.0.request, self.0.options)
2768                .await
2769                .map(crate::Response::into_body)
2770        }
2771
2772        /// Sets the value of [resource][google_cloud_iam_v1::model::TestIamPermissionsRequest::resource].
2773        ///
2774        /// This is a **required** field for requests.
2775        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2776            self.0.request.resource = v.into();
2777            self
2778        }
2779
2780        /// Sets the value of [permissions][google_cloud_iam_v1::model::TestIamPermissionsRequest::permissions].
2781        ///
2782        /// This is a **required** field for requests.
2783        pub fn set_permissions<T, V>(mut self, v: T) -> Self
2784        where
2785            T: std::iter::IntoIterator<Item = V>,
2786            V: std::convert::Into<std::string::String>,
2787        {
2788            use std::iter::Iterator;
2789            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
2790            self
2791        }
2792    }
2793
2794    #[doc(hidden)]
2795    impl crate::RequestBuilder for TestIamPermissions {
2796        fn request_options(&mut self) -> &mut crate::RequestOptions {
2797            &mut self.0.options
2798        }
2799    }
2800
2801    /// The request builder for [CrossNetworkAutomationService::list_operations][crate::client::CrossNetworkAutomationService::list_operations] calls.
2802    ///
2803    /// # Example
2804    /// ```
2805    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::ListOperations;
2806    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
2807    /// use google_cloud_gax::paginator::ItemPaginator;
2808    ///
2809    /// let builder = prepare_request_builder();
2810    /// let mut items = builder.by_item();
2811    /// while let Some(result) = items.next().await {
2812    ///   let item = result?;
2813    /// }
2814    /// # Ok(()) }
2815    ///
2816    /// fn prepare_request_builder() -> ListOperations {
2817    ///   # panic!();
2818    ///   // ... details omitted ...
2819    /// }
2820    /// ```
2821    #[derive(Clone, Debug)]
2822    pub struct ListOperations(
2823        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
2824    );
2825
2826    impl ListOperations {
2827        pub(crate) fn new(
2828            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2829        ) -> Self {
2830            Self(RequestBuilder::new(stub))
2831        }
2832
2833        /// Sets the full request, replacing any prior values.
2834        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
2835            mut self,
2836            v: V,
2837        ) -> Self {
2838            self.0.request = v.into();
2839            self
2840        }
2841
2842        /// Sets all the options, replacing any prior values.
2843        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2844            self.0.options = v.into();
2845            self
2846        }
2847
2848        /// Sends the request.
2849        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
2850            (*self.0.stub)
2851                .list_operations(self.0.request, self.0.options)
2852                .await
2853                .map(crate::Response::into_body)
2854        }
2855
2856        /// Streams each page in the collection.
2857        pub fn by_page(
2858            self,
2859        ) -> impl google_cloud_gax::paginator::Paginator<
2860            google_cloud_longrunning::model::ListOperationsResponse,
2861            crate::Error,
2862        > {
2863            use std::clone::Clone;
2864            let token = self.0.request.page_token.clone();
2865            let execute = move |token: String| {
2866                let mut builder = self.clone();
2867                builder.0.request = builder.0.request.set_page_token(token);
2868                builder.send()
2869            };
2870            google_cloud_gax::paginator::internal::new_paginator(token, execute)
2871        }
2872
2873        /// Streams each item in the collection.
2874        pub fn by_item(
2875            self,
2876        ) -> impl google_cloud_gax::paginator::ItemPaginator<
2877            google_cloud_longrunning::model::ListOperationsResponse,
2878            crate::Error,
2879        > {
2880            use google_cloud_gax::paginator::Paginator;
2881            self.by_page().items()
2882        }
2883
2884        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
2885        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2886            self.0.request.name = v.into();
2887            self
2888        }
2889
2890        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
2891        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2892            self.0.request.filter = v.into();
2893            self
2894        }
2895
2896        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
2897        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2898            self.0.request.page_size = v.into();
2899            self
2900        }
2901
2902        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
2903        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2904            self.0.request.page_token = v.into();
2905            self
2906        }
2907
2908        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
2909        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
2910            self.0.request.return_partial_success = v.into();
2911            self
2912        }
2913    }
2914
2915    #[doc(hidden)]
2916    impl crate::RequestBuilder for ListOperations {
2917        fn request_options(&mut self) -> &mut crate::RequestOptions {
2918            &mut self.0.options
2919        }
2920    }
2921
2922    /// The request builder for [CrossNetworkAutomationService::get_operation][crate::client::CrossNetworkAutomationService::get_operation] calls.
2923    ///
2924    /// # Example
2925    /// ```
2926    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::GetOperation;
2927    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
2928    ///
2929    /// let builder = prepare_request_builder();
2930    /// let response = builder.send().await?;
2931    /// # Ok(()) }
2932    ///
2933    /// fn prepare_request_builder() -> GetOperation {
2934    ///   # panic!();
2935    ///   // ... details omitted ...
2936    /// }
2937    /// ```
2938    #[derive(Clone, Debug)]
2939    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
2940
2941    impl GetOperation {
2942        pub(crate) fn new(
2943            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2944        ) -> Self {
2945            Self(RequestBuilder::new(stub))
2946        }
2947
2948        /// Sets the full request, replacing any prior values.
2949        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
2950            mut self,
2951            v: V,
2952        ) -> Self {
2953            self.0.request = v.into();
2954            self
2955        }
2956
2957        /// Sets all the options, replacing any prior values.
2958        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2959            self.0.options = v.into();
2960            self
2961        }
2962
2963        /// Sends the request.
2964        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2965            (*self.0.stub)
2966                .get_operation(self.0.request, self.0.options)
2967                .await
2968                .map(crate::Response::into_body)
2969        }
2970
2971        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
2972        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2973            self.0.request.name = v.into();
2974            self
2975        }
2976    }
2977
2978    #[doc(hidden)]
2979    impl crate::RequestBuilder for GetOperation {
2980        fn request_options(&mut self) -> &mut crate::RequestOptions {
2981            &mut self.0.options
2982        }
2983    }
2984
2985    /// The request builder for [CrossNetworkAutomationService::delete_operation][crate::client::CrossNetworkAutomationService::delete_operation] calls.
2986    ///
2987    /// # Example
2988    /// ```
2989    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::DeleteOperation;
2990    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
2991    ///
2992    /// let builder = prepare_request_builder();
2993    /// let response = builder.send().await?;
2994    /// # Ok(()) }
2995    ///
2996    /// fn prepare_request_builder() -> DeleteOperation {
2997    ///   # panic!();
2998    ///   // ... details omitted ...
2999    /// }
3000    /// ```
3001    #[derive(Clone, Debug)]
3002    pub struct DeleteOperation(
3003        RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
3004    );
3005
3006    impl DeleteOperation {
3007        pub(crate) fn new(
3008            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
3009        ) -> Self {
3010            Self(RequestBuilder::new(stub))
3011        }
3012
3013        /// Sets the full request, replacing any prior values.
3014        pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
3015            mut self,
3016            v: V,
3017        ) -> Self {
3018            self.0.request = v.into();
3019            self
3020        }
3021
3022        /// Sets all the options, replacing any prior values.
3023        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3024            self.0.options = v.into();
3025            self
3026        }
3027
3028        /// Sends the request.
3029        pub async fn send(self) -> Result<()> {
3030            (*self.0.stub)
3031                .delete_operation(self.0.request, self.0.options)
3032                .await
3033                .map(crate::Response::into_body)
3034        }
3035
3036        /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
3037        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3038            self.0.request.name = v.into();
3039            self
3040        }
3041    }
3042
3043    #[doc(hidden)]
3044    impl crate::RequestBuilder for DeleteOperation {
3045        fn request_options(&mut self) -> &mut crate::RequestOptions {
3046            &mut self.0.options
3047        }
3048    }
3049
3050    /// The request builder for [CrossNetworkAutomationService::cancel_operation][crate::client::CrossNetworkAutomationService::cancel_operation] calls.
3051    ///
3052    /// # Example
3053    /// ```
3054    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::CancelOperation;
3055    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
3056    ///
3057    /// let builder = prepare_request_builder();
3058    /// let response = builder.send().await?;
3059    /// # Ok(()) }
3060    ///
3061    /// fn prepare_request_builder() -> CancelOperation {
3062    ///   # panic!();
3063    ///   // ... details omitted ...
3064    /// }
3065    /// ```
3066    #[derive(Clone, Debug)]
3067    pub struct CancelOperation(
3068        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
3069    );
3070
3071    impl CancelOperation {
3072        pub(crate) fn new(
3073            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
3074        ) -> Self {
3075            Self(RequestBuilder::new(stub))
3076        }
3077
3078        /// Sets the full request, replacing any prior values.
3079        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
3080            mut self,
3081            v: V,
3082        ) -> Self {
3083            self.0.request = v.into();
3084            self
3085        }
3086
3087        /// Sets all the options, replacing any prior values.
3088        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3089            self.0.options = v.into();
3090            self
3091        }
3092
3093        /// Sends the request.
3094        pub async fn send(self) -> Result<()> {
3095            (*self.0.stub)
3096                .cancel_operation(self.0.request, self.0.options)
3097                .await
3098                .map(crate::Response::into_body)
3099        }
3100
3101        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
3102        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3103            self.0.request.name = v.into();
3104            self
3105        }
3106    }
3107
3108    #[doc(hidden)]
3109    impl crate::RequestBuilder for CancelOperation {
3110        fn request_options(&mut self) -> &mut crate::RequestOptions {
3111            &mut self.0.options
3112        }
3113    }
3114}
3115
3116/// Request and client builders for [DataTransferService][crate::client::DataTransferService].
3117pub mod data_transfer_service {
3118    use crate::Result;
3119
3120    /// A builder for [DataTransferService][crate::client::DataTransferService].
3121    ///
3122    /// ```
3123    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
3124    /// # use google_cloud_networkconnectivity_v1::*;
3125    /// # use builder::data_transfer_service::ClientBuilder;
3126    /// # use client::DataTransferService;
3127    /// let builder : ClientBuilder = DataTransferService::builder();
3128    /// let client = builder
3129    ///     .with_endpoint("https://networkconnectivity.googleapis.com")
3130    ///     .build().await?;
3131    /// # Ok(()) }
3132    /// ```
3133    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
3134
3135    pub(crate) mod client {
3136        use super::super::super::client::DataTransferService;
3137        pub struct Factory;
3138        impl crate::ClientFactory for Factory {
3139            type Client = DataTransferService;
3140            type Credentials = gaxi::options::Credentials;
3141            async fn build(
3142                self,
3143                config: gaxi::options::ClientConfig,
3144            ) -> crate::ClientBuilderResult<Self::Client> {
3145                Self::Client::new(config).await
3146            }
3147        }
3148    }
3149
3150    /// Common implementation for [crate::client::DataTransferService] request builders.
3151    #[derive(Clone, Debug)]
3152    pub(crate) struct RequestBuilder<R: std::default::Default> {
3153        stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3154        request: R,
3155        options: crate::RequestOptions,
3156    }
3157
3158    impl<R> RequestBuilder<R>
3159    where
3160        R: std::default::Default,
3161    {
3162        pub(crate) fn new(
3163            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3164        ) -> Self {
3165            Self {
3166                stub,
3167                request: R::default(),
3168                options: crate::RequestOptions::default(),
3169            }
3170        }
3171    }
3172
3173    /// The request builder for [DataTransferService::list_multicloud_data_transfer_configs][crate::client::DataTransferService::list_multicloud_data_transfer_configs] calls.
3174    ///
3175    /// # Example
3176    /// ```
3177    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::ListMulticloudDataTransferConfigs;
3178    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
3179    /// use google_cloud_gax::paginator::ItemPaginator;
3180    ///
3181    /// let builder = prepare_request_builder();
3182    /// let mut items = builder.by_item();
3183    /// while let Some(result) = items.next().await {
3184    ///   let item = result?;
3185    /// }
3186    /// # Ok(()) }
3187    ///
3188    /// fn prepare_request_builder() -> ListMulticloudDataTransferConfigs {
3189    ///   # panic!();
3190    ///   // ... details omitted ...
3191    /// }
3192    /// ```
3193    #[derive(Clone, Debug)]
3194    pub struct ListMulticloudDataTransferConfigs(
3195        RequestBuilder<crate::model::ListMulticloudDataTransferConfigsRequest>,
3196    );
3197
3198    impl ListMulticloudDataTransferConfigs {
3199        pub(crate) fn new(
3200            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3201        ) -> Self {
3202            Self(RequestBuilder::new(stub))
3203        }
3204
3205        /// Sets the full request, replacing any prior values.
3206        pub fn with_request<V: Into<crate::model::ListMulticloudDataTransferConfigsRequest>>(
3207            mut self,
3208            v: V,
3209        ) -> Self {
3210            self.0.request = v.into();
3211            self
3212        }
3213
3214        /// Sets all the options, replacing any prior values.
3215        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3216            self.0.options = v.into();
3217            self
3218        }
3219
3220        /// Sends the request.
3221        pub async fn send(self) -> Result<crate::model::ListMulticloudDataTransferConfigsResponse> {
3222            (*self.0.stub)
3223                .list_multicloud_data_transfer_configs(self.0.request, self.0.options)
3224                .await
3225                .map(crate::Response::into_body)
3226        }
3227
3228        /// Streams each page in the collection.
3229        pub fn by_page(
3230            self,
3231        ) -> impl google_cloud_gax::paginator::Paginator<
3232            crate::model::ListMulticloudDataTransferConfigsResponse,
3233            crate::Error,
3234        > {
3235            use std::clone::Clone;
3236            let token = self.0.request.page_token.clone();
3237            let execute = move |token: String| {
3238                let mut builder = self.clone();
3239                builder.0.request = builder.0.request.set_page_token(token);
3240                builder.send()
3241            };
3242            google_cloud_gax::paginator::internal::new_paginator(token, execute)
3243        }
3244
3245        /// Streams each item in the collection.
3246        pub fn by_item(
3247            self,
3248        ) -> impl google_cloud_gax::paginator::ItemPaginator<
3249            crate::model::ListMulticloudDataTransferConfigsResponse,
3250            crate::Error,
3251        > {
3252            use google_cloud_gax::paginator::Paginator;
3253            self.by_page().items()
3254        }
3255
3256        /// Sets the value of [parent][crate::model::ListMulticloudDataTransferConfigsRequest::parent].
3257        ///
3258        /// This is a **required** field for requests.
3259        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3260            self.0.request.parent = v.into();
3261            self
3262        }
3263
3264        /// Sets the value of [page_size][crate::model::ListMulticloudDataTransferConfigsRequest::page_size].
3265        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3266            self.0.request.page_size = v.into();
3267            self
3268        }
3269
3270        /// Sets the value of [page_token][crate::model::ListMulticloudDataTransferConfigsRequest::page_token].
3271        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3272            self.0.request.page_token = v.into();
3273            self
3274        }
3275
3276        /// Sets the value of [filter][crate::model::ListMulticloudDataTransferConfigsRequest::filter].
3277        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3278            self.0.request.filter = v.into();
3279            self
3280        }
3281
3282        /// Sets the value of [order_by][crate::model::ListMulticloudDataTransferConfigsRequest::order_by].
3283        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3284            self.0.request.order_by = v.into();
3285            self
3286        }
3287
3288        /// Sets the value of [return_partial_success][crate::model::ListMulticloudDataTransferConfigsRequest::return_partial_success].
3289        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
3290            self.0.request.return_partial_success = v.into();
3291            self
3292        }
3293    }
3294
3295    #[doc(hidden)]
3296    impl crate::RequestBuilder for ListMulticloudDataTransferConfigs {
3297        fn request_options(&mut self) -> &mut crate::RequestOptions {
3298            &mut self.0.options
3299        }
3300    }
3301
3302    /// The request builder for [DataTransferService::get_multicloud_data_transfer_config][crate::client::DataTransferService::get_multicloud_data_transfer_config] calls.
3303    ///
3304    /// # Example
3305    /// ```
3306    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::GetMulticloudDataTransferConfig;
3307    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
3308    ///
3309    /// let builder = prepare_request_builder();
3310    /// let response = builder.send().await?;
3311    /// # Ok(()) }
3312    ///
3313    /// fn prepare_request_builder() -> GetMulticloudDataTransferConfig {
3314    ///   # panic!();
3315    ///   // ... details omitted ...
3316    /// }
3317    /// ```
3318    #[derive(Clone, Debug)]
3319    pub struct GetMulticloudDataTransferConfig(
3320        RequestBuilder<crate::model::GetMulticloudDataTransferConfigRequest>,
3321    );
3322
3323    impl GetMulticloudDataTransferConfig {
3324        pub(crate) fn new(
3325            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3326        ) -> Self {
3327            Self(RequestBuilder::new(stub))
3328        }
3329
3330        /// Sets the full request, replacing any prior values.
3331        pub fn with_request<V: Into<crate::model::GetMulticloudDataTransferConfigRequest>>(
3332            mut self,
3333            v: V,
3334        ) -> Self {
3335            self.0.request = v.into();
3336            self
3337        }
3338
3339        /// Sets all the options, replacing any prior values.
3340        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3341            self.0.options = v.into();
3342            self
3343        }
3344
3345        /// Sends the request.
3346        pub async fn send(self) -> Result<crate::model::MulticloudDataTransferConfig> {
3347            (*self.0.stub)
3348                .get_multicloud_data_transfer_config(self.0.request, self.0.options)
3349                .await
3350                .map(crate::Response::into_body)
3351        }
3352
3353        /// Sets the value of [name][crate::model::GetMulticloudDataTransferConfigRequest::name].
3354        ///
3355        /// This is a **required** field for requests.
3356        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3357            self.0.request.name = v.into();
3358            self
3359        }
3360    }
3361
3362    #[doc(hidden)]
3363    impl crate::RequestBuilder for GetMulticloudDataTransferConfig {
3364        fn request_options(&mut self) -> &mut crate::RequestOptions {
3365            &mut self.0.options
3366        }
3367    }
3368
3369    /// The request builder for [DataTransferService::create_multicloud_data_transfer_config][crate::client::DataTransferService::create_multicloud_data_transfer_config] calls.
3370    ///
3371    /// # Example
3372    /// ```
3373    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::CreateMulticloudDataTransferConfig;
3374    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
3375    /// use google_cloud_lro::Poller;
3376    ///
3377    /// let builder = prepare_request_builder();
3378    /// let response = builder.poller().until_done().await?;
3379    /// # Ok(()) }
3380    ///
3381    /// fn prepare_request_builder() -> CreateMulticloudDataTransferConfig {
3382    ///   # panic!();
3383    ///   // ... details omitted ...
3384    /// }
3385    /// ```
3386    #[derive(Clone, Debug)]
3387    pub struct CreateMulticloudDataTransferConfig(
3388        RequestBuilder<crate::model::CreateMulticloudDataTransferConfigRequest>,
3389    );
3390
3391    impl CreateMulticloudDataTransferConfig {
3392        pub(crate) fn new(
3393            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3394        ) -> Self {
3395            Self(RequestBuilder::new(stub))
3396        }
3397
3398        /// Sets the full request, replacing any prior values.
3399        pub fn with_request<V: Into<crate::model::CreateMulticloudDataTransferConfigRequest>>(
3400            mut self,
3401            v: V,
3402        ) -> Self {
3403            self.0.request = v.into();
3404            self
3405        }
3406
3407        /// Sets all the options, replacing any prior values.
3408        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3409            self.0.options = v.into();
3410            self
3411        }
3412
3413        /// Sends the request.
3414        ///
3415        /// # Long running operations
3416        ///
3417        /// This starts, but does not poll, a longrunning operation. More information
3418        /// on [create_multicloud_data_transfer_config][crate::client::DataTransferService::create_multicloud_data_transfer_config].
3419        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3420            (*self.0.stub)
3421                .create_multicloud_data_transfer_config(self.0.request, self.0.options)
3422                .await
3423                .map(crate::Response::into_body)
3424        }
3425
3426        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_multicloud_data_transfer_config`.
3427        pub fn poller(
3428            self,
3429        ) -> impl google_cloud_lro::Poller<
3430            crate::model::MulticloudDataTransferConfig,
3431            crate::model::OperationMetadata,
3432        > {
3433            type Operation = google_cloud_lro::internal::Operation<
3434                crate::model::MulticloudDataTransferConfig,
3435                crate::model::OperationMetadata,
3436            >;
3437            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3438            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3439            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
3440            if let Some(ref mut details) = poller_options.tracing {
3441                details.method_name = "google_cloud_networkconnectivity_v1::client::DataTransferService::create_multicloud_data_transfer_config::until_done";
3442            }
3443
3444            let stub = self.0.stub.clone();
3445            let mut options = self.0.options.clone();
3446            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3447            let query = move |name| {
3448                let stub = stub.clone();
3449                let options = options.clone();
3450                async {
3451                    let op = GetOperation::new(stub)
3452                        .set_name(name)
3453                        .with_options(options)
3454                        .send()
3455                        .await?;
3456                    Ok(Operation::new(op))
3457                }
3458            };
3459
3460            let start = move || async {
3461                let op = self.send().await?;
3462                Ok(Operation::new(op))
3463            };
3464
3465            use google_cloud_lro::internal::PollerExt;
3466            {
3467                google_cloud_lro::internal::new_poller(
3468                    polling_error_policy,
3469                    polling_backoff_policy,
3470                    start,
3471                    query,
3472                )
3473            }
3474            .with_options(poller_options)
3475        }
3476
3477        /// Sets the value of [parent][crate::model::CreateMulticloudDataTransferConfigRequest::parent].
3478        ///
3479        /// This is a **required** field for requests.
3480        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3481            self.0.request.parent = v.into();
3482            self
3483        }
3484
3485        /// Sets the value of [multicloud_data_transfer_config_id][crate::model::CreateMulticloudDataTransferConfigRequest::multicloud_data_transfer_config_id].
3486        ///
3487        /// This is a **required** field for requests.
3488        pub fn set_multicloud_data_transfer_config_id<T: Into<std::string::String>>(
3489            mut self,
3490            v: T,
3491        ) -> Self {
3492            self.0.request.multicloud_data_transfer_config_id = v.into();
3493            self
3494        }
3495
3496        /// Sets the value of [multicloud_data_transfer_config][crate::model::CreateMulticloudDataTransferConfigRequest::multicloud_data_transfer_config].
3497        ///
3498        /// This is a **required** field for requests.
3499        pub fn set_multicloud_data_transfer_config<T>(mut self, v: T) -> Self
3500        where
3501            T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
3502        {
3503            self.0.request.multicloud_data_transfer_config = std::option::Option::Some(v.into());
3504            self
3505        }
3506
3507        /// Sets or clears the value of [multicloud_data_transfer_config][crate::model::CreateMulticloudDataTransferConfigRequest::multicloud_data_transfer_config].
3508        ///
3509        /// This is a **required** field for requests.
3510        pub fn set_or_clear_multicloud_data_transfer_config<T>(
3511            mut self,
3512            v: std::option::Option<T>,
3513        ) -> Self
3514        where
3515            T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
3516        {
3517            self.0.request.multicloud_data_transfer_config = v.map(|x| x.into());
3518            self
3519        }
3520
3521        /// Sets the value of [request_id][crate::model::CreateMulticloudDataTransferConfigRequest::request_id].
3522        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3523            self.0.request.request_id = v.into();
3524            self
3525        }
3526    }
3527
3528    #[doc(hidden)]
3529    impl crate::RequestBuilder for CreateMulticloudDataTransferConfig {
3530        fn request_options(&mut self) -> &mut crate::RequestOptions {
3531            &mut self.0.options
3532        }
3533    }
3534
3535    /// The request builder for [DataTransferService::update_multicloud_data_transfer_config][crate::client::DataTransferService::update_multicloud_data_transfer_config] calls.
3536    ///
3537    /// # Example
3538    /// ```
3539    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::UpdateMulticloudDataTransferConfig;
3540    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
3541    /// use google_cloud_lro::Poller;
3542    ///
3543    /// let builder = prepare_request_builder();
3544    /// let response = builder.poller().until_done().await?;
3545    /// # Ok(()) }
3546    ///
3547    /// fn prepare_request_builder() -> UpdateMulticloudDataTransferConfig {
3548    ///   # panic!();
3549    ///   // ... details omitted ...
3550    /// }
3551    /// ```
3552    #[derive(Clone, Debug)]
3553    pub struct UpdateMulticloudDataTransferConfig(
3554        RequestBuilder<crate::model::UpdateMulticloudDataTransferConfigRequest>,
3555    );
3556
3557    impl UpdateMulticloudDataTransferConfig {
3558        pub(crate) fn new(
3559            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3560        ) -> Self {
3561            Self(RequestBuilder::new(stub))
3562        }
3563
3564        /// Sets the full request, replacing any prior values.
3565        pub fn with_request<V: Into<crate::model::UpdateMulticloudDataTransferConfigRequest>>(
3566            mut self,
3567            v: V,
3568        ) -> Self {
3569            self.0.request = v.into();
3570            self
3571        }
3572
3573        /// Sets all the options, replacing any prior values.
3574        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3575            self.0.options = v.into();
3576            self
3577        }
3578
3579        /// Sends the request.
3580        ///
3581        /// # Long running operations
3582        ///
3583        /// This starts, but does not poll, a longrunning operation. More information
3584        /// on [update_multicloud_data_transfer_config][crate::client::DataTransferService::update_multicloud_data_transfer_config].
3585        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3586            (*self.0.stub)
3587                .update_multicloud_data_transfer_config(self.0.request, self.0.options)
3588                .await
3589                .map(crate::Response::into_body)
3590        }
3591
3592        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_multicloud_data_transfer_config`.
3593        pub fn poller(
3594            self,
3595        ) -> impl google_cloud_lro::Poller<
3596            crate::model::MulticloudDataTransferConfig,
3597            crate::model::OperationMetadata,
3598        > {
3599            type Operation = google_cloud_lro::internal::Operation<
3600                crate::model::MulticloudDataTransferConfig,
3601                crate::model::OperationMetadata,
3602            >;
3603            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3604            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3605            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
3606            if let Some(ref mut details) = poller_options.tracing {
3607                details.method_name = "google_cloud_networkconnectivity_v1::client::DataTransferService::update_multicloud_data_transfer_config::until_done";
3608            }
3609
3610            let stub = self.0.stub.clone();
3611            let mut options = self.0.options.clone();
3612            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3613            let query = move |name| {
3614                let stub = stub.clone();
3615                let options = options.clone();
3616                async {
3617                    let op = GetOperation::new(stub)
3618                        .set_name(name)
3619                        .with_options(options)
3620                        .send()
3621                        .await?;
3622                    Ok(Operation::new(op))
3623                }
3624            };
3625
3626            let start = move || async {
3627                let op = self.send().await?;
3628                Ok(Operation::new(op))
3629            };
3630
3631            use google_cloud_lro::internal::PollerExt;
3632            {
3633                google_cloud_lro::internal::new_poller(
3634                    polling_error_policy,
3635                    polling_backoff_policy,
3636                    start,
3637                    query,
3638                )
3639            }
3640            .with_options(poller_options)
3641        }
3642
3643        /// Sets the value of [update_mask][crate::model::UpdateMulticloudDataTransferConfigRequest::update_mask].
3644        pub fn set_update_mask<T>(mut self, v: T) -> Self
3645        where
3646            T: std::convert::Into<wkt::FieldMask>,
3647        {
3648            self.0.request.update_mask = std::option::Option::Some(v.into());
3649            self
3650        }
3651
3652        /// Sets or clears the value of [update_mask][crate::model::UpdateMulticloudDataTransferConfigRequest::update_mask].
3653        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3654        where
3655            T: std::convert::Into<wkt::FieldMask>,
3656        {
3657            self.0.request.update_mask = v.map(|x| x.into());
3658            self
3659        }
3660
3661        /// Sets the value of [multicloud_data_transfer_config][crate::model::UpdateMulticloudDataTransferConfigRequest::multicloud_data_transfer_config].
3662        ///
3663        /// This is a **required** field for requests.
3664        pub fn set_multicloud_data_transfer_config<T>(mut self, v: T) -> Self
3665        where
3666            T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
3667        {
3668            self.0.request.multicloud_data_transfer_config = std::option::Option::Some(v.into());
3669            self
3670        }
3671
3672        /// Sets or clears the value of [multicloud_data_transfer_config][crate::model::UpdateMulticloudDataTransferConfigRequest::multicloud_data_transfer_config].
3673        ///
3674        /// This is a **required** field for requests.
3675        pub fn set_or_clear_multicloud_data_transfer_config<T>(
3676            mut self,
3677            v: std::option::Option<T>,
3678        ) -> Self
3679        where
3680            T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
3681        {
3682            self.0.request.multicloud_data_transfer_config = v.map(|x| x.into());
3683            self
3684        }
3685
3686        /// Sets the value of [request_id][crate::model::UpdateMulticloudDataTransferConfigRequest::request_id].
3687        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3688            self.0.request.request_id = v.into();
3689            self
3690        }
3691    }
3692
3693    #[doc(hidden)]
3694    impl crate::RequestBuilder for UpdateMulticloudDataTransferConfig {
3695        fn request_options(&mut self) -> &mut crate::RequestOptions {
3696            &mut self.0.options
3697        }
3698    }
3699
3700    /// The request builder for [DataTransferService::delete_multicloud_data_transfer_config][crate::client::DataTransferService::delete_multicloud_data_transfer_config] calls.
3701    ///
3702    /// # Example
3703    /// ```
3704    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::DeleteMulticloudDataTransferConfig;
3705    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
3706    /// use google_cloud_lro::Poller;
3707    ///
3708    /// let builder = prepare_request_builder();
3709    /// let response = builder.poller().until_done().await?;
3710    /// # Ok(()) }
3711    ///
3712    /// fn prepare_request_builder() -> DeleteMulticloudDataTransferConfig {
3713    ///   # panic!();
3714    ///   // ... details omitted ...
3715    /// }
3716    /// ```
3717    #[derive(Clone, Debug)]
3718    pub struct DeleteMulticloudDataTransferConfig(
3719        RequestBuilder<crate::model::DeleteMulticloudDataTransferConfigRequest>,
3720    );
3721
3722    impl DeleteMulticloudDataTransferConfig {
3723        pub(crate) fn new(
3724            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3725        ) -> Self {
3726            Self(RequestBuilder::new(stub))
3727        }
3728
3729        /// Sets the full request, replacing any prior values.
3730        pub fn with_request<V: Into<crate::model::DeleteMulticloudDataTransferConfigRequest>>(
3731            mut self,
3732            v: V,
3733        ) -> Self {
3734            self.0.request = v.into();
3735            self
3736        }
3737
3738        /// Sets all the options, replacing any prior values.
3739        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3740            self.0.options = v.into();
3741            self
3742        }
3743
3744        /// Sends the request.
3745        ///
3746        /// # Long running operations
3747        ///
3748        /// This starts, but does not poll, a longrunning operation. More information
3749        /// on [delete_multicloud_data_transfer_config][crate::client::DataTransferService::delete_multicloud_data_transfer_config].
3750        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3751            (*self.0.stub)
3752                .delete_multicloud_data_transfer_config(self.0.request, self.0.options)
3753                .await
3754                .map(crate::Response::into_body)
3755        }
3756
3757        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_multicloud_data_transfer_config`.
3758        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
3759            type Operation =
3760                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
3761            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3762            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3763            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
3764            if let Some(ref mut details) = poller_options.tracing {
3765                details.method_name = "google_cloud_networkconnectivity_v1::client::DataTransferService::delete_multicloud_data_transfer_config::until_done";
3766            }
3767
3768            let stub = self.0.stub.clone();
3769            let mut options = self.0.options.clone();
3770            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3771            let query = move |name| {
3772                let stub = stub.clone();
3773                let options = options.clone();
3774                async {
3775                    let op = GetOperation::new(stub)
3776                        .set_name(name)
3777                        .with_options(options)
3778                        .send()
3779                        .await?;
3780                    Ok(Operation::new(op))
3781                }
3782            };
3783
3784            let start = move || async {
3785                let op = self.send().await?;
3786                Ok(Operation::new(op))
3787            };
3788
3789            use google_cloud_lro::internal::PollerExt;
3790            {
3791                google_cloud_lro::internal::new_unit_response_poller(
3792                    polling_error_policy,
3793                    polling_backoff_policy,
3794                    start,
3795                    query,
3796                )
3797            }
3798            .with_options(poller_options)
3799        }
3800
3801        /// Sets the value of [name][crate::model::DeleteMulticloudDataTransferConfigRequest::name].
3802        ///
3803        /// This is a **required** field for requests.
3804        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3805            self.0.request.name = v.into();
3806            self
3807        }
3808
3809        /// Sets the value of [request_id][crate::model::DeleteMulticloudDataTransferConfigRequest::request_id].
3810        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3811            self.0.request.request_id = v.into();
3812            self
3813        }
3814
3815        /// Sets the value of [etag][crate::model::DeleteMulticloudDataTransferConfigRequest::etag].
3816        pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
3817            self.0.request.etag = v.into();
3818            self
3819        }
3820    }
3821
3822    #[doc(hidden)]
3823    impl crate::RequestBuilder for DeleteMulticloudDataTransferConfig {
3824        fn request_options(&mut self) -> &mut crate::RequestOptions {
3825            &mut self.0.options
3826        }
3827    }
3828
3829    /// The request builder for [DataTransferService::list_destinations][crate::client::DataTransferService::list_destinations] calls.
3830    ///
3831    /// # Example
3832    /// ```
3833    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::ListDestinations;
3834    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
3835    /// use google_cloud_gax::paginator::ItemPaginator;
3836    ///
3837    /// let builder = prepare_request_builder();
3838    /// let mut items = builder.by_item();
3839    /// while let Some(result) = items.next().await {
3840    ///   let item = result?;
3841    /// }
3842    /// # Ok(()) }
3843    ///
3844    /// fn prepare_request_builder() -> ListDestinations {
3845    ///   # panic!();
3846    ///   // ... details omitted ...
3847    /// }
3848    /// ```
3849    #[derive(Clone, Debug)]
3850    pub struct ListDestinations(RequestBuilder<crate::model::ListDestinationsRequest>);
3851
3852    impl ListDestinations {
3853        pub(crate) fn new(
3854            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3855        ) -> Self {
3856            Self(RequestBuilder::new(stub))
3857        }
3858
3859        /// Sets the full request, replacing any prior values.
3860        pub fn with_request<V: Into<crate::model::ListDestinationsRequest>>(
3861            mut self,
3862            v: V,
3863        ) -> Self {
3864            self.0.request = v.into();
3865            self
3866        }
3867
3868        /// Sets all the options, replacing any prior values.
3869        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3870            self.0.options = v.into();
3871            self
3872        }
3873
3874        /// Sends the request.
3875        pub async fn send(self) -> Result<crate::model::ListDestinationsResponse> {
3876            (*self.0.stub)
3877                .list_destinations(self.0.request, self.0.options)
3878                .await
3879                .map(crate::Response::into_body)
3880        }
3881
3882        /// Streams each page in the collection.
3883        pub fn by_page(
3884            self,
3885        ) -> impl google_cloud_gax::paginator::Paginator<
3886            crate::model::ListDestinationsResponse,
3887            crate::Error,
3888        > {
3889            use std::clone::Clone;
3890            let token = self.0.request.page_token.clone();
3891            let execute = move |token: String| {
3892                let mut builder = self.clone();
3893                builder.0.request = builder.0.request.set_page_token(token);
3894                builder.send()
3895            };
3896            google_cloud_gax::paginator::internal::new_paginator(token, execute)
3897        }
3898
3899        /// Streams each item in the collection.
3900        pub fn by_item(
3901            self,
3902        ) -> impl google_cloud_gax::paginator::ItemPaginator<
3903            crate::model::ListDestinationsResponse,
3904            crate::Error,
3905        > {
3906            use google_cloud_gax::paginator::Paginator;
3907            self.by_page().items()
3908        }
3909
3910        /// Sets the value of [parent][crate::model::ListDestinationsRequest::parent].
3911        ///
3912        /// This is a **required** field for requests.
3913        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3914            self.0.request.parent = v.into();
3915            self
3916        }
3917
3918        /// Sets the value of [page_size][crate::model::ListDestinationsRequest::page_size].
3919        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3920            self.0.request.page_size = v.into();
3921            self
3922        }
3923
3924        /// Sets the value of [page_token][crate::model::ListDestinationsRequest::page_token].
3925        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3926            self.0.request.page_token = v.into();
3927            self
3928        }
3929
3930        /// Sets the value of [filter][crate::model::ListDestinationsRequest::filter].
3931        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3932            self.0.request.filter = v.into();
3933            self
3934        }
3935
3936        /// Sets the value of [order_by][crate::model::ListDestinationsRequest::order_by].
3937        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3938            self.0.request.order_by = v.into();
3939            self
3940        }
3941
3942        /// Sets the value of [return_partial_success][crate::model::ListDestinationsRequest::return_partial_success].
3943        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
3944            self.0.request.return_partial_success = v.into();
3945            self
3946        }
3947    }
3948
3949    #[doc(hidden)]
3950    impl crate::RequestBuilder for ListDestinations {
3951        fn request_options(&mut self) -> &mut crate::RequestOptions {
3952            &mut self.0.options
3953        }
3954    }
3955
3956    /// The request builder for [DataTransferService::get_destination][crate::client::DataTransferService::get_destination] calls.
3957    ///
3958    /// # Example
3959    /// ```
3960    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::GetDestination;
3961    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
3962    ///
3963    /// let builder = prepare_request_builder();
3964    /// let response = builder.send().await?;
3965    /// # Ok(()) }
3966    ///
3967    /// fn prepare_request_builder() -> GetDestination {
3968    ///   # panic!();
3969    ///   // ... details omitted ...
3970    /// }
3971    /// ```
3972    #[derive(Clone, Debug)]
3973    pub struct GetDestination(RequestBuilder<crate::model::GetDestinationRequest>);
3974
3975    impl GetDestination {
3976        pub(crate) fn new(
3977            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3978        ) -> Self {
3979            Self(RequestBuilder::new(stub))
3980        }
3981
3982        /// Sets the full request, replacing any prior values.
3983        pub fn with_request<V: Into<crate::model::GetDestinationRequest>>(mut self, v: V) -> Self {
3984            self.0.request = v.into();
3985            self
3986        }
3987
3988        /// Sets all the options, replacing any prior values.
3989        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3990            self.0.options = v.into();
3991            self
3992        }
3993
3994        /// Sends the request.
3995        pub async fn send(self) -> Result<crate::model::Destination> {
3996            (*self.0.stub)
3997                .get_destination(self.0.request, self.0.options)
3998                .await
3999                .map(crate::Response::into_body)
4000        }
4001
4002        /// Sets the value of [name][crate::model::GetDestinationRequest::name].
4003        ///
4004        /// This is a **required** field for requests.
4005        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4006            self.0.request.name = v.into();
4007            self
4008        }
4009    }
4010
4011    #[doc(hidden)]
4012    impl crate::RequestBuilder for GetDestination {
4013        fn request_options(&mut self) -> &mut crate::RequestOptions {
4014            &mut self.0.options
4015        }
4016    }
4017
4018    /// The request builder for [DataTransferService::create_destination][crate::client::DataTransferService::create_destination] calls.
4019    ///
4020    /// # Example
4021    /// ```
4022    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::CreateDestination;
4023    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
4024    /// use google_cloud_lro::Poller;
4025    ///
4026    /// let builder = prepare_request_builder();
4027    /// let response = builder.poller().until_done().await?;
4028    /// # Ok(()) }
4029    ///
4030    /// fn prepare_request_builder() -> CreateDestination {
4031    ///   # panic!();
4032    ///   // ... details omitted ...
4033    /// }
4034    /// ```
4035    #[derive(Clone, Debug)]
4036    pub struct CreateDestination(RequestBuilder<crate::model::CreateDestinationRequest>);
4037
4038    impl CreateDestination {
4039        pub(crate) fn new(
4040            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4041        ) -> Self {
4042            Self(RequestBuilder::new(stub))
4043        }
4044
4045        /// Sets the full request, replacing any prior values.
4046        pub fn with_request<V: Into<crate::model::CreateDestinationRequest>>(
4047            mut self,
4048            v: V,
4049        ) -> Self {
4050            self.0.request = v.into();
4051            self
4052        }
4053
4054        /// Sets all the options, replacing any prior values.
4055        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4056            self.0.options = v.into();
4057            self
4058        }
4059
4060        /// Sends the request.
4061        ///
4062        /// # Long running operations
4063        ///
4064        /// This starts, but does not poll, a longrunning operation. More information
4065        /// on [create_destination][crate::client::DataTransferService::create_destination].
4066        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4067            (*self.0.stub)
4068                .create_destination(self.0.request, self.0.options)
4069                .await
4070                .map(crate::Response::into_body)
4071        }
4072
4073        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_destination`.
4074        pub fn poller(
4075            self,
4076        ) -> impl google_cloud_lro::Poller<crate::model::Destination, crate::model::OperationMetadata>
4077        {
4078            type Operation = google_cloud_lro::internal::Operation<
4079                crate::model::Destination,
4080                crate::model::OperationMetadata,
4081            >;
4082            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4083            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4084            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
4085            if let Some(ref mut details) = poller_options.tracing {
4086                details.method_name = "google_cloud_networkconnectivity_v1::client::DataTransferService::create_destination::until_done";
4087            }
4088
4089            let stub = self.0.stub.clone();
4090            let mut options = self.0.options.clone();
4091            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4092            let query = move |name| {
4093                let stub = stub.clone();
4094                let options = options.clone();
4095                async {
4096                    let op = GetOperation::new(stub)
4097                        .set_name(name)
4098                        .with_options(options)
4099                        .send()
4100                        .await?;
4101                    Ok(Operation::new(op))
4102                }
4103            };
4104
4105            let start = move || async {
4106                let op = self.send().await?;
4107                Ok(Operation::new(op))
4108            };
4109
4110            use google_cloud_lro::internal::PollerExt;
4111            {
4112                google_cloud_lro::internal::new_poller(
4113                    polling_error_policy,
4114                    polling_backoff_policy,
4115                    start,
4116                    query,
4117                )
4118            }
4119            .with_options(poller_options)
4120        }
4121
4122        /// Sets the value of [parent][crate::model::CreateDestinationRequest::parent].
4123        ///
4124        /// This is a **required** field for requests.
4125        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4126            self.0.request.parent = v.into();
4127            self
4128        }
4129
4130        /// Sets the value of [destination_id][crate::model::CreateDestinationRequest::destination_id].
4131        ///
4132        /// This is a **required** field for requests.
4133        pub fn set_destination_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4134            self.0.request.destination_id = v.into();
4135            self
4136        }
4137
4138        /// Sets the value of [destination][crate::model::CreateDestinationRequest::destination].
4139        ///
4140        /// This is a **required** field for requests.
4141        pub fn set_destination<T>(mut self, v: T) -> Self
4142        where
4143            T: std::convert::Into<crate::model::Destination>,
4144        {
4145            self.0.request.destination = std::option::Option::Some(v.into());
4146            self
4147        }
4148
4149        /// Sets or clears the value of [destination][crate::model::CreateDestinationRequest::destination].
4150        ///
4151        /// This is a **required** field for requests.
4152        pub fn set_or_clear_destination<T>(mut self, v: std::option::Option<T>) -> Self
4153        where
4154            T: std::convert::Into<crate::model::Destination>,
4155        {
4156            self.0.request.destination = v.map(|x| x.into());
4157            self
4158        }
4159
4160        /// Sets the value of [request_id][crate::model::CreateDestinationRequest::request_id].
4161        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4162            self.0.request.request_id = v.into();
4163            self
4164        }
4165    }
4166
4167    #[doc(hidden)]
4168    impl crate::RequestBuilder for CreateDestination {
4169        fn request_options(&mut self) -> &mut crate::RequestOptions {
4170            &mut self.0.options
4171        }
4172    }
4173
4174    /// The request builder for [DataTransferService::update_destination][crate::client::DataTransferService::update_destination] calls.
4175    ///
4176    /// # Example
4177    /// ```
4178    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::UpdateDestination;
4179    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
4180    /// use google_cloud_lro::Poller;
4181    ///
4182    /// let builder = prepare_request_builder();
4183    /// let response = builder.poller().until_done().await?;
4184    /// # Ok(()) }
4185    ///
4186    /// fn prepare_request_builder() -> UpdateDestination {
4187    ///   # panic!();
4188    ///   // ... details omitted ...
4189    /// }
4190    /// ```
4191    #[derive(Clone, Debug)]
4192    pub struct UpdateDestination(RequestBuilder<crate::model::UpdateDestinationRequest>);
4193
4194    impl UpdateDestination {
4195        pub(crate) fn new(
4196            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4197        ) -> Self {
4198            Self(RequestBuilder::new(stub))
4199        }
4200
4201        /// Sets the full request, replacing any prior values.
4202        pub fn with_request<V: Into<crate::model::UpdateDestinationRequest>>(
4203            mut self,
4204            v: V,
4205        ) -> Self {
4206            self.0.request = v.into();
4207            self
4208        }
4209
4210        /// Sets all the options, replacing any prior values.
4211        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4212            self.0.options = v.into();
4213            self
4214        }
4215
4216        /// Sends the request.
4217        ///
4218        /// # Long running operations
4219        ///
4220        /// This starts, but does not poll, a longrunning operation. More information
4221        /// on [update_destination][crate::client::DataTransferService::update_destination].
4222        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4223            (*self.0.stub)
4224                .update_destination(self.0.request, self.0.options)
4225                .await
4226                .map(crate::Response::into_body)
4227        }
4228
4229        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_destination`.
4230        pub fn poller(
4231            self,
4232        ) -> impl google_cloud_lro::Poller<crate::model::Destination, crate::model::OperationMetadata>
4233        {
4234            type Operation = google_cloud_lro::internal::Operation<
4235                crate::model::Destination,
4236                crate::model::OperationMetadata,
4237            >;
4238            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4239            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4240            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
4241            if let Some(ref mut details) = poller_options.tracing {
4242                details.method_name = "google_cloud_networkconnectivity_v1::client::DataTransferService::update_destination::until_done";
4243            }
4244
4245            let stub = self.0.stub.clone();
4246            let mut options = self.0.options.clone();
4247            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4248            let query = move |name| {
4249                let stub = stub.clone();
4250                let options = options.clone();
4251                async {
4252                    let op = GetOperation::new(stub)
4253                        .set_name(name)
4254                        .with_options(options)
4255                        .send()
4256                        .await?;
4257                    Ok(Operation::new(op))
4258                }
4259            };
4260
4261            let start = move || async {
4262                let op = self.send().await?;
4263                Ok(Operation::new(op))
4264            };
4265
4266            use google_cloud_lro::internal::PollerExt;
4267            {
4268                google_cloud_lro::internal::new_poller(
4269                    polling_error_policy,
4270                    polling_backoff_policy,
4271                    start,
4272                    query,
4273                )
4274            }
4275            .with_options(poller_options)
4276        }
4277
4278        /// Sets the value of [update_mask][crate::model::UpdateDestinationRequest::update_mask].
4279        pub fn set_update_mask<T>(mut self, v: T) -> Self
4280        where
4281            T: std::convert::Into<wkt::FieldMask>,
4282        {
4283            self.0.request.update_mask = std::option::Option::Some(v.into());
4284            self
4285        }
4286
4287        /// Sets or clears the value of [update_mask][crate::model::UpdateDestinationRequest::update_mask].
4288        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4289        where
4290            T: std::convert::Into<wkt::FieldMask>,
4291        {
4292            self.0.request.update_mask = v.map(|x| x.into());
4293            self
4294        }
4295
4296        /// Sets the value of [destination][crate::model::UpdateDestinationRequest::destination].
4297        ///
4298        /// This is a **required** field for requests.
4299        pub fn set_destination<T>(mut self, v: T) -> Self
4300        where
4301            T: std::convert::Into<crate::model::Destination>,
4302        {
4303            self.0.request.destination = std::option::Option::Some(v.into());
4304            self
4305        }
4306
4307        /// Sets or clears the value of [destination][crate::model::UpdateDestinationRequest::destination].
4308        ///
4309        /// This is a **required** field for requests.
4310        pub fn set_or_clear_destination<T>(mut self, v: std::option::Option<T>) -> Self
4311        where
4312            T: std::convert::Into<crate::model::Destination>,
4313        {
4314            self.0.request.destination = v.map(|x| x.into());
4315            self
4316        }
4317
4318        /// Sets the value of [request_id][crate::model::UpdateDestinationRequest::request_id].
4319        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4320            self.0.request.request_id = v.into();
4321            self
4322        }
4323    }
4324
4325    #[doc(hidden)]
4326    impl crate::RequestBuilder for UpdateDestination {
4327        fn request_options(&mut self) -> &mut crate::RequestOptions {
4328            &mut self.0.options
4329        }
4330    }
4331
4332    /// The request builder for [DataTransferService::delete_destination][crate::client::DataTransferService::delete_destination] calls.
4333    ///
4334    /// # Example
4335    /// ```
4336    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::DeleteDestination;
4337    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
4338    /// use google_cloud_lro::Poller;
4339    ///
4340    /// let builder = prepare_request_builder();
4341    /// let response = builder.poller().until_done().await?;
4342    /// # Ok(()) }
4343    ///
4344    /// fn prepare_request_builder() -> DeleteDestination {
4345    ///   # panic!();
4346    ///   // ... details omitted ...
4347    /// }
4348    /// ```
4349    #[derive(Clone, Debug)]
4350    pub struct DeleteDestination(RequestBuilder<crate::model::DeleteDestinationRequest>);
4351
4352    impl DeleteDestination {
4353        pub(crate) fn new(
4354            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4355        ) -> Self {
4356            Self(RequestBuilder::new(stub))
4357        }
4358
4359        /// Sets the full request, replacing any prior values.
4360        pub fn with_request<V: Into<crate::model::DeleteDestinationRequest>>(
4361            mut self,
4362            v: V,
4363        ) -> Self {
4364            self.0.request = v.into();
4365            self
4366        }
4367
4368        /// Sets all the options, replacing any prior values.
4369        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4370            self.0.options = v.into();
4371            self
4372        }
4373
4374        /// Sends the request.
4375        ///
4376        /// # Long running operations
4377        ///
4378        /// This starts, but does not poll, a longrunning operation. More information
4379        /// on [delete_destination][crate::client::DataTransferService::delete_destination].
4380        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4381            (*self.0.stub)
4382                .delete_destination(self.0.request, self.0.options)
4383                .await
4384                .map(crate::Response::into_body)
4385        }
4386
4387        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_destination`.
4388        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
4389            type Operation =
4390                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
4391            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4392            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4393            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
4394            if let Some(ref mut details) = poller_options.tracing {
4395                details.method_name = "google_cloud_networkconnectivity_v1::client::DataTransferService::delete_destination::until_done";
4396            }
4397
4398            let stub = self.0.stub.clone();
4399            let mut options = self.0.options.clone();
4400            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4401            let query = move |name| {
4402                let stub = stub.clone();
4403                let options = options.clone();
4404                async {
4405                    let op = GetOperation::new(stub)
4406                        .set_name(name)
4407                        .with_options(options)
4408                        .send()
4409                        .await?;
4410                    Ok(Operation::new(op))
4411                }
4412            };
4413
4414            let start = move || async {
4415                let op = self.send().await?;
4416                Ok(Operation::new(op))
4417            };
4418
4419            use google_cloud_lro::internal::PollerExt;
4420            {
4421                google_cloud_lro::internal::new_unit_response_poller(
4422                    polling_error_policy,
4423                    polling_backoff_policy,
4424                    start,
4425                    query,
4426                )
4427            }
4428            .with_options(poller_options)
4429        }
4430
4431        /// Sets the value of [name][crate::model::DeleteDestinationRequest::name].
4432        ///
4433        /// This is a **required** field for requests.
4434        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4435            self.0.request.name = v.into();
4436            self
4437        }
4438
4439        /// Sets the value of [request_id][crate::model::DeleteDestinationRequest::request_id].
4440        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4441            self.0.request.request_id = v.into();
4442            self
4443        }
4444
4445        /// Sets the value of [etag][crate::model::DeleteDestinationRequest::etag].
4446        pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
4447            self.0.request.etag = v.into();
4448            self
4449        }
4450    }
4451
4452    #[doc(hidden)]
4453    impl crate::RequestBuilder for DeleteDestination {
4454        fn request_options(&mut self) -> &mut crate::RequestOptions {
4455            &mut self.0.options
4456        }
4457    }
4458
4459    /// The request builder for [DataTransferService::get_multicloud_data_transfer_supported_service][crate::client::DataTransferService::get_multicloud_data_transfer_supported_service] calls.
4460    ///
4461    /// # Example
4462    /// ```
4463    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::GetMulticloudDataTransferSupportedService;
4464    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
4465    ///
4466    /// let builder = prepare_request_builder();
4467    /// let response = builder.send().await?;
4468    /// # Ok(()) }
4469    ///
4470    /// fn prepare_request_builder() -> GetMulticloudDataTransferSupportedService {
4471    ///   # panic!();
4472    ///   // ... details omitted ...
4473    /// }
4474    /// ```
4475    #[derive(Clone, Debug)]
4476    pub struct GetMulticloudDataTransferSupportedService(
4477        RequestBuilder<crate::model::GetMulticloudDataTransferSupportedServiceRequest>,
4478    );
4479
4480    impl GetMulticloudDataTransferSupportedService {
4481        pub(crate) fn new(
4482            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4483        ) -> Self {
4484            Self(RequestBuilder::new(stub))
4485        }
4486
4487        /// Sets the full request, replacing any prior values.
4488        pub fn with_request<
4489            V: Into<crate::model::GetMulticloudDataTransferSupportedServiceRequest>,
4490        >(
4491            mut self,
4492            v: V,
4493        ) -> Self {
4494            self.0.request = v.into();
4495            self
4496        }
4497
4498        /// Sets all the options, replacing any prior values.
4499        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4500            self.0.options = v.into();
4501            self
4502        }
4503
4504        /// Sends the request.
4505        pub async fn send(self) -> Result<crate::model::MulticloudDataTransferSupportedService> {
4506            (*self.0.stub)
4507                .get_multicloud_data_transfer_supported_service(self.0.request, self.0.options)
4508                .await
4509                .map(crate::Response::into_body)
4510        }
4511
4512        /// Sets the value of [name][crate::model::GetMulticloudDataTransferSupportedServiceRequest::name].
4513        ///
4514        /// This is a **required** field for requests.
4515        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4516            self.0.request.name = v.into();
4517            self
4518        }
4519    }
4520
4521    #[doc(hidden)]
4522    impl crate::RequestBuilder for GetMulticloudDataTransferSupportedService {
4523        fn request_options(&mut self) -> &mut crate::RequestOptions {
4524            &mut self.0.options
4525        }
4526    }
4527
4528    /// The request builder for [DataTransferService::list_multicloud_data_transfer_supported_services][crate::client::DataTransferService::list_multicloud_data_transfer_supported_services] calls.
4529    ///
4530    /// # Example
4531    /// ```
4532    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::ListMulticloudDataTransferSupportedServices;
4533    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
4534    /// use google_cloud_gax::paginator::ItemPaginator;
4535    ///
4536    /// let builder = prepare_request_builder();
4537    /// let mut items = builder.by_item();
4538    /// while let Some(result) = items.next().await {
4539    ///   let item = result?;
4540    /// }
4541    /// # Ok(()) }
4542    ///
4543    /// fn prepare_request_builder() -> ListMulticloudDataTransferSupportedServices {
4544    ///   # panic!();
4545    ///   // ... details omitted ...
4546    /// }
4547    /// ```
4548    #[derive(Clone, Debug)]
4549    pub struct ListMulticloudDataTransferSupportedServices(
4550        RequestBuilder<crate::model::ListMulticloudDataTransferSupportedServicesRequest>,
4551    );
4552
4553    impl ListMulticloudDataTransferSupportedServices {
4554        pub(crate) fn new(
4555            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4556        ) -> Self {
4557            Self(RequestBuilder::new(stub))
4558        }
4559
4560        /// Sets the full request, replacing any prior values.
4561        pub fn with_request<
4562            V: Into<crate::model::ListMulticloudDataTransferSupportedServicesRequest>,
4563        >(
4564            mut self,
4565            v: V,
4566        ) -> Self {
4567            self.0.request = v.into();
4568            self
4569        }
4570
4571        /// Sets all the options, replacing any prior values.
4572        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4573            self.0.options = v.into();
4574            self
4575        }
4576
4577        /// Sends the request.
4578        pub async fn send(
4579            self,
4580        ) -> Result<crate::model::ListMulticloudDataTransferSupportedServicesResponse> {
4581            (*self.0.stub)
4582                .list_multicloud_data_transfer_supported_services(self.0.request, self.0.options)
4583                .await
4584                .map(crate::Response::into_body)
4585        }
4586
4587        /// Streams each page in the collection.
4588        pub fn by_page(
4589            self,
4590        ) -> impl google_cloud_gax::paginator::Paginator<
4591            crate::model::ListMulticloudDataTransferSupportedServicesResponse,
4592            crate::Error,
4593        > {
4594            use std::clone::Clone;
4595            let token = self.0.request.page_token.clone();
4596            let execute = move |token: String| {
4597                let mut builder = self.clone();
4598                builder.0.request = builder.0.request.set_page_token(token);
4599                builder.send()
4600            };
4601            google_cloud_gax::paginator::internal::new_paginator(token, execute)
4602        }
4603
4604        /// Streams each item in the collection.
4605        pub fn by_item(
4606            self,
4607        ) -> impl google_cloud_gax::paginator::ItemPaginator<
4608            crate::model::ListMulticloudDataTransferSupportedServicesResponse,
4609            crate::Error,
4610        > {
4611            use google_cloud_gax::paginator::Paginator;
4612            self.by_page().items()
4613        }
4614
4615        /// Sets the value of [parent][crate::model::ListMulticloudDataTransferSupportedServicesRequest::parent].
4616        ///
4617        /// This is a **required** field for requests.
4618        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4619            self.0.request.parent = v.into();
4620            self
4621        }
4622
4623        /// Sets the value of [page_size][crate::model::ListMulticloudDataTransferSupportedServicesRequest::page_size].
4624        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4625            self.0.request.page_size = v.into();
4626            self
4627        }
4628
4629        /// Sets the value of [page_token][crate::model::ListMulticloudDataTransferSupportedServicesRequest::page_token].
4630        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4631            self.0.request.page_token = v.into();
4632            self
4633        }
4634    }
4635
4636    #[doc(hidden)]
4637    impl crate::RequestBuilder for ListMulticloudDataTransferSupportedServices {
4638        fn request_options(&mut self) -> &mut crate::RequestOptions {
4639            &mut self.0.options
4640        }
4641    }
4642
4643    /// The request builder for [DataTransferService::list_locations][crate::client::DataTransferService::list_locations] calls.
4644    ///
4645    /// # Example
4646    /// ```
4647    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::ListLocations;
4648    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
4649    /// use google_cloud_gax::paginator::ItemPaginator;
4650    ///
4651    /// let builder = prepare_request_builder();
4652    /// let mut items = builder.by_item();
4653    /// while let Some(result) = items.next().await {
4654    ///   let item = result?;
4655    /// }
4656    /// # Ok(()) }
4657    ///
4658    /// fn prepare_request_builder() -> ListLocations {
4659    ///   # panic!();
4660    ///   // ... details omitted ...
4661    /// }
4662    /// ```
4663    #[derive(Clone, Debug)]
4664    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
4665
4666    impl ListLocations {
4667        pub(crate) fn new(
4668            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4669        ) -> Self {
4670            Self(RequestBuilder::new(stub))
4671        }
4672
4673        /// Sets the full request, replacing any prior values.
4674        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
4675            mut self,
4676            v: V,
4677        ) -> Self {
4678            self.0.request = v.into();
4679            self
4680        }
4681
4682        /// Sets all the options, replacing any prior values.
4683        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4684            self.0.options = v.into();
4685            self
4686        }
4687
4688        /// Sends the request.
4689        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
4690            (*self.0.stub)
4691                .list_locations(self.0.request, self.0.options)
4692                .await
4693                .map(crate::Response::into_body)
4694        }
4695
4696        /// Streams each page in the collection.
4697        pub fn by_page(
4698            self,
4699        ) -> impl google_cloud_gax::paginator::Paginator<
4700            google_cloud_location::model::ListLocationsResponse,
4701            crate::Error,
4702        > {
4703            use std::clone::Clone;
4704            let token = self.0.request.page_token.clone();
4705            let execute = move |token: String| {
4706                let mut builder = self.clone();
4707                builder.0.request = builder.0.request.set_page_token(token);
4708                builder.send()
4709            };
4710            google_cloud_gax::paginator::internal::new_paginator(token, execute)
4711        }
4712
4713        /// Streams each item in the collection.
4714        pub fn by_item(
4715            self,
4716        ) -> impl google_cloud_gax::paginator::ItemPaginator<
4717            google_cloud_location::model::ListLocationsResponse,
4718            crate::Error,
4719        > {
4720            use google_cloud_gax::paginator::Paginator;
4721            self.by_page().items()
4722        }
4723
4724        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
4725        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4726            self.0.request.name = v.into();
4727            self
4728        }
4729
4730        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
4731        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4732            self.0.request.filter = v.into();
4733            self
4734        }
4735
4736        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
4737        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4738            self.0.request.page_size = v.into();
4739            self
4740        }
4741
4742        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
4743        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4744            self.0.request.page_token = v.into();
4745            self
4746        }
4747    }
4748
4749    #[doc(hidden)]
4750    impl crate::RequestBuilder for ListLocations {
4751        fn request_options(&mut self) -> &mut crate::RequestOptions {
4752            &mut self.0.options
4753        }
4754    }
4755
4756    /// The request builder for [DataTransferService::get_location][crate::client::DataTransferService::get_location] calls.
4757    ///
4758    /// # Example
4759    /// ```
4760    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::GetLocation;
4761    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
4762    ///
4763    /// let builder = prepare_request_builder();
4764    /// let response = builder.send().await?;
4765    /// # Ok(()) }
4766    ///
4767    /// fn prepare_request_builder() -> GetLocation {
4768    ///   # panic!();
4769    ///   // ... details omitted ...
4770    /// }
4771    /// ```
4772    #[derive(Clone, Debug)]
4773    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
4774
4775    impl GetLocation {
4776        pub(crate) fn new(
4777            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4778        ) -> Self {
4779            Self(RequestBuilder::new(stub))
4780        }
4781
4782        /// Sets the full request, replacing any prior values.
4783        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
4784            mut self,
4785            v: V,
4786        ) -> Self {
4787            self.0.request = v.into();
4788            self
4789        }
4790
4791        /// Sets all the options, replacing any prior values.
4792        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4793            self.0.options = v.into();
4794            self
4795        }
4796
4797        /// Sends the request.
4798        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
4799            (*self.0.stub)
4800                .get_location(self.0.request, self.0.options)
4801                .await
4802                .map(crate::Response::into_body)
4803        }
4804
4805        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
4806        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4807            self.0.request.name = v.into();
4808            self
4809        }
4810    }
4811
4812    #[doc(hidden)]
4813    impl crate::RequestBuilder for GetLocation {
4814        fn request_options(&mut self) -> &mut crate::RequestOptions {
4815            &mut self.0.options
4816        }
4817    }
4818
4819    /// The request builder for [DataTransferService::set_iam_policy][crate::client::DataTransferService::set_iam_policy] calls.
4820    ///
4821    /// # Example
4822    /// ```
4823    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::SetIamPolicy;
4824    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
4825    ///
4826    /// let builder = prepare_request_builder();
4827    /// let response = builder.send().await?;
4828    /// # Ok(()) }
4829    ///
4830    /// fn prepare_request_builder() -> SetIamPolicy {
4831    ///   # panic!();
4832    ///   // ... details omitted ...
4833    /// }
4834    /// ```
4835    #[derive(Clone, Debug)]
4836    pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
4837
4838    impl SetIamPolicy {
4839        pub(crate) fn new(
4840            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4841        ) -> Self {
4842            Self(RequestBuilder::new(stub))
4843        }
4844
4845        /// Sets the full request, replacing any prior values.
4846        pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
4847            mut self,
4848            v: V,
4849        ) -> Self {
4850            self.0.request = v.into();
4851            self
4852        }
4853
4854        /// Sets all the options, replacing any prior values.
4855        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4856            self.0.options = v.into();
4857            self
4858        }
4859
4860        /// Sends the request.
4861        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
4862            (*self.0.stub)
4863                .set_iam_policy(self.0.request, self.0.options)
4864                .await
4865                .map(crate::Response::into_body)
4866        }
4867
4868        /// Sets the value of [resource][google_cloud_iam_v1::model::SetIamPolicyRequest::resource].
4869        ///
4870        /// This is a **required** field for requests.
4871        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4872            self.0.request.resource = v.into();
4873            self
4874        }
4875
4876        /// Sets the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
4877        ///
4878        /// This is a **required** field for requests.
4879        pub fn set_policy<T>(mut self, v: T) -> Self
4880        where
4881            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
4882        {
4883            self.0.request.policy = std::option::Option::Some(v.into());
4884            self
4885        }
4886
4887        /// Sets or clears the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
4888        ///
4889        /// This is a **required** field for requests.
4890        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
4891        where
4892            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
4893        {
4894            self.0.request.policy = v.map(|x| x.into());
4895            self
4896        }
4897
4898        /// Sets the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
4899        pub fn set_update_mask<T>(mut self, v: T) -> Self
4900        where
4901            T: std::convert::Into<wkt::FieldMask>,
4902        {
4903            self.0.request.update_mask = std::option::Option::Some(v.into());
4904            self
4905        }
4906
4907        /// Sets or clears the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
4908        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4909        where
4910            T: std::convert::Into<wkt::FieldMask>,
4911        {
4912            self.0.request.update_mask = v.map(|x| x.into());
4913            self
4914        }
4915    }
4916
4917    #[doc(hidden)]
4918    impl crate::RequestBuilder for SetIamPolicy {
4919        fn request_options(&mut self) -> &mut crate::RequestOptions {
4920            &mut self.0.options
4921        }
4922    }
4923
4924    /// The request builder for [DataTransferService::get_iam_policy][crate::client::DataTransferService::get_iam_policy] calls.
4925    ///
4926    /// # Example
4927    /// ```
4928    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::GetIamPolicy;
4929    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
4930    ///
4931    /// let builder = prepare_request_builder();
4932    /// let response = builder.send().await?;
4933    /// # Ok(()) }
4934    ///
4935    /// fn prepare_request_builder() -> GetIamPolicy {
4936    ///   # panic!();
4937    ///   // ... details omitted ...
4938    /// }
4939    /// ```
4940    #[derive(Clone, Debug)]
4941    pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
4942
4943    impl GetIamPolicy {
4944        pub(crate) fn new(
4945            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4946        ) -> Self {
4947            Self(RequestBuilder::new(stub))
4948        }
4949
4950        /// Sets the full request, replacing any prior values.
4951        pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
4952            mut self,
4953            v: V,
4954        ) -> Self {
4955            self.0.request = v.into();
4956            self
4957        }
4958
4959        /// Sets all the options, replacing any prior values.
4960        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4961            self.0.options = v.into();
4962            self
4963        }
4964
4965        /// Sends the request.
4966        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
4967            (*self.0.stub)
4968                .get_iam_policy(self.0.request, self.0.options)
4969                .await
4970                .map(crate::Response::into_body)
4971        }
4972
4973        /// Sets the value of [resource][google_cloud_iam_v1::model::GetIamPolicyRequest::resource].
4974        ///
4975        /// This is a **required** field for requests.
4976        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4977            self.0.request.resource = v.into();
4978            self
4979        }
4980
4981        /// Sets the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
4982        pub fn set_options<T>(mut self, v: T) -> Self
4983        where
4984            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
4985        {
4986            self.0.request.options = std::option::Option::Some(v.into());
4987            self
4988        }
4989
4990        /// Sets or clears the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
4991        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
4992        where
4993            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
4994        {
4995            self.0.request.options = v.map(|x| x.into());
4996            self
4997        }
4998    }
4999
5000    #[doc(hidden)]
5001    impl crate::RequestBuilder for GetIamPolicy {
5002        fn request_options(&mut self) -> &mut crate::RequestOptions {
5003            &mut self.0.options
5004        }
5005    }
5006
5007    /// The request builder for [DataTransferService::test_iam_permissions][crate::client::DataTransferService::test_iam_permissions] calls.
5008    ///
5009    /// # Example
5010    /// ```
5011    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::TestIamPermissions;
5012    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
5013    ///
5014    /// let builder = prepare_request_builder();
5015    /// let response = builder.send().await?;
5016    /// # Ok(()) }
5017    ///
5018    /// fn prepare_request_builder() -> TestIamPermissions {
5019    ///   # panic!();
5020    ///   // ... details omitted ...
5021    /// }
5022    /// ```
5023    #[derive(Clone, Debug)]
5024    pub struct TestIamPermissions(
5025        RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
5026    );
5027
5028    impl TestIamPermissions {
5029        pub(crate) fn new(
5030            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
5031        ) -> Self {
5032            Self(RequestBuilder::new(stub))
5033        }
5034
5035        /// Sets the full request, replacing any prior values.
5036        pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
5037            mut self,
5038            v: V,
5039        ) -> Self {
5040            self.0.request = v.into();
5041            self
5042        }
5043
5044        /// Sets all the options, replacing any prior values.
5045        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5046            self.0.options = v.into();
5047            self
5048        }
5049
5050        /// Sends the request.
5051        pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
5052            (*self.0.stub)
5053                .test_iam_permissions(self.0.request, self.0.options)
5054                .await
5055                .map(crate::Response::into_body)
5056        }
5057
5058        /// Sets the value of [resource][google_cloud_iam_v1::model::TestIamPermissionsRequest::resource].
5059        ///
5060        /// This is a **required** field for requests.
5061        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5062            self.0.request.resource = v.into();
5063            self
5064        }
5065
5066        /// Sets the value of [permissions][google_cloud_iam_v1::model::TestIamPermissionsRequest::permissions].
5067        ///
5068        /// This is a **required** field for requests.
5069        pub fn set_permissions<T, V>(mut self, v: T) -> Self
5070        where
5071            T: std::iter::IntoIterator<Item = V>,
5072            V: std::convert::Into<std::string::String>,
5073        {
5074            use std::iter::Iterator;
5075            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
5076            self
5077        }
5078    }
5079
5080    #[doc(hidden)]
5081    impl crate::RequestBuilder for TestIamPermissions {
5082        fn request_options(&mut self) -> &mut crate::RequestOptions {
5083            &mut self.0.options
5084        }
5085    }
5086
5087    /// The request builder for [DataTransferService::list_operations][crate::client::DataTransferService::list_operations] calls.
5088    ///
5089    /// # Example
5090    /// ```
5091    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::ListOperations;
5092    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
5093    /// use google_cloud_gax::paginator::ItemPaginator;
5094    ///
5095    /// let builder = prepare_request_builder();
5096    /// let mut items = builder.by_item();
5097    /// while let Some(result) = items.next().await {
5098    ///   let item = result?;
5099    /// }
5100    /// # Ok(()) }
5101    ///
5102    /// fn prepare_request_builder() -> ListOperations {
5103    ///   # panic!();
5104    ///   // ... details omitted ...
5105    /// }
5106    /// ```
5107    #[derive(Clone, Debug)]
5108    pub struct ListOperations(
5109        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
5110    );
5111
5112    impl ListOperations {
5113        pub(crate) fn new(
5114            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
5115        ) -> Self {
5116            Self(RequestBuilder::new(stub))
5117        }
5118
5119        /// Sets the full request, replacing any prior values.
5120        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
5121            mut self,
5122            v: V,
5123        ) -> Self {
5124            self.0.request = v.into();
5125            self
5126        }
5127
5128        /// Sets all the options, replacing any prior values.
5129        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5130            self.0.options = v.into();
5131            self
5132        }
5133
5134        /// Sends the request.
5135        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
5136            (*self.0.stub)
5137                .list_operations(self.0.request, self.0.options)
5138                .await
5139                .map(crate::Response::into_body)
5140        }
5141
5142        /// Streams each page in the collection.
5143        pub fn by_page(
5144            self,
5145        ) -> impl google_cloud_gax::paginator::Paginator<
5146            google_cloud_longrunning::model::ListOperationsResponse,
5147            crate::Error,
5148        > {
5149            use std::clone::Clone;
5150            let token = self.0.request.page_token.clone();
5151            let execute = move |token: String| {
5152                let mut builder = self.clone();
5153                builder.0.request = builder.0.request.set_page_token(token);
5154                builder.send()
5155            };
5156            google_cloud_gax::paginator::internal::new_paginator(token, execute)
5157        }
5158
5159        /// Streams each item in the collection.
5160        pub fn by_item(
5161            self,
5162        ) -> impl google_cloud_gax::paginator::ItemPaginator<
5163            google_cloud_longrunning::model::ListOperationsResponse,
5164            crate::Error,
5165        > {
5166            use google_cloud_gax::paginator::Paginator;
5167            self.by_page().items()
5168        }
5169
5170        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
5171        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5172            self.0.request.name = v.into();
5173            self
5174        }
5175
5176        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
5177        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5178            self.0.request.filter = v.into();
5179            self
5180        }
5181
5182        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
5183        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5184            self.0.request.page_size = v.into();
5185            self
5186        }
5187
5188        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
5189        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5190            self.0.request.page_token = v.into();
5191            self
5192        }
5193
5194        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
5195        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
5196            self.0.request.return_partial_success = v.into();
5197            self
5198        }
5199    }
5200
5201    #[doc(hidden)]
5202    impl crate::RequestBuilder for ListOperations {
5203        fn request_options(&mut self) -> &mut crate::RequestOptions {
5204            &mut self.0.options
5205        }
5206    }
5207
5208    /// The request builder for [DataTransferService::get_operation][crate::client::DataTransferService::get_operation] calls.
5209    ///
5210    /// # Example
5211    /// ```
5212    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::GetOperation;
5213    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
5214    ///
5215    /// let builder = prepare_request_builder();
5216    /// let response = builder.send().await?;
5217    /// # Ok(()) }
5218    ///
5219    /// fn prepare_request_builder() -> GetOperation {
5220    ///   # panic!();
5221    ///   // ... details omitted ...
5222    /// }
5223    /// ```
5224    #[derive(Clone, Debug)]
5225    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
5226
5227    impl GetOperation {
5228        pub(crate) fn new(
5229            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
5230        ) -> Self {
5231            Self(RequestBuilder::new(stub))
5232        }
5233
5234        /// Sets the full request, replacing any prior values.
5235        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
5236            mut self,
5237            v: V,
5238        ) -> Self {
5239            self.0.request = v.into();
5240            self
5241        }
5242
5243        /// Sets all the options, replacing any prior values.
5244        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5245            self.0.options = v.into();
5246            self
5247        }
5248
5249        /// Sends the request.
5250        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5251            (*self.0.stub)
5252                .get_operation(self.0.request, self.0.options)
5253                .await
5254                .map(crate::Response::into_body)
5255        }
5256
5257        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
5258        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5259            self.0.request.name = v.into();
5260            self
5261        }
5262    }
5263
5264    #[doc(hidden)]
5265    impl crate::RequestBuilder for GetOperation {
5266        fn request_options(&mut self) -> &mut crate::RequestOptions {
5267            &mut self.0.options
5268        }
5269    }
5270
5271    /// The request builder for [DataTransferService::delete_operation][crate::client::DataTransferService::delete_operation] calls.
5272    ///
5273    /// # Example
5274    /// ```
5275    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::DeleteOperation;
5276    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
5277    ///
5278    /// let builder = prepare_request_builder();
5279    /// let response = builder.send().await?;
5280    /// # Ok(()) }
5281    ///
5282    /// fn prepare_request_builder() -> DeleteOperation {
5283    ///   # panic!();
5284    ///   // ... details omitted ...
5285    /// }
5286    /// ```
5287    #[derive(Clone, Debug)]
5288    pub struct DeleteOperation(
5289        RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
5290    );
5291
5292    impl DeleteOperation {
5293        pub(crate) fn new(
5294            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
5295        ) -> Self {
5296            Self(RequestBuilder::new(stub))
5297        }
5298
5299        /// Sets the full request, replacing any prior values.
5300        pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
5301            mut self,
5302            v: V,
5303        ) -> Self {
5304            self.0.request = v.into();
5305            self
5306        }
5307
5308        /// Sets all the options, replacing any prior values.
5309        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5310            self.0.options = v.into();
5311            self
5312        }
5313
5314        /// Sends the request.
5315        pub async fn send(self) -> Result<()> {
5316            (*self.0.stub)
5317                .delete_operation(self.0.request, self.0.options)
5318                .await
5319                .map(crate::Response::into_body)
5320        }
5321
5322        /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
5323        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5324            self.0.request.name = v.into();
5325            self
5326        }
5327    }
5328
5329    #[doc(hidden)]
5330    impl crate::RequestBuilder for DeleteOperation {
5331        fn request_options(&mut self) -> &mut crate::RequestOptions {
5332            &mut self.0.options
5333        }
5334    }
5335
5336    /// The request builder for [DataTransferService::cancel_operation][crate::client::DataTransferService::cancel_operation] calls.
5337    ///
5338    /// # Example
5339    /// ```
5340    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::CancelOperation;
5341    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
5342    ///
5343    /// let builder = prepare_request_builder();
5344    /// let response = builder.send().await?;
5345    /// # Ok(()) }
5346    ///
5347    /// fn prepare_request_builder() -> CancelOperation {
5348    ///   # panic!();
5349    ///   // ... details omitted ...
5350    /// }
5351    /// ```
5352    #[derive(Clone, Debug)]
5353    pub struct CancelOperation(
5354        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
5355    );
5356
5357    impl CancelOperation {
5358        pub(crate) fn new(
5359            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
5360        ) -> Self {
5361            Self(RequestBuilder::new(stub))
5362        }
5363
5364        /// Sets the full request, replacing any prior values.
5365        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
5366            mut self,
5367            v: V,
5368        ) -> Self {
5369            self.0.request = v.into();
5370            self
5371        }
5372
5373        /// Sets all the options, replacing any prior values.
5374        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5375            self.0.options = v.into();
5376            self
5377        }
5378
5379        /// Sends the request.
5380        pub async fn send(self) -> Result<()> {
5381            (*self.0.stub)
5382                .cancel_operation(self.0.request, self.0.options)
5383                .await
5384                .map(crate::Response::into_body)
5385        }
5386
5387        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
5388        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5389            self.0.request.name = v.into();
5390            self
5391        }
5392    }
5393
5394    #[doc(hidden)]
5395    impl crate::RequestBuilder for CancelOperation {
5396        fn request_options(&mut self) -> &mut crate::RequestOptions {
5397            &mut self.0.options
5398        }
5399    }
5400}
5401
5402/// Request and client builders for [HubService][crate::client::HubService].
5403pub mod hub_service {
5404    use crate::Result;
5405
5406    /// A builder for [HubService][crate::client::HubService].
5407    ///
5408    /// ```
5409    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
5410    /// # use google_cloud_networkconnectivity_v1::*;
5411    /// # use builder::hub_service::ClientBuilder;
5412    /// # use client::HubService;
5413    /// let builder : ClientBuilder = HubService::builder();
5414    /// let client = builder
5415    ///     .with_endpoint("https://networkconnectivity.googleapis.com")
5416    ///     .build().await?;
5417    /// # Ok(()) }
5418    /// ```
5419    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
5420
5421    pub(crate) mod client {
5422        use super::super::super::client::HubService;
5423        pub struct Factory;
5424        impl crate::ClientFactory for Factory {
5425            type Client = HubService;
5426            type Credentials = gaxi::options::Credentials;
5427            async fn build(
5428                self,
5429                config: gaxi::options::ClientConfig,
5430            ) -> crate::ClientBuilderResult<Self::Client> {
5431                Self::Client::new(config).await
5432            }
5433        }
5434    }
5435
5436    /// Common implementation for [crate::client::HubService] request builders.
5437    #[derive(Clone, Debug)]
5438    pub(crate) struct RequestBuilder<R: std::default::Default> {
5439        stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5440        request: R,
5441        options: crate::RequestOptions,
5442    }
5443
5444    impl<R> RequestBuilder<R>
5445    where
5446        R: std::default::Default,
5447    {
5448        pub(crate) fn new(
5449            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5450        ) -> Self {
5451            Self {
5452                stub,
5453                request: R::default(),
5454                options: crate::RequestOptions::default(),
5455            }
5456        }
5457    }
5458
5459    /// The request builder for [HubService::list_hubs][crate::client::HubService::list_hubs] calls.
5460    ///
5461    /// # Example
5462    /// ```
5463    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::ListHubs;
5464    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
5465    /// use google_cloud_gax::paginator::ItemPaginator;
5466    ///
5467    /// let builder = prepare_request_builder();
5468    /// let mut items = builder.by_item();
5469    /// while let Some(result) = items.next().await {
5470    ///   let item = result?;
5471    /// }
5472    /// # Ok(()) }
5473    ///
5474    /// fn prepare_request_builder() -> ListHubs {
5475    ///   # panic!();
5476    ///   // ... details omitted ...
5477    /// }
5478    /// ```
5479    #[derive(Clone, Debug)]
5480    pub struct ListHubs(RequestBuilder<crate::model::ListHubsRequest>);
5481
5482    impl ListHubs {
5483        pub(crate) fn new(
5484            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5485        ) -> Self {
5486            Self(RequestBuilder::new(stub))
5487        }
5488
5489        /// Sets the full request, replacing any prior values.
5490        pub fn with_request<V: Into<crate::model::ListHubsRequest>>(mut self, v: V) -> Self {
5491            self.0.request = v.into();
5492            self
5493        }
5494
5495        /// Sets all the options, replacing any prior values.
5496        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5497            self.0.options = v.into();
5498            self
5499        }
5500
5501        /// Sends the request.
5502        pub async fn send(self) -> Result<crate::model::ListHubsResponse> {
5503            (*self.0.stub)
5504                .list_hubs(self.0.request, self.0.options)
5505                .await
5506                .map(crate::Response::into_body)
5507        }
5508
5509        /// Streams each page in the collection.
5510        pub fn by_page(
5511            self,
5512        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListHubsResponse, crate::Error>
5513        {
5514            use std::clone::Clone;
5515            let token = self.0.request.page_token.clone();
5516            let execute = move |token: String| {
5517                let mut builder = self.clone();
5518                builder.0.request = builder.0.request.set_page_token(token);
5519                builder.send()
5520            };
5521            google_cloud_gax::paginator::internal::new_paginator(token, execute)
5522        }
5523
5524        /// Streams each item in the collection.
5525        pub fn by_item(
5526            self,
5527        ) -> impl google_cloud_gax::paginator::ItemPaginator<crate::model::ListHubsResponse, crate::Error>
5528        {
5529            use google_cloud_gax::paginator::Paginator;
5530            self.by_page().items()
5531        }
5532
5533        /// Sets the value of [parent][crate::model::ListHubsRequest::parent].
5534        ///
5535        /// This is a **required** field for requests.
5536        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5537            self.0.request.parent = v.into();
5538            self
5539        }
5540
5541        /// Sets the value of [page_size][crate::model::ListHubsRequest::page_size].
5542        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5543            self.0.request.page_size = v.into();
5544            self
5545        }
5546
5547        /// Sets the value of [page_token][crate::model::ListHubsRequest::page_token].
5548        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5549            self.0.request.page_token = v.into();
5550            self
5551        }
5552
5553        /// Sets the value of [filter][crate::model::ListHubsRequest::filter].
5554        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5555            self.0.request.filter = v.into();
5556            self
5557        }
5558
5559        /// Sets the value of [order_by][crate::model::ListHubsRequest::order_by].
5560        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
5561            self.0.request.order_by = v.into();
5562            self
5563        }
5564    }
5565
5566    #[doc(hidden)]
5567    impl crate::RequestBuilder for ListHubs {
5568        fn request_options(&mut self) -> &mut crate::RequestOptions {
5569            &mut self.0.options
5570        }
5571    }
5572
5573    /// The request builder for [HubService::get_hub][crate::client::HubService::get_hub] calls.
5574    ///
5575    /// # Example
5576    /// ```
5577    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::GetHub;
5578    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
5579    ///
5580    /// let builder = prepare_request_builder();
5581    /// let response = builder.send().await?;
5582    /// # Ok(()) }
5583    ///
5584    /// fn prepare_request_builder() -> GetHub {
5585    ///   # panic!();
5586    ///   // ... details omitted ...
5587    /// }
5588    /// ```
5589    #[derive(Clone, Debug)]
5590    pub struct GetHub(RequestBuilder<crate::model::GetHubRequest>);
5591
5592    impl GetHub {
5593        pub(crate) fn new(
5594            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5595        ) -> Self {
5596            Self(RequestBuilder::new(stub))
5597        }
5598
5599        /// Sets the full request, replacing any prior values.
5600        pub fn with_request<V: Into<crate::model::GetHubRequest>>(mut self, v: V) -> Self {
5601            self.0.request = v.into();
5602            self
5603        }
5604
5605        /// Sets all the options, replacing any prior values.
5606        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5607            self.0.options = v.into();
5608            self
5609        }
5610
5611        /// Sends the request.
5612        pub async fn send(self) -> Result<crate::model::Hub> {
5613            (*self.0.stub)
5614                .get_hub(self.0.request, self.0.options)
5615                .await
5616                .map(crate::Response::into_body)
5617        }
5618
5619        /// Sets the value of [name][crate::model::GetHubRequest::name].
5620        ///
5621        /// This is a **required** field for requests.
5622        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5623            self.0.request.name = v.into();
5624            self
5625        }
5626    }
5627
5628    #[doc(hidden)]
5629    impl crate::RequestBuilder for GetHub {
5630        fn request_options(&mut self) -> &mut crate::RequestOptions {
5631            &mut self.0.options
5632        }
5633    }
5634
5635    /// The request builder for [HubService::create_hub][crate::client::HubService::create_hub] calls.
5636    ///
5637    /// # Example
5638    /// ```
5639    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::CreateHub;
5640    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
5641    /// use google_cloud_lro::Poller;
5642    ///
5643    /// let builder = prepare_request_builder();
5644    /// let response = builder.poller().until_done().await?;
5645    /// # Ok(()) }
5646    ///
5647    /// fn prepare_request_builder() -> CreateHub {
5648    ///   # panic!();
5649    ///   // ... details omitted ...
5650    /// }
5651    /// ```
5652    #[derive(Clone, Debug)]
5653    pub struct CreateHub(RequestBuilder<crate::model::CreateHubRequest>);
5654
5655    impl CreateHub {
5656        pub(crate) fn new(
5657            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5658        ) -> Self {
5659            Self(RequestBuilder::new(stub))
5660        }
5661
5662        /// Sets the full request, replacing any prior values.
5663        pub fn with_request<V: Into<crate::model::CreateHubRequest>>(mut self, v: V) -> Self {
5664            self.0.request = v.into();
5665            self
5666        }
5667
5668        /// Sets all the options, replacing any prior values.
5669        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5670            self.0.options = v.into();
5671            self
5672        }
5673
5674        /// Sends the request.
5675        ///
5676        /// # Long running operations
5677        ///
5678        /// This starts, but does not poll, a longrunning operation. More information
5679        /// on [create_hub][crate::client::HubService::create_hub].
5680        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5681            (*self.0.stub)
5682                .create_hub(self.0.request, self.0.options)
5683                .await
5684                .map(crate::Response::into_body)
5685        }
5686
5687        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_hub`.
5688        pub fn poller(
5689            self,
5690        ) -> impl google_cloud_lro::Poller<crate::model::Hub, crate::model::OperationMetadata>
5691        {
5692            type Operation = google_cloud_lro::internal::Operation<
5693                crate::model::Hub,
5694                crate::model::OperationMetadata,
5695            >;
5696            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5697            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5698            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
5699            if let Some(ref mut details) = poller_options.tracing {
5700                details.method_name = "google_cloud_networkconnectivity_v1::client::HubService::create_hub::until_done";
5701            }
5702
5703            let stub = self.0.stub.clone();
5704            let mut options = self.0.options.clone();
5705            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5706            let query = move |name| {
5707                let stub = stub.clone();
5708                let options = options.clone();
5709                async {
5710                    let op = GetOperation::new(stub)
5711                        .set_name(name)
5712                        .with_options(options)
5713                        .send()
5714                        .await?;
5715                    Ok(Operation::new(op))
5716                }
5717            };
5718
5719            let start = move || async {
5720                let op = self.send().await?;
5721                Ok(Operation::new(op))
5722            };
5723
5724            use google_cloud_lro::internal::PollerExt;
5725            {
5726                google_cloud_lro::internal::new_poller(
5727                    polling_error_policy,
5728                    polling_backoff_policy,
5729                    start,
5730                    query,
5731                )
5732            }
5733            .with_options(poller_options)
5734        }
5735
5736        /// Sets the value of [parent][crate::model::CreateHubRequest::parent].
5737        ///
5738        /// This is a **required** field for requests.
5739        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5740            self.0.request.parent = v.into();
5741            self
5742        }
5743
5744        /// Sets the value of [hub_id][crate::model::CreateHubRequest::hub_id].
5745        ///
5746        /// This is a **required** field for requests.
5747        pub fn set_hub_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5748            self.0.request.hub_id = v.into();
5749            self
5750        }
5751
5752        /// Sets the value of [hub][crate::model::CreateHubRequest::hub].
5753        ///
5754        /// This is a **required** field for requests.
5755        pub fn set_hub<T>(mut self, v: T) -> Self
5756        where
5757            T: std::convert::Into<crate::model::Hub>,
5758        {
5759            self.0.request.hub = std::option::Option::Some(v.into());
5760            self
5761        }
5762
5763        /// Sets or clears the value of [hub][crate::model::CreateHubRequest::hub].
5764        ///
5765        /// This is a **required** field for requests.
5766        pub fn set_or_clear_hub<T>(mut self, v: std::option::Option<T>) -> Self
5767        where
5768            T: std::convert::Into<crate::model::Hub>,
5769        {
5770            self.0.request.hub = v.map(|x| x.into());
5771            self
5772        }
5773
5774        /// Sets the value of [request_id][crate::model::CreateHubRequest::request_id].
5775        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5776            self.0.request.request_id = v.into();
5777            self
5778        }
5779    }
5780
5781    #[doc(hidden)]
5782    impl crate::RequestBuilder for CreateHub {
5783        fn request_options(&mut self) -> &mut crate::RequestOptions {
5784            &mut self.0.options
5785        }
5786    }
5787
5788    /// The request builder for [HubService::update_hub][crate::client::HubService::update_hub] calls.
5789    ///
5790    /// # Example
5791    /// ```
5792    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::UpdateHub;
5793    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
5794    /// use google_cloud_lro::Poller;
5795    ///
5796    /// let builder = prepare_request_builder();
5797    /// let response = builder.poller().until_done().await?;
5798    /// # Ok(()) }
5799    ///
5800    /// fn prepare_request_builder() -> UpdateHub {
5801    ///   # panic!();
5802    ///   // ... details omitted ...
5803    /// }
5804    /// ```
5805    #[derive(Clone, Debug)]
5806    pub struct UpdateHub(RequestBuilder<crate::model::UpdateHubRequest>);
5807
5808    impl UpdateHub {
5809        pub(crate) fn new(
5810            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5811        ) -> Self {
5812            Self(RequestBuilder::new(stub))
5813        }
5814
5815        /// Sets the full request, replacing any prior values.
5816        pub fn with_request<V: Into<crate::model::UpdateHubRequest>>(mut self, v: V) -> Self {
5817            self.0.request = v.into();
5818            self
5819        }
5820
5821        /// Sets all the options, replacing any prior values.
5822        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5823            self.0.options = v.into();
5824            self
5825        }
5826
5827        /// Sends the request.
5828        ///
5829        /// # Long running operations
5830        ///
5831        /// This starts, but does not poll, a longrunning operation. More information
5832        /// on [update_hub][crate::client::HubService::update_hub].
5833        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5834            (*self.0.stub)
5835                .update_hub(self.0.request, self.0.options)
5836                .await
5837                .map(crate::Response::into_body)
5838        }
5839
5840        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_hub`.
5841        pub fn poller(
5842            self,
5843        ) -> impl google_cloud_lro::Poller<crate::model::Hub, crate::model::OperationMetadata>
5844        {
5845            type Operation = google_cloud_lro::internal::Operation<
5846                crate::model::Hub,
5847                crate::model::OperationMetadata,
5848            >;
5849            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5850            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5851            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
5852            if let Some(ref mut details) = poller_options.tracing {
5853                details.method_name = "google_cloud_networkconnectivity_v1::client::HubService::update_hub::until_done";
5854            }
5855
5856            let stub = self.0.stub.clone();
5857            let mut options = self.0.options.clone();
5858            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5859            let query = move |name| {
5860                let stub = stub.clone();
5861                let options = options.clone();
5862                async {
5863                    let op = GetOperation::new(stub)
5864                        .set_name(name)
5865                        .with_options(options)
5866                        .send()
5867                        .await?;
5868                    Ok(Operation::new(op))
5869                }
5870            };
5871
5872            let start = move || async {
5873                let op = self.send().await?;
5874                Ok(Operation::new(op))
5875            };
5876
5877            use google_cloud_lro::internal::PollerExt;
5878            {
5879                google_cloud_lro::internal::new_poller(
5880                    polling_error_policy,
5881                    polling_backoff_policy,
5882                    start,
5883                    query,
5884                )
5885            }
5886            .with_options(poller_options)
5887        }
5888
5889        /// Sets the value of [update_mask][crate::model::UpdateHubRequest::update_mask].
5890        pub fn set_update_mask<T>(mut self, v: T) -> Self
5891        where
5892            T: std::convert::Into<wkt::FieldMask>,
5893        {
5894            self.0.request.update_mask = std::option::Option::Some(v.into());
5895            self
5896        }
5897
5898        /// Sets or clears the value of [update_mask][crate::model::UpdateHubRequest::update_mask].
5899        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5900        where
5901            T: std::convert::Into<wkt::FieldMask>,
5902        {
5903            self.0.request.update_mask = v.map(|x| x.into());
5904            self
5905        }
5906
5907        /// Sets the value of [hub][crate::model::UpdateHubRequest::hub].
5908        ///
5909        /// This is a **required** field for requests.
5910        pub fn set_hub<T>(mut self, v: T) -> Self
5911        where
5912            T: std::convert::Into<crate::model::Hub>,
5913        {
5914            self.0.request.hub = std::option::Option::Some(v.into());
5915            self
5916        }
5917
5918        /// Sets or clears the value of [hub][crate::model::UpdateHubRequest::hub].
5919        ///
5920        /// This is a **required** field for requests.
5921        pub fn set_or_clear_hub<T>(mut self, v: std::option::Option<T>) -> Self
5922        where
5923            T: std::convert::Into<crate::model::Hub>,
5924        {
5925            self.0.request.hub = v.map(|x| x.into());
5926            self
5927        }
5928
5929        /// Sets the value of [request_id][crate::model::UpdateHubRequest::request_id].
5930        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5931            self.0.request.request_id = v.into();
5932            self
5933        }
5934    }
5935
5936    #[doc(hidden)]
5937    impl crate::RequestBuilder for UpdateHub {
5938        fn request_options(&mut self) -> &mut crate::RequestOptions {
5939            &mut self.0.options
5940        }
5941    }
5942
5943    /// The request builder for [HubService::delete_hub][crate::client::HubService::delete_hub] calls.
5944    ///
5945    /// # Example
5946    /// ```
5947    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::DeleteHub;
5948    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
5949    /// use google_cloud_lro::Poller;
5950    ///
5951    /// let builder = prepare_request_builder();
5952    /// let response = builder.poller().until_done().await?;
5953    /// # Ok(()) }
5954    ///
5955    /// fn prepare_request_builder() -> DeleteHub {
5956    ///   # panic!();
5957    ///   // ... details omitted ...
5958    /// }
5959    /// ```
5960    #[derive(Clone, Debug)]
5961    pub struct DeleteHub(RequestBuilder<crate::model::DeleteHubRequest>);
5962
5963    impl DeleteHub {
5964        pub(crate) fn new(
5965            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5966        ) -> Self {
5967            Self(RequestBuilder::new(stub))
5968        }
5969
5970        /// Sets the full request, replacing any prior values.
5971        pub fn with_request<V: Into<crate::model::DeleteHubRequest>>(mut self, v: V) -> Self {
5972            self.0.request = v.into();
5973            self
5974        }
5975
5976        /// Sets all the options, replacing any prior values.
5977        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5978            self.0.options = v.into();
5979            self
5980        }
5981
5982        /// Sends the request.
5983        ///
5984        /// # Long running operations
5985        ///
5986        /// This starts, but does not poll, a longrunning operation. More information
5987        /// on [delete_hub][crate::client::HubService::delete_hub].
5988        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5989            (*self.0.stub)
5990                .delete_hub(self.0.request, self.0.options)
5991                .await
5992                .map(crate::Response::into_body)
5993        }
5994
5995        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_hub`.
5996        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
5997            type Operation =
5998                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
5999            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6000            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6001            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
6002            if let Some(ref mut details) = poller_options.tracing {
6003                details.method_name = "google_cloud_networkconnectivity_v1::client::HubService::delete_hub::until_done";
6004            }
6005
6006            let stub = self.0.stub.clone();
6007            let mut options = self.0.options.clone();
6008            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6009            let query = move |name| {
6010                let stub = stub.clone();
6011                let options = options.clone();
6012                async {
6013                    let op = GetOperation::new(stub)
6014                        .set_name(name)
6015                        .with_options(options)
6016                        .send()
6017                        .await?;
6018                    Ok(Operation::new(op))
6019                }
6020            };
6021
6022            let start = move || async {
6023                let op = self.send().await?;
6024                Ok(Operation::new(op))
6025            };
6026
6027            use google_cloud_lro::internal::PollerExt;
6028            {
6029                google_cloud_lro::internal::new_unit_response_poller(
6030                    polling_error_policy,
6031                    polling_backoff_policy,
6032                    start,
6033                    query,
6034                )
6035            }
6036            .with_options(poller_options)
6037        }
6038
6039        /// Sets the value of [name][crate::model::DeleteHubRequest::name].
6040        ///
6041        /// This is a **required** field for requests.
6042        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6043            self.0.request.name = v.into();
6044            self
6045        }
6046
6047        /// Sets the value of [request_id][crate::model::DeleteHubRequest::request_id].
6048        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6049            self.0.request.request_id = v.into();
6050            self
6051        }
6052    }
6053
6054    #[doc(hidden)]
6055    impl crate::RequestBuilder for DeleteHub {
6056        fn request_options(&mut self) -> &mut crate::RequestOptions {
6057            &mut self.0.options
6058        }
6059    }
6060
6061    /// The request builder for [HubService::list_hub_spokes][crate::client::HubService::list_hub_spokes] calls.
6062    ///
6063    /// # Example
6064    /// ```
6065    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::ListHubSpokes;
6066    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
6067    /// use google_cloud_gax::paginator::ItemPaginator;
6068    ///
6069    /// let builder = prepare_request_builder();
6070    /// let mut items = builder.by_item();
6071    /// while let Some(result) = items.next().await {
6072    ///   let item = result?;
6073    /// }
6074    /// # Ok(()) }
6075    ///
6076    /// fn prepare_request_builder() -> ListHubSpokes {
6077    ///   # panic!();
6078    ///   // ... details omitted ...
6079    /// }
6080    /// ```
6081    #[derive(Clone, Debug)]
6082    pub struct ListHubSpokes(RequestBuilder<crate::model::ListHubSpokesRequest>);
6083
6084    impl ListHubSpokes {
6085        pub(crate) fn new(
6086            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6087        ) -> Self {
6088            Self(RequestBuilder::new(stub))
6089        }
6090
6091        /// Sets the full request, replacing any prior values.
6092        pub fn with_request<V: Into<crate::model::ListHubSpokesRequest>>(mut self, v: V) -> Self {
6093            self.0.request = v.into();
6094            self
6095        }
6096
6097        /// Sets all the options, replacing any prior values.
6098        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6099            self.0.options = v.into();
6100            self
6101        }
6102
6103        /// Sends the request.
6104        pub async fn send(self) -> Result<crate::model::ListHubSpokesResponse> {
6105            (*self.0.stub)
6106                .list_hub_spokes(self.0.request, self.0.options)
6107                .await
6108                .map(crate::Response::into_body)
6109        }
6110
6111        /// Streams each page in the collection.
6112        pub fn by_page(
6113            self,
6114        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListHubSpokesResponse, crate::Error>
6115        {
6116            use std::clone::Clone;
6117            let token = self.0.request.page_token.clone();
6118            let execute = move |token: String| {
6119                let mut builder = self.clone();
6120                builder.0.request = builder.0.request.set_page_token(token);
6121                builder.send()
6122            };
6123            google_cloud_gax::paginator::internal::new_paginator(token, execute)
6124        }
6125
6126        /// Streams each item in the collection.
6127        pub fn by_item(
6128            self,
6129        ) -> impl google_cloud_gax::paginator::ItemPaginator<
6130            crate::model::ListHubSpokesResponse,
6131            crate::Error,
6132        > {
6133            use google_cloud_gax::paginator::Paginator;
6134            self.by_page().items()
6135        }
6136
6137        /// Sets the value of [name][crate::model::ListHubSpokesRequest::name].
6138        ///
6139        /// This is a **required** field for requests.
6140        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6141            self.0.request.name = v.into();
6142            self
6143        }
6144
6145        /// Sets the value of [spoke_locations][crate::model::ListHubSpokesRequest::spoke_locations].
6146        pub fn set_spoke_locations<T, V>(mut self, v: T) -> Self
6147        where
6148            T: std::iter::IntoIterator<Item = V>,
6149            V: std::convert::Into<std::string::String>,
6150        {
6151            use std::iter::Iterator;
6152            self.0.request.spoke_locations = v.into_iter().map(|i| i.into()).collect();
6153            self
6154        }
6155
6156        /// Sets the value of [page_size][crate::model::ListHubSpokesRequest::page_size].
6157        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6158            self.0.request.page_size = v.into();
6159            self
6160        }
6161
6162        /// Sets the value of [page_token][crate::model::ListHubSpokesRequest::page_token].
6163        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6164            self.0.request.page_token = v.into();
6165            self
6166        }
6167
6168        /// Sets the value of [filter][crate::model::ListHubSpokesRequest::filter].
6169        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6170            self.0.request.filter = v.into();
6171            self
6172        }
6173
6174        /// Sets the value of [order_by][crate::model::ListHubSpokesRequest::order_by].
6175        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
6176            self.0.request.order_by = v.into();
6177            self
6178        }
6179
6180        /// Sets the value of [view][crate::model::ListHubSpokesRequest::view].
6181        pub fn set_view<T: Into<crate::model::list_hub_spokes_request::SpokeView>>(
6182            mut self,
6183            v: T,
6184        ) -> Self {
6185            self.0.request.view = v.into();
6186            self
6187        }
6188    }
6189
6190    #[doc(hidden)]
6191    impl crate::RequestBuilder for ListHubSpokes {
6192        fn request_options(&mut self) -> &mut crate::RequestOptions {
6193            &mut self.0.options
6194        }
6195    }
6196
6197    /// The request builder for [HubService::query_hub_status][crate::client::HubService::query_hub_status] calls.
6198    ///
6199    /// # Example
6200    /// ```
6201    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::QueryHubStatus;
6202    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
6203    /// use google_cloud_gax::paginator::ItemPaginator;
6204    ///
6205    /// let builder = prepare_request_builder();
6206    /// let mut items = builder.by_item();
6207    /// while let Some(result) = items.next().await {
6208    ///   let item = result?;
6209    /// }
6210    /// # Ok(()) }
6211    ///
6212    /// fn prepare_request_builder() -> QueryHubStatus {
6213    ///   # panic!();
6214    ///   // ... details omitted ...
6215    /// }
6216    /// ```
6217    #[derive(Clone, Debug)]
6218    pub struct QueryHubStatus(RequestBuilder<crate::model::QueryHubStatusRequest>);
6219
6220    impl QueryHubStatus {
6221        pub(crate) fn new(
6222            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6223        ) -> Self {
6224            Self(RequestBuilder::new(stub))
6225        }
6226
6227        /// Sets the full request, replacing any prior values.
6228        pub fn with_request<V: Into<crate::model::QueryHubStatusRequest>>(mut self, v: V) -> Self {
6229            self.0.request = v.into();
6230            self
6231        }
6232
6233        /// Sets all the options, replacing any prior values.
6234        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6235            self.0.options = v.into();
6236            self
6237        }
6238
6239        /// Sends the request.
6240        pub async fn send(self) -> Result<crate::model::QueryHubStatusResponse> {
6241            (*self.0.stub)
6242                .query_hub_status(self.0.request, self.0.options)
6243                .await
6244                .map(crate::Response::into_body)
6245        }
6246
6247        /// Streams each page in the collection.
6248        pub fn by_page(
6249            self,
6250        ) -> impl google_cloud_gax::paginator::Paginator<
6251            crate::model::QueryHubStatusResponse,
6252            crate::Error,
6253        > {
6254            use std::clone::Clone;
6255            let token = self.0.request.page_token.clone();
6256            let execute = move |token: String| {
6257                let mut builder = self.clone();
6258                builder.0.request = builder.0.request.set_page_token(token);
6259                builder.send()
6260            };
6261            google_cloud_gax::paginator::internal::new_paginator(token, execute)
6262        }
6263
6264        /// Streams each item in the collection.
6265        pub fn by_item(
6266            self,
6267        ) -> impl google_cloud_gax::paginator::ItemPaginator<
6268            crate::model::QueryHubStatusResponse,
6269            crate::Error,
6270        > {
6271            use google_cloud_gax::paginator::Paginator;
6272            self.by_page().items()
6273        }
6274
6275        /// Sets the value of [name][crate::model::QueryHubStatusRequest::name].
6276        ///
6277        /// This is a **required** field for requests.
6278        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6279            self.0.request.name = v.into();
6280            self
6281        }
6282
6283        /// Sets the value of [page_size][crate::model::QueryHubStatusRequest::page_size].
6284        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6285            self.0.request.page_size = v.into();
6286            self
6287        }
6288
6289        /// Sets the value of [page_token][crate::model::QueryHubStatusRequest::page_token].
6290        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6291            self.0.request.page_token = v.into();
6292            self
6293        }
6294
6295        /// Sets the value of [filter][crate::model::QueryHubStatusRequest::filter].
6296        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6297            self.0.request.filter = v.into();
6298            self
6299        }
6300
6301        /// Sets the value of [order_by][crate::model::QueryHubStatusRequest::order_by].
6302        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
6303            self.0.request.order_by = v.into();
6304            self
6305        }
6306
6307        /// Sets the value of [group_by][crate::model::QueryHubStatusRequest::group_by].
6308        pub fn set_group_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
6309            self.0.request.group_by = v.into();
6310            self
6311        }
6312    }
6313
6314    #[doc(hidden)]
6315    impl crate::RequestBuilder for QueryHubStatus {
6316        fn request_options(&mut self) -> &mut crate::RequestOptions {
6317            &mut self.0.options
6318        }
6319    }
6320
6321    /// The request builder for [HubService::list_spokes][crate::client::HubService::list_spokes] calls.
6322    ///
6323    /// # Example
6324    /// ```
6325    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::ListSpokes;
6326    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
6327    /// use google_cloud_gax::paginator::ItemPaginator;
6328    ///
6329    /// let builder = prepare_request_builder();
6330    /// let mut items = builder.by_item();
6331    /// while let Some(result) = items.next().await {
6332    ///   let item = result?;
6333    /// }
6334    /// # Ok(()) }
6335    ///
6336    /// fn prepare_request_builder() -> ListSpokes {
6337    ///   # panic!();
6338    ///   // ... details omitted ...
6339    /// }
6340    /// ```
6341    #[derive(Clone, Debug)]
6342    pub struct ListSpokes(RequestBuilder<crate::model::ListSpokesRequest>);
6343
6344    impl ListSpokes {
6345        pub(crate) fn new(
6346            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6347        ) -> Self {
6348            Self(RequestBuilder::new(stub))
6349        }
6350
6351        /// Sets the full request, replacing any prior values.
6352        pub fn with_request<V: Into<crate::model::ListSpokesRequest>>(mut self, v: V) -> Self {
6353            self.0.request = v.into();
6354            self
6355        }
6356
6357        /// Sets all the options, replacing any prior values.
6358        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6359            self.0.options = v.into();
6360            self
6361        }
6362
6363        /// Sends the request.
6364        pub async fn send(self) -> Result<crate::model::ListSpokesResponse> {
6365            (*self.0.stub)
6366                .list_spokes(self.0.request, self.0.options)
6367                .await
6368                .map(crate::Response::into_body)
6369        }
6370
6371        /// Streams each page in the collection.
6372        pub fn by_page(
6373            self,
6374        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListSpokesResponse, crate::Error>
6375        {
6376            use std::clone::Clone;
6377            let token = self.0.request.page_token.clone();
6378            let execute = move |token: String| {
6379                let mut builder = self.clone();
6380                builder.0.request = builder.0.request.set_page_token(token);
6381                builder.send()
6382            };
6383            google_cloud_gax::paginator::internal::new_paginator(token, execute)
6384        }
6385
6386        /// Streams each item in the collection.
6387        pub fn by_item(
6388            self,
6389        ) -> impl google_cloud_gax::paginator::ItemPaginator<
6390            crate::model::ListSpokesResponse,
6391            crate::Error,
6392        > {
6393            use google_cloud_gax::paginator::Paginator;
6394            self.by_page().items()
6395        }
6396
6397        /// Sets the value of [parent][crate::model::ListSpokesRequest::parent].
6398        ///
6399        /// This is a **required** field for requests.
6400        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6401            self.0.request.parent = v.into();
6402            self
6403        }
6404
6405        /// Sets the value of [page_size][crate::model::ListSpokesRequest::page_size].
6406        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6407            self.0.request.page_size = v.into();
6408            self
6409        }
6410
6411        /// Sets the value of [page_token][crate::model::ListSpokesRequest::page_token].
6412        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6413            self.0.request.page_token = v.into();
6414            self
6415        }
6416
6417        /// Sets the value of [filter][crate::model::ListSpokesRequest::filter].
6418        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6419            self.0.request.filter = v.into();
6420            self
6421        }
6422
6423        /// Sets the value of [order_by][crate::model::ListSpokesRequest::order_by].
6424        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
6425            self.0.request.order_by = v.into();
6426            self
6427        }
6428    }
6429
6430    #[doc(hidden)]
6431    impl crate::RequestBuilder for ListSpokes {
6432        fn request_options(&mut self) -> &mut crate::RequestOptions {
6433            &mut self.0.options
6434        }
6435    }
6436
6437    /// The request builder for [HubService::get_spoke][crate::client::HubService::get_spoke] calls.
6438    ///
6439    /// # Example
6440    /// ```
6441    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::GetSpoke;
6442    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
6443    ///
6444    /// let builder = prepare_request_builder();
6445    /// let response = builder.send().await?;
6446    /// # Ok(()) }
6447    ///
6448    /// fn prepare_request_builder() -> GetSpoke {
6449    ///   # panic!();
6450    ///   // ... details omitted ...
6451    /// }
6452    /// ```
6453    #[derive(Clone, Debug)]
6454    pub struct GetSpoke(RequestBuilder<crate::model::GetSpokeRequest>);
6455
6456    impl GetSpoke {
6457        pub(crate) fn new(
6458            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6459        ) -> Self {
6460            Self(RequestBuilder::new(stub))
6461        }
6462
6463        /// Sets the full request, replacing any prior values.
6464        pub fn with_request<V: Into<crate::model::GetSpokeRequest>>(mut self, v: V) -> Self {
6465            self.0.request = v.into();
6466            self
6467        }
6468
6469        /// Sets all the options, replacing any prior values.
6470        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6471            self.0.options = v.into();
6472            self
6473        }
6474
6475        /// Sends the request.
6476        pub async fn send(self) -> Result<crate::model::Spoke> {
6477            (*self.0.stub)
6478                .get_spoke(self.0.request, self.0.options)
6479                .await
6480                .map(crate::Response::into_body)
6481        }
6482
6483        /// Sets the value of [name][crate::model::GetSpokeRequest::name].
6484        ///
6485        /// This is a **required** field for requests.
6486        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6487            self.0.request.name = v.into();
6488            self
6489        }
6490    }
6491
6492    #[doc(hidden)]
6493    impl crate::RequestBuilder for GetSpoke {
6494        fn request_options(&mut self) -> &mut crate::RequestOptions {
6495            &mut self.0.options
6496        }
6497    }
6498
6499    /// The request builder for [HubService::create_spoke][crate::client::HubService::create_spoke] calls.
6500    ///
6501    /// # Example
6502    /// ```
6503    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::CreateSpoke;
6504    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
6505    /// use google_cloud_lro::Poller;
6506    ///
6507    /// let builder = prepare_request_builder();
6508    /// let response = builder.poller().until_done().await?;
6509    /// # Ok(()) }
6510    ///
6511    /// fn prepare_request_builder() -> CreateSpoke {
6512    ///   # panic!();
6513    ///   // ... details omitted ...
6514    /// }
6515    /// ```
6516    #[derive(Clone, Debug)]
6517    pub struct CreateSpoke(RequestBuilder<crate::model::CreateSpokeRequest>);
6518
6519    impl CreateSpoke {
6520        pub(crate) fn new(
6521            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6522        ) -> Self {
6523            Self(RequestBuilder::new(stub))
6524        }
6525
6526        /// Sets the full request, replacing any prior values.
6527        pub fn with_request<V: Into<crate::model::CreateSpokeRequest>>(mut self, v: V) -> Self {
6528            self.0.request = v.into();
6529            self
6530        }
6531
6532        /// Sets all the options, replacing any prior values.
6533        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6534            self.0.options = v.into();
6535            self
6536        }
6537
6538        /// Sends the request.
6539        ///
6540        /// # Long running operations
6541        ///
6542        /// This starts, but does not poll, a longrunning operation. More information
6543        /// on [create_spoke][crate::client::HubService::create_spoke].
6544        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6545            (*self.0.stub)
6546                .create_spoke(self.0.request, self.0.options)
6547                .await
6548                .map(crate::Response::into_body)
6549        }
6550
6551        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_spoke`.
6552        pub fn poller(
6553            self,
6554        ) -> impl google_cloud_lro::Poller<crate::model::Spoke, crate::model::OperationMetadata>
6555        {
6556            type Operation = google_cloud_lro::internal::Operation<
6557                crate::model::Spoke,
6558                crate::model::OperationMetadata,
6559            >;
6560            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6561            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6562            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
6563            if let Some(ref mut details) = poller_options.tracing {
6564                details.method_name = "google_cloud_networkconnectivity_v1::client::HubService::create_spoke::until_done";
6565            }
6566
6567            let stub = self.0.stub.clone();
6568            let mut options = self.0.options.clone();
6569            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6570            let query = move |name| {
6571                let stub = stub.clone();
6572                let options = options.clone();
6573                async {
6574                    let op = GetOperation::new(stub)
6575                        .set_name(name)
6576                        .with_options(options)
6577                        .send()
6578                        .await?;
6579                    Ok(Operation::new(op))
6580                }
6581            };
6582
6583            let start = move || async {
6584                let op = self.send().await?;
6585                Ok(Operation::new(op))
6586            };
6587
6588            use google_cloud_lro::internal::PollerExt;
6589            {
6590                google_cloud_lro::internal::new_poller(
6591                    polling_error_policy,
6592                    polling_backoff_policy,
6593                    start,
6594                    query,
6595                )
6596            }
6597            .with_options(poller_options)
6598        }
6599
6600        /// Sets the value of [parent][crate::model::CreateSpokeRequest::parent].
6601        ///
6602        /// This is a **required** field for requests.
6603        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6604            self.0.request.parent = v.into();
6605            self
6606        }
6607
6608        /// Sets the value of [spoke_id][crate::model::CreateSpokeRequest::spoke_id].
6609        ///
6610        /// This is a **required** field for requests.
6611        pub fn set_spoke_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6612            self.0.request.spoke_id = v.into();
6613            self
6614        }
6615
6616        /// Sets the value of [spoke][crate::model::CreateSpokeRequest::spoke].
6617        ///
6618        /// This is a **required** field for requests.
6619        pub fn set_spoke<T>(mut self, v: T) -> Self
6620        where
6621            T: std::convert::Into<crate::model::Spoke>,
6622        {
6623            self.0.request.spoke = std::option::Option::Some(v.into());
6624            self
6625        }
6626
6627        /// Sets or clears the value of [spoke][crate::model::CreateSpokeRequest::spoke].
6628        ///
6629        /// This is a **required** field for requests.
6630        pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
6631        where
6632            T: std::convert::Into<crate::model::Spoke>,
6633        {
6634            self.0.request.spoke = v.map(|x| x.into());
6635            self
6636        }
6637
6638        /// Sets the value of [request_id][crate::model::CreateSpokeRequest::request_id].
6639        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6640            self.0.request.request_id = v.into();
6641            self
6642        }
6643    }
6644
6645    #[doc(hidden)]
6646    impl crate::RequestBuilder for CreateSpoke {
6647        fn request_options(&mut self) -> &mut crate::RequestOptions {
6648            &mut self.0.options
6649        }
6650    }
6651
6652    /// The request builder for [HubService::update_spoke][crate::client::HubService::update_spoke] calls.
6653    ///
6654    /// # Example
6655    /// ```
6656    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::UpdateSpoke;
6657    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
6658    /// use google_cloud_lro::Poller;
6659    ///
6660    /// let builder = prepare_request_builder();
6661    /// let response = builder.poller().until_done().await?;
6662    /// # Ok(()) }
6663    ///
6664    /// fn prepare_request_builder() -> UpdateSpoke {
6665    ///   # panic!();
6666    ///   // ... details omitted ...
6667    /// }
6668    /// ```
6669    #[derive(Clone, Debug)]
6670    pub struct UpdateSpoke(RequestBuilder<crate::model::UpdateSpokeRequest>);
6671
6672    impl UpdateSpoke {
6673        pub(crate) fn new(
6674            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6675        ) -> Self {
6676            Self(RequestBuilder::new(stub))
6677        }
6678
6679        /// Sets the full request, replacing any prior values.
6680        pub fn with_request<V: Into<crate::model::UpdateSpokeRequest>>(mut self, v: V) -> Self {
6681            self.0.request = v.into();
6682            self
6683        }
6684
6685        /// Sets all the options, replacing any prior values.
6686        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6687            self.0.options = v.into();
6688            self
6689        }
6690
6691        /// Sends the request.
6692        ///
6693        /// # Long running operations
6694        ///
6695        /// This starts, but does not poll, a longrunning operation. More information
6696        /// on [update_spoke][crate::client::HubService::update_spoke].
6697        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6698            (*self.0.stub)
6699                .update_spoke(self.0.request, self.0.options)
6700                .await
6701                .map(crate::Response::into_body)
6702        }
6703
6704        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_spoke`.
6705        pub fn poller(
6706            self,
6707        ) -> impl google_cloud_lro::Poller<crate::model::Spoke, crate::model::OperationMetadata>
6708        {
6709            type Operation = google_cloud_lro::internal::Operation<
6710                crate::model::Spoke,
6711                crate::model::OperationMetadata,
6712            >;
6713            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6714            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6715            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
6716            if let Some(ref mut details) = poller_options.tracing {
6717                details.method_name = "google_cloud_networkconnectivity_v1::client::HubService::update_spoke::until_done";
6718            }
6719
6720            let stub = self.0.stub.clone();
6721            let mut options = self.0.options.clone();
6722            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6723            let query = move |name| {
6724                let stub = stub.clone();
6725                let options = options.clone();
6726                async {
6727                    let op = GetOperation::new(stub)
6728                        .set_name(name)
6729                        .with_options(options)
6730                        .send()
6731                        .await?;
6732                    Ok(Operation::new(op))
6733                }
6734            };
6735
6736            let start = move || async {
6737                let op = self.send().await?;
6738                Ok(Operation::new(op))
6739            };
6740
6741            use google_cloud_lro::internal::PollerExt;
6742            {
6743                google_cloud_lro::internal::new_poller(
6744                    polling_error_policy,
6745                    polling_backoff_policy,
6746                    start,
6747                    query,
6748                )
6749            }
6750            .with_options(poller_options)
6751        }
6752
6753        /// Sets the value of [update_mask][crate::model::UpdateSpokeRequest::update_mask].
6754        pub fn set_update_mask<T>(mut self, v: T) -> Self
6755        where
6756            T: std::convert::Into<wkt::FieldMask>,
6757        {
6758            self.0.request.update_mask = std::option::Option::Some(v.into());
6759            self
6760        }
6761
6762        /// Sets or clears the value of [update_mask][crate::model::UpdateSpokeRequest::update_mask].
6763        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6764        where
6765            T: std::convert::Into<wkt::FieldMask>,
6766        {
6767            self.0.request.update_mask = v.map(|x| x.into());
6768            self
6769        }
6770
6771        /// Sets the value of [spoke][crate::model::UpdateSpokeRequest::spoke].
6772        ///
6773        /// This is a **required** field for requests.
6774        pub fn set_spoke<T>(mut self, v: T) -> Self
6775        where
6776            T: std::convert::Into<crate::model::Spoke>,
6777        {
6778            self.0.request.spoke = std::option::Option::Some(v.into());
6779            self
6780        }
6781
6782        /// Sets or clears the value of [spoke][crate::model::UpdateSpokeRequest::spoke].
6783        ///
6784        /// This is a **required** field for requests.
6785        pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
6786        where
6787            T: std::convert::Into<crate::model::Spoke>,
6788        {
6789            self.0.request.spoke = v.map(|x| x.into());
6790            self
6791        }
6792
6793        /// Sets the value of [request_id][crate::model::UpdateSpokeRequest::request_id].
6794        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6795            self.0.request.request_id = v.into();
6796            self
6797        }
6798    }
6799
6800    #[doc(hidden)]
6801    impl crate::RequestBuilder for UpdateSpoke {
6802        fn request_options(&mut self) -> &mut crate::RequestOptions {
6803            &mut self.0.options
6804        }
6805    }
6806
6807    /// The request builder for [HubService::reject_hub_spoke][crate::client::HubService::reject_hub_spoke] calls.
6808    ///
6809    /// # Example
6810    /// ```
6811    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::RejectHubSpoke;
6812    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
6813    /// use google_cloud_lro::Poller;
6814    ///
6815    /// let builder = prepare_request_builder();
6816    /// let response = builder.poller().until_done().await?;
6817    /// # Ok(()) }
6818    ///
6819    /// fn prepare_request_builder() -> RejectHubSpoke {
6820    ///   # panic!();
6821    ///   // ... details omitted ...
6822    /// }
6823    /// ```
6824    #[derive(Clone, Debug)]
6825    pub struct RejectHubSpoke(RequestBuilder<crate::model::RejectHubSpokeRequest>);
6826
6827    impl RejectHubSpoke {
6828        pub(crate) fn new(
6829            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6830        ) -> Self {
6831            Self(RequestBuilder::new(stub))
6832        }
6833
6834        /// Sets the full request, replacing any prior values.
6835        pub fn with_request<V: Into<crate::model::RejectHubSpokeRequest>>(mut self, v: V) -> Self {
6836            self.0.request = v.into();
6837            self
6838        }
6839
6840        /// Sets all the options, replacing any prior values.
6841        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6842            self.0.options = v.into();
6843            self
6844        }
6845
6846        /// Sends the request.
6847        ///
6848        /// # Long running operations
6849        ///
6850        /// This starts, but does not poll, a longrunning operation. More information
6851        /// on [reject_hub_spoke][crate::client::HubService::reject_hub_spoke].
6852        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6853            (*self.0.stub)
6854                .reject_hub_spoke(self.0.request, self.0.options)
6855                .await
6856                .map(crate::Response::into_body)
6857        }
6858
6859        /// Creates a [Poller][google_cloud_lro::Poller] to work with `reject_hub_spoke`.
6860        pub fn poller(
6861            self,
6862        ) -> impl google_cloud_lro::Poller<
6863            crate::model::RejectHubSpokeResponse,
6864            crate::model::OperationMetadata,
6865        > {
6866            type Operation = google_cloud_lro::internal::Operation<
6867                crate::model::RejectHubSpokeResponse,
6868                crate::model::OperationMetadata,
6869            >;
6870            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6871            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6872            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
6873            if let Some(ref mut details) = poller_options.tracing {
6874                details.method_name = "google_cloud_networkconnectivity_v1::client::HubService::reject_hub_spoke::until_done";
6875            }
6876
6877            let stub = self.0.stub.clone();
6878            let mut options = self.0.options.clone();
6879            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6880            let query = move |name| {
6881                let stub = stub.clone();
6882                let options = options.clone();
6883                async {
6884                    let op = GetOperation::new(stub)
6885                        .set_name(name)
6886                        .with_options(options)
6887                        .send()
6888                        .await?;
6889                    Ok(Operation::new(op))
6890                }
6891            };
6892
6893            let start = move || async {
6894                let op = self.send().await?;
6895                Ok(Operation::new(op))
6896            };
6897
6898            use google_cloud_lro::internal::PollerExt;
6899            {
6900                google_cloud_lro::internal::new_poller(
6901                    polling_error_policy,
6902                    polling_backoff_policy,
6903                    start,
6904                    query,
6905                )
6906            }
6907            .with_options(poller_options)
6908        }
6909
6910        /// Sets the value of [name][crate::model::RejectHubSpokeRequest::name].
6911        ///
6912        /// This is a **required** field for requests.
6913        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6914            self.0.request.name = v.into();
6915            self
6916        }
6917
6918        /// Sets the value of [spoke_uri][crate::model::RejectHubSpokeRequest::spoke_uri].
6919        ///
6920        /// This is a **required** field for requests.
6921        pub fn set_spoke_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
6922            self.0.request.spoke_uri = v.into();
6923            self
6924        }
6925
6926        /// Sets the value of [request_id][crate::model::RejectHubSpokeRequest::request_id].
6927        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6928            self.0.request.request_id = v.into();
6929            self
6930        }
6931
6932        /// Sets the value of [details][crate::model::RejectHubSpokeRequest::details].
6933        pub fn set_details<T: Into<std::string::String>>(mut self, v: T) -> Self {
6934            self.0.request.details = v.into();
6935            self
6936        }
6937    }
6938
6939    #[doc(hidden)]
6940    impl crate::RequestBuilder for RejectHubSpoke {
6941        fn request_options(&mut self) -> &mut crate::RequestOptions {
6942            &mut self.0.options
6943        }
6944    }
6945
6946    /// The request builder for [HubService::accept_hub_spoke][crate::client::HubService::accept_hub_spoke] calls.
6947    ///
6948    /// # Example
6949    /// ```
6950    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::AcceptHubSpoke;
6951    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
6952    /// use google_cloud_lro::Poller;
6953    ///
6954    /// let builder = prepare_request_builder();
6955    /// let response = builder.poller().until_done().await?;
6956    /// # Ok(()) }
6957    ///
6958    /// fn prepare_request_builder() -> AcceptHubSpoke {
6959    ///   # panic!();
6960    ///   // ... details omitted ...
6961    /// }
6962    /// ```
6963    #[derive(Clone, Debug)]
6964    pub struct AcceptHubSpoke(RequestBuilder<crate::model::AcceptHubSpokeRequest>);
6965
6966    impl AcceptHubSpoke {
6967        pub(crate) fn new(
6968            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6969        ) -> Self {
6970            Self(RequestBuilder::new(stub))
6971        }
6972
6973        /// Sets the full request, replacing any prior values.
6974        pub fn with_request<V: Into<crate::model::AcceptHubSpokeRequest>>(mut self, v: V) -> Self {
6975            self.0.request = v.into();
6976            self
6977        }
6978
6979        /// Sets all the options, replacing any prior values.
6980        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6981            self.0.options = v.into();
6982            self
6983        }
6984
6985        /// Sends the request.
6986        ///
6987        /// # Long running operations
6988        ///
6989        /// This starts, but does not poll, a longrunning operation. More information
6990        /// on [accept_hub_spoke][crate::client::HubService::accept_hub_spoke].
6991        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6992            (*self.0.stub)
6993                .accept_hub_spoke(self.0.request, self.0.options)
6994                .await
6995                .map(crate::Response::into_body)
6996        }
6997
6998        /// Creates a [Poller][google_cloud_lro::Poller] to work with `accept_hub_spoke`.
6999        pub fn poller(
7000            self,
7001        ) -> impl google_cloud_lro::Poller<
7002            crate::model::AcceptHubSpokeResponse,
7003            crate::model::OperationMetadata,
7004        > {
7005            type Operation = google_cloud_lro::internal::Operation<
7006                crate::model::AcceptHubSpokeResponse,
7007                crate::model::OperationMetadata,
7008            >;
7009            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7010            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7011            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
7012            if let Some(ref mut details) = poller_options.tracing {
7013                details.method_name = "google_cloud_networkconnectivity_v1::client::HubService::accept_hub_spoke::until_done";
7014            }
7015
7016            let stub = self.0.stub.clone();
7017            let mut options = self.0.options.clone();
7018            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
7019            let query = move |name| {
7020                let stub = stub.clone();
7021                let options = options.clone();
7022                async {
7023                    let op = GetOperation::new(stub)
7024                        .set_name(name)
7025                        .with_options(options)
7026                        .send()
7027                        .await?;
7028                    Ok(Operation::new(op))
7029                }
7030            };
7031
7032            let start = move || async {
7033                let op = self.send().await?;
7034                Ok(Operation::new(op))
7035            };
7036
7037            use google_cloud_lro::internal::PollerExt;
7038            {
7039                google_cloud_lro::internal::new_poller(
7040                    polling_error_policy,
7041                    polling_backoff_policy,
7042                    start,
7043                    query,
7044                )
7045            }
7046            .with_options(poller_options)
7047        }
7048
7049        /// Sets the value of [name][crate::model::AcceptHubSpokeRequest::name].
7050        ///
7051        /// This is a **required** field for requests.
7052        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7053            self.0.request.name = v.into();
7054            self
7055        }
7056
7057        /// Sets the value of [spoke_uri][crate::model::AcceptHubSpokeRequest::spoke_uri].
7058        ///
7059        /// This is a **required** field for requests.
7060        pub fn set_spoke_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
7061            self.0.request.spoke_uri = v.into();
7062            self
7063        }
7064
7065        /// Sets the value of [request_id][crate::model::AcceptHubSpokeRequest::request_id].
7066        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
7067            self.0.request.request_id = v.into();
7068            self
7069        }
7070    }
7071
7072    #[doc(hidden)]
7073    impl crate::RequestBuilder for AcceptHubSpoke {
7074        fn request_options(&mut self) -> &mut crate::RequestOptions {
7075            &mut self.0.options
7076        }
7077    }
7078
7079    /// The request builder for [HubService::accept_spoke_update][crate::client::HubService::accept_spoke_update] calls.
7080    ///
7081    /// # Example
7082    /// ```
7083    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::AcceptSpokeUpdate;
7084    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
7085    /// use google_cloud_lro::Poller;
7086    ///
7087    /// let builder = prepare_request_builder();
7088    /// let response = builder.poller().until_done().await?;
7089    /// # Ok(()) }
7090    ///
7091    /// fn prepare_request_builder() -> AcceptSpokeUpdate {
7092    ///   # panic!();
7093    ///   // ... details omitted ...
7094    /// }
7095    /// ```
7096    #[derive(Clone, Debug)]
7097    pub struct AcceptSpokeUpdate(RequestBuilder<crate::model::AcceptSpokeUpdateRequest>);
7098
7099    impl AcceptSpokeUpdate {
7100        pub(crate) fn new(
7101            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7102        ) -> Self {
7103            Self(RequestBuilder::new(stub))
7104        }
7105
7106        /// Sets the full request, replacing any prior values.
7107        pub fn with_request<V: Into<crate::model::AcceptSpokeUpdateRequest>>(
7108            mut self,
7109            v: V,
7110        ) -> Self {
7111            self.0.request = v.into();
7112            self
7113        }
7114
7115        /// Sets all the options, replacing any prior values.
7116        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7117            self.0.options = v.into();
7118            self
7119        }
7120
7121        /// Sends the request.
7122        ///
7123        /// # Long running operations
7124        ///
7125        /// This starts, but does not poll, a longrunning operation. More information
7126        /// on [accept_spoke_update][crate::client::HubService::accept_spoke_update].
7127        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7128            (*self.0.stub)
7129                .accept_spoke_update(self.0.request, self.0.options)
7130                .await
7131                .map(crate::Response::into_body)
7132        }
7133
7134        /// Creates a [Poller][google_cloud_lro::Poller] to work with `accept_spoke_update`.
7135        pub fn poller(
7136            self,
7137        ) -> impl google_cloud_lro::Poller<
7138            crate::model::AcceptSpokeUpdateResponse,
7139            crate::model::OperationMetadata,
7140        > {
7141            type Operation = google_cloud_lro::internal::Operation<
7142                crate::model::AcceptSpokeUpdateResponse,
7143                crate::model::OperationMetadata,
7144            >;
7145            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7146            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7147            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
7148            if let Some(ref mut details) = poller_options.tracing {
7149                details.method_name = "google_cloud_networkconnectivity_v1::client::HubService::accept_spoke_update::until_done";
7150            }
7151
7152            let stub = self.0.stub.clone();
7153            let mut options = self.0.options.clone();
7154            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
7155            let query = move |name| {
7156                let stub = stub.clone();
7157                let options = options.clone();
7158                async {
7159                    let op = GetOperation::new(stub)
7160                        .set_name(name)
7161                        .with_options(options)
7162                        .send()
7163                        .await?;
7164                    Ok(Operation::new(op))
7165                }
7166            };
7167
7168            let start = move || async {
7169                let op = self.send().await?;
7170                Ok(Operation::new(op))
7171            };
7172
7173            use google_cloud_lro::internal::PollerExt;
7174            {
7175                google_cloud_lro::internal::new_poller(
7176                    polling_error_policy,
7177                    polling_backoff_policy,
7178                    start,
7179                    query,
7180                )
7181            }
7182            .with_options(poller_options)
7183        }
7184
7185        /// Sets the value of [name][crate::model::AcceptSpokeUpdateRequest::name].
7186        ///
7187        /// This is a **required** field for requests.
7188        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7189            self.0.request.name = v.into();
7190            self
7191        }
7192
7193        /// Sets the value of [spoke_uri][crate::model::AcceptSpokeUpdateRequest::spoke_uri].
7194        ///
7195        /// This is a **required** field for requests.
7196        pub fn set_spoke_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
7197            self.0.request.spoke_uri = v.into();
7198            self
7199        }
7200
7201        /// Sets the value of [spoke_etag][crate::model::AcceptSpokeUpdateRequest::spoke_etag].
7202        ///
7203        /// This is a **required** field for requests.
7204        pub fn set_spoke_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
7205            self.0.request.spoke_etag = v.into();
7206            self
7207        }
7208
7209        /// Sets the value of [request_id][crate::model::AcceptSpokeUpdateRequest::request_id].
7210        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
7211            self.0.request.request_id = v.into();
7212            self
7213        }
7214    }
7215
7216    #[doc(hidden)]
7217    impl crate::RequestBuilder for AcceptSpokeUpdate {
7218        fn request_options(&mut self) -> &mut crate::RequestOptions {
7219            &mut self.0.options
7220        }
7221    }
7222
7223    /// The request builder for [HubService::reject_spoke_update][crate::client::HubService::reject_spoke_update] calls.
7224    ///
7225    /// # Example
7226    /// ```
7227    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::RejectSpokeUpdate;
7228    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
7229    /// use google_cloud_lro::Poller;
7230    ///
7231    /// let builder = prepare_request_builder();
7232    /// let response = builder.poller().until_done().await?;
7233    /// # Ok(()) }
7234    ///
7235    /// fn prepare_request_builder() -> RejectSpokeUpdate {
7236    ///   # panic!();
7237    ///   // ... details omitted ...
7238    /// }
7239    /// ```
7240    #[derive(Clone, Debug)]
7241    pub struct RejectSpokeUpdate(RequestBuilder<crate::model::RejectSpokeUpdateRequest>);
7242
7243    impl RejectSpokeUpdate {
7244        pub(crate) fn new(
7245            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7246        ) -> Self {
7247            Self(RequestBuilder::new(stub))
7248        }
7249
7250        /// Sets the full request, replacing any prior values.
7251        pub fn with_request<V: Into<crate::model::RejectSpokeUpdateRequest>>(
7252            mut self,
7253            v: V,
7254        ) -> Self {
7255            self.0.request = v.into();
7256            self
7257        }
7258
7259        /// Sets all the options, replacing any prior values.
7260        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7261            self.0.options = v.into();
7262            self
7263        }
7264
7265        /// Sends the request.
7266        ///
7267        /// # Long running operations
7268        ///
7269        /// This starts, but does not poll, a longrunning operation. More information
7270        /// on [reject_spoke_update][crate::client::HubService::reject_spoke_update].
7271        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7272            (*self.0.stub)
7273                .reject_spoke_update(self.0.request, self.0.options)
7274                .await
7275                .map(crate::Response::into_body)
7276        }
7277
7278        /// Creates a [Poller][google_cloud_lro::Poller] to work with `reject_spoke_update`.
7279        pub fn poller(
7280            self,
7281        ) -> impl google_cloud_lro::Poller<
7282            crate::model::RejectSpokeUpdateResponse,
7283            crate::model::OperationMetadata,
7284        > {
7285            type Operation = google_cloud_lro::internal::Operation<
7286                crate::model::RejectSpokeUpdateResponse,
7287                crate::model::OperationMetadata,
7288            >;
7289            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7290            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7291            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
7292            if let Some(ref mut details) = poller_options.tracing {
7293                details.method_name = "google_cloud_networkconnectivity_v1::client::HubService::reject_spoke_update::until_done";
7294            }
7295
7296            let stub = self.0.stub.clone();
7297            let mut options = self.0.options.clone();
7298            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
7299            let query = move |name| {
7300                let stub = stub.clone();
7301                let options = options.clone();
7302                async {
7303                    let op = GetOperation::new(stub)
7304                        .set_name(name)
7305                        .with_options(options)
7306                        .send()
7307                        .await?;
7308                    Ok(Operation::new(op))
7309                }
7310            };
7311
7312            let start = move || async {
7313                let op = self.send().await?;
7314                Ok(Operation::new(op))
7315            };
7316
7317            use google_cloud_lro::internal::PollerExt;
7318            {
7319                google_cloud_lro::internal::new_poller(
7320                    polling_error_policy,
7321                    polling_backoff_policy,
7322                    start,
7323                    query,
7324                )
7325            }
7326            .with_options(poller_options)
7327        }
7328
7329        /// Sets the value of [name][crate::model::RejectSpokeUpdateRequest::name].
7330        ///
7331        /// This is a **required** field for requests.
7332        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7333            self.0.request.name = v.into();
7334            self
7335        }
7336
7337        /// Sets the value of [spoke_uri][crate::model::RejectSpokeUpdateRequest::spoke_uri].
7338        ///
7339        /// This is a **required** field for requests.
7340        pub fn set_spoke_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
7341            self.0.request.spoke_uri = v.into();
7342            self
7343        }
7344
7345        /// Sets the value of [spoke_etag][crate::model::RejectSpokeUpdateRequest::spoke_etag].
7346        ///
7347        /// This is a **required** field for requests.
7348        pub fn set_spoke_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
7349            self.0.request.spoke_etag = v.into();
7350            self
7351        }
7352
7353        /// Sets the value of [details][crate::model::RejectSpokeUpdateRequest::details].
7354        pub fn set_details<T: Into<std::string::String>>(mut self, v: T) -> Self {
7355            self.0.request.details = v.into();
7356            self
7357        }
7358
7359        /// Sets the value of [request_id][crate::model::RejectSpokeUpdateRequest::request_id].
7360        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
7361            self.0.request.request_id = v.into();
7362            self
7363        }
7364    }
7365
7366    #[doc(hidden)]
7367    impl crate::RequestBuilder for RejectSpokeUpdate {
7368        fn request_options(&mut self) -> &mut crate::RequestOptions {
7369            &mut self.0.options
7370        }
7371    }
7372
7373    /// The request builder for [HubService::delete_spoke][crate::client::HubService::delete_spoke] calls.
7374    ///
7375    /// # Example
7376    /// ```
7377    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::DeleteSpoke;
7378    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
7379    /// use google_cloud_lro::Poller;
7380    ///
7381    /// let builder = prepare_request_builder();
7382    /// let response = builder.poller().until_done().await?;
7383    /// # Ok(()) }
7384    ///
7385    /// fn prepare_request_builder() -> DeleteSpoke {
7386    ///   # panic!();
7387    ///   // ... details omitted ...
7388    /// }
7389    /// ```
7390    #[derive(Clone, Debug)]
7391    pub struct DeleteSpoke(RequestBuilder<crate::model::DeleteSpokeRequest>);
7392
7393    impl DeleteSpoke {
7394        pub(crate) fn new(
7395            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7396        ) -> Self {
7397            Self(RequestBuilder::new(stub))
7398        }
7399
7400        /// Sets the full request, replacing any prior values.
7401        pub fn with_request<V: Into<crate::model::DeleteSpokeRequest>>(mut self, v: V) -> Self {
7402            self.0.request = v.into();
7403            self
7404        }
7405
7406        /// Sets all the options, replacing any prior values.
7407        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7408            self.0.options = v.into();
7409            self
7410        }
7411
7412        /// Sends the request.
7413        ///
7414        /// # Long running operations
7415        ///
7416        /// This starts, but does not poll, a longrunning operation. More information
7417        /// on [delete_spoke][crate::client::HubService::delete_spoke].
7418        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7419            (*self.0.stub)
7420                .delete_spoke(self.0.request, self.0.options)
7421                .await
7422                .map(crate::Response::into_body)
7423        }
7424
7425        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_spoke`.
7426        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
7427            type Operation =
7428                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
7429            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7430            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7431            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
7432            if let Some(ref mut details) = poller_options.tracing {
7433                details.method_name = "google_cloud_networkconnectivity_v1::client::HubService::delete_spoke::until_done";
7434            }
7435
7436            let stub = self.0.stub.clone();
7437            let mut options = self.0.options.clone();
7438            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
7439            let query = move |name| {
7440                let stub = stub.clone();
7441                let options = options.clone();
7442                async {
7443                    let op = GetOperation::new(stub)
7444                        .set_name(name)
7445                        .with_options(options)
7446                        .send()
7447                        .await?;
7448                    Ok(Operation::new(op))
7449                }
7450            };
7451
7452            let start = move || async {
7453                let op = self.send().await?;
7454                Ok(Operation::new(op))
7455            };
7456
7457            use google_cloud_lro::internal::PollerExt;
7458            {
7459                google_cloud_lro::internal::new_unit_response_poller(
7460                    polling_error_policy,
7461                    polling_backoff_policy,
7462                    start,
7463                    query,
7464                )
7465            }
7466            .with_options(poller_options)
7467        }
7468
7469        /// Sets the value of [name][crate::model::DeleteSpokeRequest::name].
7470        ///
7471        /// This is a **required** field for requests.
7472        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7473            self.0.request.name = v.into();
7474            self
7475        }
7476
7477        /// Sets the value of [request_id][crate::model::DeleteSpokeRequest::request_id].
7478        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
7479            self.0.request.request_id = v.into();
7480            self
7481        }
7482    }
7483
7484    #[doc(hidden)]
7485    impl crate::RequestBuilder for DeleteSpoke {
7486        fn request_options(&mut self) -> &mut crate::RequestOptions {
7487            &mut self.0.options
7488        }
7489    }
7490
7491    /// The request builder for [HubService::get_route_table][crate::client::HubService::get_route_table] calls.
7492    ///
7493    /// # Example
7494    /// ```
7495    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::GetRouteTable;
7496    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
7497    ///
7498    /// let builder = prepare_request_builder();
7499    /// let response = builder.send().await?;
7500    /// # Ok(()) }
7501    ///
7502    /// fn prepare_request_builder() -> GetRouteTable {
7503    ///   # panic!();
7504    ///   // ... details omitted ...
7505    /// }
7506    /// ```
7507    #[derive(Clone, Debug)]
7508    pub struct GetRouteTable(RequestBuilder<crate::model::GetRouteTableRequest>);
7509
7510    impl GetRouteTable {
7511        pub(crate) fn new(
7512            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7513        ) -> Self {
7514            Self(RequestBuilder::new(stub))
7515        }
7516
7517        /// Sets the full request, replacing any prior values.
7518        pub fn with_request<V: Into<crate::model::GetRouteTableRequest>>(mut self, v: V) -> Self {
7519            self.0.request = v.into();
7520            self
7521        }
7522
7523        /// Sets all the options, replacing any prior values.
7524        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7525            self.0.options = v.into();
7526            self
7527        }
7528
7529        /// Sends the request.
7530        pub async fn send(self) -> Result<crate::model::RouteTable> {
7531            (*self.0.stub)
7532                .get_route_table(self.0.request, self.0.options)
7533                .await
7534                .map(crate::Response::into_body)
7535        }
7536
7537        /// Sets the value of [name][crate::model::GetRouteTableRequest::name].
7538        ///
7539        /// This is a **required** field for requests.
7540        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7541            self.0.request.name = v.into();
7542            self
7543        }
7544    }
7545
7546    #[doc(hidden)]
7547    impl crate::RequestBuilder for GetRouteTable {
7548        fn request_options(&mut self) -> &mut crate::RequestOptions {
7549            &mut self.0.options
7550        }
7551    }
7552
7553    /// The request builder for [HubService::get_route][crate::client::HubService::get_route] calls.
7554    ///
7555    /// # Example
7556    /// ```
7557    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::GetRoute;
7558    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
7559    ///
7560    /// let builder = prepare_request_builder();
7561    /// let response = builder.send().await?;
7562    /// # Ok(()) }
7563    ///
7564    /// fn prepare_request_builder() -> GetRoute {
7565    ///   # panic!();
7566    ///   // ... details omitted ...
7567    /// }
7568    /// ```
7569    #[derive(Clone, Debug)]
7570    pub struct GetRoute(RequestBuilder<crate::model::GetRouteRequest>);
7571
7572    impl GetRoute {
7573        pub(crate) fn new(
7574            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7575        ) -> Self {
7576            Self(RequestBuilder::new(stub))
7577        }
7578
7579        /// Sets the full request, replacing any prior values.
7580        pub fn with_request<V: Into<crate::model::GetRouteRequest>>(mut self, v: V) -> Self {
7581            self.0.request = v.into();
7582            self
7583        }
7584
7585        /// Sets all the options, replacing any prior values.
7586        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7587            self.0.options = v.into();
7588            self
7589        }
7590
7591        /// Sends the request.
7592        pub async fn send(self) -> Result<crate::model::Route> {
7593            (*self.0.stub)
7594                .get_route(self.0.request, self.0.options)
7595                .await
7596                .map(crate::Response::into_body)
7597        }
7598
7599        /// Sets the value of [name][crate::model::GetRouteRequest::name].
7600        ///
7601        /// This is a **required** field for requests.
7602        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7603            self.0.request.name = v.into();
7604            self
7605        }
7606    }
7607
7608    #[doc(hidden)]
7609    impl crate::RequestBuilder for GetRoute {
7610        fn request_options(&mut self) -> &mut crate::RequestOptions {
7611            &mut self.0.options
7612        }
7613    }
7614
7615    /// The request builder for [HubService::list_routes][crate::client::HubService::list_routes] calls.
7616    ///
7617    /// # Example
7618    /// ```
7619    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::ListRoutes;
7620    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
7621    /// use google_cloud_gax::paginator::ItemPaginator;
7622    ///
7623    /// let builder = prepare_request_builder();
7624    /// let mut items = builder.by_item();
7625    /// while let Some(result) = items.next().await {
7626    ///   let item = result?;
7627    /// }
7628    /// # Ok(()) }
7629    ///
7630    /// fn prepare_request_builder() -> ListRoutes {
7631    ///   # panic!();
7632    ///   // ... details omitted ...
7633    /// }
7634    /// ```
7635    #[derive(Clone, Debug)]
7636    pub struct ListRoutes(RequestBuilder<crate::model::ListRoutesRequest>);
7637
7638    impl ListRoutes {
7639        pub(crate) fn new(
7640            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7641        ) -> Self {
7642            Self(RequestBuilder::new(stub))
7643        }
7644
7645        /// Sets the full request, replacing any prior values.
7646        pub fn with_request<V: Into<crate::model::ListRoutesRequest>>(mut self, v: V) -> Self {
7647            self.0.request = v.into();
7648            self
7649        }
7650
7651        /// Sets all the options, replacing any prior values.
7652        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7653            self.0.options = v.into();
7654            self
7655        }
7656
7657        /// Sends the request.
7658        pub async fn send(self) -> Result<crate::model::ListRoutesResponse> {
7659            (*self.0.stub)
7660                .list_routes(self.0.request, self.0.options)
7661                .await
7662                .map(crate::Response::into_body)
7663        }
7664
7665        /// Streams each page in the collection.
7666        pub fn by_page(
7667            self,
7668        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListRoutesResponse, crate::Error>
7669        {
7670            use std::clone::Clone;
7671            let token = self.0.request.page_token.clone();
7672            let execute = move |token: String| {
7673                let mut builder = self.clone();
7674                builder.0.request = builder.0.request.set_page_token(token);
7675                builder.send()
7676            };
7677            google_cloud_gax::paginator::internal::new_paginator(token, execute)
7678        }
7679
7680        /// Streams each item in the collection.
7681        pub fn by_item(
7682            self,
7683        ) -> impl google_cloud_gax::paginator::ItemPaginator<
7684            crate::model::ListRoutesResponse,
7685            crate::Error,
7686        > {
7687            use google_cloud_gax::paginator::Paginator;
7688            self.by_page().items()
7689        }
7690
7691        /// Sets the value of [parent][crate::model::ListRoutesRequest::parent].
7692        ///
7693        /// This is a **required** field for requests.
7694        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7695            self.0.request.parent = v.into();
7696            self
7697        }
7698
7699        /// Sets the value of [page_size][crate::model::ListRoutesRequest::page_size].
7700        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7701            self.0.request.page_size = v.into();
7702            self
7703        }
7704
7705        /// Sets the value of [page_token][crate::model::ListRoutesRequest::page_token].
7706        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7707            self.0.request.page_token = v.into();
7708            self
7709        }
7710
7711        /// Sets the value of [filter][crate::model::ListRoutesRequest::filter].
7712        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7713            self.0.request.filter = v.into();
7714            self
7715        }
7716
7717        /// Sets the value of [order_by][crate::model::ListRoutesRequest::order_by].
7718        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
7719            self.0.request.order_by = v.into();
7720            self
7721        }
7722    }
7723
7724    #[doc(hidden)]
7725    impl crate::RequestBuilder for ListRoutes {
7726        fn request_options(&mut self) -> &mut crate::RequestOptions {
7727            &mut self.0.options
7728        }
7729    }
7730
7731    /// The request builder for [HubService::list_route_tables][crate::client::HubService::list_route_tables] calls.
7732    ///
7733    /// # Example
7734    /// ```
7735    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::ListRouteTables;
7736    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
7737    /// use google_cloud_gax::paginator::ItemPaginator;
7738    ///
7739    /// let builder = prepare_request_builder();
7740    /// let mut items = builder.by_item();
7741    /// while let Some(result) = items.next().await {
7742    ///   let item = result?;
7743    /// }
7744    /// # Ok(()) }
7745    ///
7746    /// fn prepare_request_builder() -> ListRouteTables {
7747    ///   # panic!();
7748    ///   // ... details omitted ...
7749    /// }
7750    /// ```
7751    #[derive(Clone, Debug)]
7752    pub struct ListRouteTables(RequestBuilder<crate::model::ListRouteTablesRequest>);
7753
7754    impl ListRouteTables {
7755        pub(crate) fn new(
7756            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7757        ) -> Self {
7758            Self(RequestBuilder::new(stub))
7759        }
7760
7761        /// Sets the full request, replacing any prior values.
7762        pub fn with_request<V: Into<crate::model::ListRouteTablesRequest>>(mut self, v: V) -> Self {
7763            self.0.request = v.into();
7764            self
7765        }
7766
7767        /// Sets all the options, replacing any prior values.
7768        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7769            self.0.options = v.into();
7770            self
7771        }
7772
7773        /// Sends the request.
7774        pub async fn send(self) -> Result<crate::model::ListRouteTablesResponse> {
7775            (*self.0.stub)
7776                .list_route_tables(self.0.request, self.0.options)
7777                .await
7778                .map(crate::Response::into_body)
7779        }
7780
7781        /// Streams each page in the collection.
7782        pub fn by_page(
7783            self,
7784        ) -> impl google_cloud_gax::paginator::Paginator<
7785            crate::model::ListRouteTablesResponse,
7786            crate::Error,
7787        > {
7788            use std::clone::Clone;
7789            let token = self.0.request.page_token.clone();
7790            let execute = move |token: String| {
7791                let mut builder = self.clone();
7792                builder.0.request = builder.0.request.set_page_token(token);
7793                builder.send()
7794            };
7795            google_cloud_gax::paginator::internal::new_paginator(token, execute)
7796        }
7797
7798        /// Streams each item in the collection.
7799        pub fn by_item(
7800            self,
7801        ) -> impl google_cloud_gax::paginator::ItemPaginator<
7802            crate::model::ListRouteTablesResponse,
7803            crate::Error,
7804        > {
7805            use google_cloud_gax::paginator::Paginator;
7806            self.by_page().items()
7807        }
7808
7809        /// Sets the value of [parent][crate::model::ListRouteTablesRequest::parent].
7810        ///
7811        /// This is a **required** field for requests.
7812        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7813            self.0.request.parent = v.into();
7814            self
7815        }
7816
7817        /// Sets the value of [page_size][crate::model::ListRouteTablesRequest::page_size].
7818        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7819            self.0.request.page_size = v.into();
7820            self
7821        }
7822
7823        /// Sets the value of [page_token][crate::model::ListRouteTablesRequest::page_token].
7824        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7825            self.0.request.page_token = v.into();
7826            self
7827        }
7828
7829        /// Sets the value of [filter][crate::model::ListRouteTablesRequest::filter].
7830        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7831            self.0.request.filter = v.into();
7832            self
7833        }
7834
7835        /// Sets the value of [order_by][crate::model::ListRouteTablesRequest::order_by].
7836        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
7837            self.0.request.order_by = v.into();
7838            self
7839        }
7840    }
7841
7842    #[doc(hidden)]
7843    impl crate::RequestBuilder for ListRouteTables {
7844        fn request_options(&mut self) -> &mut crate::RequestOptions {
7845            &mut self.0.options
7846        }
7847    }
7848
7849    /// The request builder for [HubService::get_group][crate::client::HubService::get_group] calls.
7850    ///
7851    /// # Example
7852    /// ```
7853    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::GetGroup;
7854    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
7855    ///
7856    /// let builder = prepare_request_builder();
7857    /// let response = builder.send().await?;
7858    /// # Ok(()) }
7859    ///
7860    /// fn prepare_request_builder() -> GetGroup {
7861    ///   # panic!();
7862    ///   // ... details omitted ...
7863    /// }
7864    /// ```
7865    #[derive(Clone, Debug)]
7866    pub struct GetGroup(RequestBuilder<crate::model::GetGroupRequest>);
7867
7868    impl GetGroup {
7869        pub(crate) fn new(
7870            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7871        ) -> Self {
7872            Self(RequestBuilder::new(stub))
7873        }
7874
7875        /// Sets the full request, replacing any prior values.
7876        pub fn with_request<V: Into<crate::model::GetGroupRequest>>(mut self, v: V) -> Self {
7877            self.0.request = v.into();
7878            self
7879        }
7880
7881        /// Sets all the options, replacing any prior values.
7882        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7883            self.0.options = v.into();
7884            self
7885        }
7886
7887        /// Sends the request.
7888        pub async fn send(self) -> Result<crate::model::Group> {
7889            (*self.0.stub)
7890                .get_group(self.0.request, self.0.options)
7891                .await
7892                .map(crate::Response::into_body)
7893        }
7894
7895        /// Sets the value of [name][crate::model::GetGroupRequest::name].
7896        ///
7897        /// This is a **required** field for requests.
7898        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7899            self.0.request.name = v.into();
7900            self
7901        }
7902    }
7903
7904    #[doc(hidden)]
7905    impl crate::RequestBuilder for GetGroup {
7906        fn request_options(&mut self) -> &mut crate::RequestOptions {
7907            &mut self.0.options
7908        }
7909    }
7910
7911    /// The request builder for [HubService::list_groups][crate::client::HubService::list_groups] calls.
7912    ///
7913    /// # Example
7914    /// ```
7915    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::ListGroups;
7916    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
7917    /// use google_cloud_gax::paginator::ItemPaginator;
7918    ///
7919    /// let builder = prepare_request_builder();
7920    /// let mut items = builder.by_item();
7921    /// while let Some(result) = items.next().await {
7922    ///   let item = result?;
7923    /// }
7924    /// # Ok(()) }
7925    ///
7926    /// fn prepare_request_builder() -> ListGroups {
7927    ///   # panic!();
7928    ///   // ... details omitted ...
7929    /// }
7930    /// ```
7931    #[derive(Clone, Debug)]
7932    pub struct ListGroups(RequestBuilder<crate::model::ListGroupsRequest>);
7933
7934    impl ListGroups {
7935        pub(crate) fn new(
7936            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7937        ) -> Self {
7938            Self(RequestBuilder::new(stub))
7939        }
7940
7941        /// Sets the full request, replacing any prior values.
7942        pub fn with_request<V: Into<crate::model::ListGroupsRequest>>(mut self, v: V) -> Self {
7943            self.0.request = v.into();
7944            self
7945        }
7946
7947        /// Sets all the options, replacing any prior values.
7948        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7949            self.0.options = v.into();
7950            self
7951        }
7952
7953        /// Sends the request.
7954        pub async fn send(self) -> Result<crate::model::ListGroupsResponse> {
7955            (*self.0.stub)
7956                .list_groups(self.0.request, self.0.options)
7957                .await
7958                .map(crate::Response::into_body)
7959        }
7960
7961        /// Streams each page in the collection.
7962        pub fn by_page(
7963            self,
7964        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListGroupsResponse, crate::Error>
7965        {
7966            use std::clone::Clone;
7967            let token = self.0.request.page_token.clone();
7968            let execute = move |token: String| {
7969                let mut builder = self.clone();
7970                builder.0.request = builder.0.request.set_page_token(token);
7971                builder.send()
7972            };
7973            google_cloud_gax::paginator::internal::new_paginator(token, execute)
7974        }
7975
7976        /// Streams each item in the collection.
7977        pub fn by_item(
7978            self,
7979        ) -> impl google_cloud_gax::paginator::ItemPaginator<
7980            crate::model::ListGroupsResponse,
7981            crate::Error,
7982        > {
7983            use google_cloud_gax::paginator::Paginator;
7984            self.by_page().items()
7985        }
7986
7987        /// Sets the value of [parent][crate::model::ListGroupsRequest::parent].
7988        ///
7989        /// This is a **required** field for requests.
7990        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7991            self.0.request.parent = v.into();
7992            self
7993        }
7994
7995        /// Sets the value of [page_size][crate::model::ListGroupsRequest::page_size].
7996        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7997            self.0.request.page_size = v.into();
7998            self
7999        }
8000
8001        /// Sets the value of [page_token][crate::model::ListGroupsRequest::page_token].
8002        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8003            self.0.request.page_token = v.into();
8004            self
8005        }
8006
8007        /// Sets the value of [filter][crate::model::ListGroupsRequest::filter].
8008        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8009            self.0.request.filter = v.into();
8010            self
8011        }
8012
8013        /// Sets the value of [order_by][crate::model::ListGroupsRequest::order_by].
8014        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
8015            self.0.request.order_by = v.into();
8016            self
8017        }
8018    }
8019
8020    #[doc(hidden)]
8021    impl crate::RequestBuilder for ListGroups {
8022        fn request_options(&mut self) -> &mut crate::RequestOptions {
8023            &mut self.0.options
8024        }
8025    }
8026
8027    /// The request builder for [HubService::update_group][crate::client::HubService::update_group] calls.
8028    ///
8029    /// # Example
8030    /// ```
8031    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::UpdateGroup;
8032    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
8033    /// use google_cloud_lro::Poller;
8034    ///
8035    /// let builder = prepare_request_builder();
8036    /// let response = builder.poller().until_done().await?;
8037    /// # Ok(()) }
8038    ///
8039    /// fn prepare_request_builder() -> UpdateGroup {
8040    ///   # panic!();
8041    ///   // ... details omitted ...
8042    /// }
8043    /// ```
8044    #[derive(Clone, Debug)]
8045    pub struct UpdateGroup(RequestBuilder<crate::model::UpdateGroupRequest>);
8046
8047    impl UpdateGroup {
8048        pub(crate) fn new(
8049            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8050        ) -> Self {
8051            Self(RequestBuilder::new(stub))
8052        }
8053
8054        /// Sets the full request, replacing any prior values.
8055        pub fn with_request<V: Into<crate::model::UpdateGroupRequest>>(mut self, v: V) -> Self {
8056            self.0.request = v.into();
8057            self
8058        }
8059
8060        /// Sets all the options, replacing any prior values.
8061        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8062            self.0.options = v.into();
8063            self
8064        }
8065
8066        /// Sends the request.
8067        ///
8068        /// # Long running operations
8069        ///
8070        /// This starts, but does not poll, a longrunning operation. More information
8071        /// on [update_group][crate::client::HubService::update_group].
8072        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8073            (*self.0.stub)
8074                .update_group(self.0.request, self.0.options)
8075                .await
8076                .map(crate::Response::into_body)
8077        }
8078
8079        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_group`.
8080        pub fn poller(
8081            self,
8082        ) -> impl google_cloud_lro::Poller<crate::model::Group, crate::model::OperationMetadata>
8083        {
8084            type Operation = google_cloud_lro::internal::Operation<
8085                crate::model::Group,
8086                crate::model::OperationMetadata,
8087            >;
8088            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8089            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8090            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
8091            if let Some(ref mut details) = poller_options.tracing {
8092                details.method_name = "google_cloud_networkconnectivity_v1::client::HubService::update_group::until_done";
8093            }
8094
8095            let stub = self.0.stub.clone();
8096            let mut options = self.0.options.clone();
8097            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
8098            let query = move |name| {
8099                let stub = stub.clone();
8100                let options = options.clone();
8101                async {
8102                    let op = GetOperation::new(stub)
8103                        .set_name(name)
8104                        .with_options(options)
8105                        .send()
8106                        .await?;
8107                    Ok(Operation::new(op))
8108                }
8109            };
8110
8111            let start = move || async {
8112                let op = self.send().await?;
8113                Ok(Operation::new(op))
8114            };
8115
8116            use google_cloud_lro::internal::PollerExt;
8117            {
8118                google_cloud_lro::internal::new_poller(
8119                    polling_error_policy,
8120                    polling_backoff_policy,
8121                    start,
8122                    query,
8123                )
8124            }
8125            .with_options(poller_options)
8126        }
8127
8128        /// Sets the value of [update_mask][crate::model::UpdateGroupRequest::update_mask].
8129        pub fn set_update_mask<T>(mut self, v: T) -> Self
8130        where
8131            T: std::convert::Into<wkt::FieldMask>,
8132        {
8133            self.0.request.update_mask = std::option::Option::Some(v.into());
8134            self
8135        }
8136
8137        /// Sets or clears the value of [update_mask][crate::model::UpdateGroupRequest::update_mask].
8138        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
8139        where
8140            T: std::convert::Into<wkt::FieldMask>,
8141        {
8142            self.0.request.update_mask = v.map(|x| x.into());
8143            self
8144        }
8145
8146        /// Sets the value of [group][crate::model::UpdateGroupRequest::group].
8147        ///
8148        /// This is a **required** field for requests.
8149        pub fn set_group<T>(mut self, v: T) -> Self
8150        where
8151            T: std::convert::Into<crate::model::Group>,
8152        {
8153            self.0.request.group = std::option::Option::Some(v.into());
8154            self
8155        }
8156
8157        /// Sets or clears the value of [group][crate::model::UpdateGroupRequest::group].
8158        ///
8159        /// This is a **required** field for requests.
8160        pub fn set_or_clear_group<T>(mut self, v: std::option::Option<T>) -> Self
8161        where
8162            T: std::convert::Into<crate::model::Group>,
8163        {
8164            self.0.request.group = v.map(|x| x.into());
8165            self
8166        }
8167
8168        /// Sets the value of [request_id][crate::model::UpdateGroupRequest::request_id].
8169        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
8170            self.0.request.request_id = v.into();
8171            self
8172        }
8173    }
8174
8175    #[doc(hidden)]
8176    impl crate::RequestBuilder for UpdateGroup {
8177        fn request_options(&mut self) -> &mut crate::RequestOptions {
8178            &mut self.0.options
8179        }
8180    }
8181
8182    /// The request builder for [HubService::list_locations][crate::client::HubService::list_locations] calls.
8183    ///
8184    /// # Example
8185    /// ```
8186    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::ListLocations;
8187    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
8188    /// use google_cloud_gax::paginator::ItemPaginator;
8189    ///
8190    /// let builder = prepare_request_builder();
8191    /// let mut items = builder.by_item();
8192    /// while let Some(result) = items.next().await {
8193    ///   let item = result?;
8194    /// }
8195    /// # Ok(()) }
8196    ///
8197    /// fn prepare_request_builder() -> ListLocations {
8198    ///   # panic!();
8199    ///   // ... details omitted ...
8200    /// }
8201    /// ```
8202    #[derive(Clone, Debug)]
8203    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
8204
8205    impl ListLocations {
8206        pub(crate) fn new(
8207            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8208        ) -> Self {
8209            Self(RequestBuilder::new(stub))
8210        }
8211
8212        /// Sets the full request, replacing any prior values.
8213        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
8214            mut self,
8215            v: V,
8216        ) -> Self {
8217            self.0.request = v.into();
8218            self
8219        }
8220
8221        /// Sets all the options, replacing any prior values.
8222        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8223            self.0.options = v.into();
8224            self
8225        }
8226
8227        /// Sends the request.
8228        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
8229            (*self.0.stub)
8230                .list_locations(self.0.request, self.0.options)
8231                .await
8232                .map(crate::Response::into_body)
8233        }
8234
8235        /// Streams each page in the collection.
8236        pub fn by_page(
8237            self,
8238        ) -> impl google_cloud_gax::paginator::Paginator<
8239            google_cloud_location::model::ListLocationsResponse,
8240            crate::Error,
8241        > {
8242            use std::clone::Clone;
8243            let token = self.0.request.page_token.clone();
8244            let execute = move |token: String| {
8245                let mut builder = self.clone();
8246                builder.0.request = builder.0.request.set_page_token(token);
8247                builder.send()
8248            };
8249            google_cloud_gax::paginator::internal::new_paginator(token, execute)
8250        }
8251
8252        /// Streams each item in the collection.
8253        pub fn by_item(
8254            self,
8255        ) -> impl google_cloud_gax::paginator::ItemPaginator<
8256            google_cloud_location::model::ListLocationsResponse,
8257            crate::Error,
8258        > {
8259            use google_cloud_gax::paginator::Paginator;
8260            self.by_page().items()
8261        }
8262
8263        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
8264        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8265            self.0.request.name = v.into();
8266            self
8267        }
8268
8269        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
8270        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8271            self.0.request.filter = v.into();
8272            self
8273        }
8274
8275        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
8276        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8277            self.0.request.page_size = v.into();
8278            self
8279        }
8280
8281        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
8282        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8283            self.0.request.page_token = v.into();
8284            self
8285        }
8286    }
8287
8288    #[doc(hidden)]
8289    impl crate::RequestBuilder for ListLocations {
8290        fn request_options(&mut self) -> &mut crate::RequestOptions {
8291            &mut self.0.options
8292        }
8293    }
8294
8295    /// The request builder for [HubService::get_location][crate::client::HubService::get_location] calls.
8296    ///
8297    /// # Example
8298    /// ```
8299    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::GetLocation;
8300    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
8301    ///
8302    /// let builder = prepare_request_builder();
8303    /// let response = builder.send().await?;
8304    /// # Ok(()) }
8305    ///
8306    /// fn prepare_request_builder() -> GetLocation {
8307    ///   # panic!();
8308    ///   // ... details omitted ...
8309    /// }
8310    /// ```
8311    #[derive(Clone, Debug)]
8312    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
8313
8314    impl GetLocation {
8315        pub(crate) fn new(
8316            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8317        ) -> Self {
8318            Self(RequestBuilder::new(stub))
8319        }
8320
8321        /// Sets the full request, replacing any prior values.
8322        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
8323            mut self,
8324            v: V,
8325        ) -> Self {
8326            self.0.request = v.into();
8327            self
8328        }
8329
8330        /// Sets all the options, replacing any prior values.
8331        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8332            self.0.options = v.into();
8333            self
8334        }
8335
8336        /// Sends the request.
8337        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
8338            (*self.0.stub)
8339                .get_location(self.0.request, self.0.options)
8340                .await
8341                .map(crate::Response::into_body)
8342        }
8343
8344        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
8345        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8346            self.0.request.name = v.into();
8347            self
8348        }
8349    }
8350
8351    #[doc(hidden)]
8352    impl crate::RequestBuilder for GetLocation {
8353        fn request_options(&mut self) -> &mut crate::RequestOptions {
8354            &mut self.0.options
8355        }
8356    }
8357
8358    /// The request builder for [HubService::set_iam_policy][crate::client::HubService::set_iam_policy] calls.
8359    ///
8360    /// # Example
8361    /// ```
8362    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::SetIamPolicy;
8363    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
8364    ///
8365    /// let builder = prepare_request_builder();
8366    /// let response = builder.send().await?;
8367    /// # Ok(()) }
8368    ///
8369    /// fn prepare_request_builder() -> SetIamPolicy {
8370    ///   # panic!();
8371    ///   // ... details omitted ...
8372    /// }
8373    /// ```
8374    #[derive(Clone, Debug)]
8375    pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
8376
8377    impl SetIamPolicy {
8378        pub(crate) fn new(
8379            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8380        ) -> Self {
8381            Self(RequestBuilder::new(stub))
8382        }
8383
8384        /// Sets the full request, replacing any prior values.
8385        pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
8386            mut self,
8387            v: V,
8388        ) -> Self {
8389            self.0.request = v.into();
8390            self
8391        }
8392
8393        /// Sets all the options, replacing any prior values.
8394        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8395            self.0.options = v.into();
8396            self
8397        }
8398
8399        /// Sends the request.
8400        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
8401            (*self.0.stub)
8402                .set_iam_policy(self.0.request, self.0.options)
8403                .await
8404                .map(crate::Response::into_body)
8405        }
8406
8407        /// Sets the value of [resource][google_cloud_iam_v1::model::SetIamPolicyRequest::resource].
8408        ///
8409        /// This is a **required** field for requests.
8410        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
8411            self.0.request.resource = v.into();
8412            self
8413        }
8414
8415        /// Sets the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
8416        ///
8417        /// This is a **required** field for requests.
8418        pub fn set_policy<T>(mut self, v: T) -> Self
8419        where
8420            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
8421        {
8422            self.0.request.policy = std::option::Option::Some(v.into());
8423            self
8424        }
8425
8426        /// Sets or clears the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
8427        ///
8428        /// This is a **required** field for requests.
8429        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
8430        where
8431            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
8432        {
8433            self.0.request.policy = v.map(|x| x.into());
8434            self
8435        }
8436
8437        /// Sets the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
8438        pub fn set_update_mask<T>(mut self, v: T) -> Self
8439        where
8440            T: std::convert::Into<wkt::FieldMask>,
8441        {
8442            self.0.request.update_mask = std::option::Option::Some(v.into());
8443            self
8444        }
8445
8446        /// Sets or clears the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
8447        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
8448        where
8449            T: std::convert::Into<wkt::FieldMask>,
8450        {
8451            self.0.request.update_mask = v.map(|x| x.into());
8452            self
8453        }
8454    }
8455
8456    #[doc(hidden)]
8457    impl crate::RequestBuilder for SetIamPolicy {
8458        fn request_options(&mut self) -> &mut crate::RequestOptions {
8459            &mut self.0.options
8460        }
8461    }
8462
8463    /// The request builder for [HubService::get_iam_policy][crate::client::HubService::get_iam_policy] calls.
8464    ///
8465    /// # Example
8466    /// ```
8467    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::GetIamPolicy;
8468    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
8469    ///
8470    /// let builder = prepare_request_builder();
8471    /// let response = builder.send().await?;
8472    /// # Ok(()) }
8473    ///
8474    /// fn prepare_request_builder() -> GetIamPolicy {
8475    ///   # panic!();
8476    ///   // ... details omitted ...
8477    /// }
8478    /// ```
8479    #[derive(Clone, Debug)]
8480    pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
8481
8482    impl GetIamPolicy {
8483        pub(crate) fn new(
8484            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8485        ) -> Self {
8486            Self(RequestBuilder::new(stub))
8487        }
8488
8489        /// Sets the full request, replacing any prior values.
8490        pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
8491            mut self,
8492            v: V,
8493        ) -> Self {
8494            self.0.request = v.into();
8495            self
8496        }
8497
8498        /// Sets all the options, replacing any prior values.
8499        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8500            self.0.options = v.into();
8501            self
8502        }
8503
8504        /// Sends the request.
8505        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
8506            (*self.0.stub)
8507                .get_iam_policy(self.0.request, self.0.options)
8508                .await
8509                .map(crate::Response::into_body)
8510        }
8511
8512        /// Sets the value of [resource][google_cloud_iam_v1::model::GetIamPolicyRequest::resource].
8513        ///
8514        /// This is a **required** field for requests.
8515        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
8516            self.0.request.resource = v.into();
8517            self
8518        }
8519
8520        /// Sets the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
8521        pub fn set_options<T>(mut self, v: T) -> Self
8522        where
8523            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
8524        {
8525            self.0.request.options = std::option::Option::Some(v.into());
8526            self
8527        }
8528
8529        /// Sets or clears the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
8530        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
8531        where
8532            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
8533        {
8534            self.0.request.options = v.map(|x| x.into());
8535            self
8536        }
8537    }
8538
8539    #[doc(hidden)]
8540    impl crate::RequestBuilder for GetIamPolicy {
8541        fn request_options(&mut self) -> &mut crate::RequestOptions {
8542            &mut self.0.options
8543        }
8544    }
8545
8546    /// The request builder for [HubService::test_iam_permissions][crate::client::HubService::test_iam_permissions] calls.
8547    ///
8548    /// # Example
8549    /// ```
8550    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::TestIamPermissions;
8551    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
8552    ///
8553    /// let builder = prepare_request_builder();
8554    /// let response = builder.send().await?;
8555    /// # Ok(()) }
8556    ///
8557    /// fn prepare_request_builder() -> TestIamPermissions {
8558    ///   # panic!();
8559    ///   // ... details omitted ...
8560    /// }
8561    /// ```
8562    #[derive(Clone, Debug)]
8563    pub struct TestIamPermissions(
8564        RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
8565    );
8566
8567    impl TestIamPermissions {
8568        pub(crate) fn new(
8569            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8570        ) -> Self {
8571            Self(RequestBuilder::new(stub))
8572        }
8573
8574        /// Sets the full request, replacing any prior values.
8575        pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
8576            mut self,
8577            v: V,
8578        ) -> Self {
8579            self.0.request = v.into();
8580            self
8581        }
8582
8583        /// Sets all the options, replacing any prior values.
8584        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8585            self.0.options = v.into();
8586            self
8587        }
8588
8589        /// Sends the request.
8590        pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
8591            (*self.0.stub)
8592                .test_iam_permissions(self.0.request, self.0.options)
8593                .await
8594                .map(crate::Response::into_body)
8595        }
8596
8597        /// Sets the value of [resource][google_cloud_iam_v1::model::TestIamPermissionsRequest::resource].
8598        ///
8599        /// This is a **required** field for requests.
8600        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
8601            self.0.request.resource = v.into();
8602            self
8603        }
8604
8605        /// Sets the value of [permissions][google_cloud_iam_v1::model::TestIamPermissionsRequest::permissions].
8606        ///
8607        /// This is a **required** field for requests.
8608        pub fn set_permissions<T, V>(mut self, v: T) -> Self
8609        where
8610            T: std::iter::IntoIterator<Item = V>,
8611            V: std::convert::Into<std::string::String>,
8612        {
8613            use std::iter::Iterator;
8614            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
8615            self
8616        }
8617    }
8618
8619    #[doc(hidden)]
8620    impl crate::RequestBuilder for TestIamPermissions {
8621        fn request_options(&mut self) -> &mut crate::RequestOptions {
8622            &mut self.0.options
8623        }
8624    }
8625
8626    /// The request builder for [HubService::list_operations][crate::client::HubService::list_operations] calls.
8627    ///
8628    /// # Example
8629    /// ```
8630    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::ListOperations;
8631    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
8632    /// use google_cloud_gax::paginator::ItemPaginator;
8633    ///
8634    /// let builder = prepare_request_builder();
8635    /// let mut items = builder.by_item();
8636    /// while let Some(result) = items.next().await {
8637    ///   let item = result?;
8638    /// }
8639    /// # Ok(()) }
8640    ///
8641    /// fn prepare_request_builder() -> ListOperations {
8642    ///   # panic!();
8643    ///   // ... details omitted ...
8644    /// }
8645    /// ```
8646    #[derive(Clone, Debug)]
8647    pub struct ListOperations(
8648        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
8649    );
8650
8651    impl ListOperations {
8652        pub(crate) fn new(
8653            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8654        ) -> Self {
8655            Self(RequestBuilder::new(stub))
8656        }
8657
8658        /// Sets the full request, replacing any prior values.
8659        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
8660            mut self,
8661            v: V,
8662        ) -> Self {
8663            self.0.request = v.into();
8664            self
8665        }
8666
8667        /// Sets all the options, replacing any prior values.
8668        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8669            self.0.options = v.into();
8670            self
8671        }
8672
8673        /// Sends the request.
8674        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
8675            (*self.0.stub)
8676                .list_operations(self.0.request, self.0.options)
8677                .await
8678                .map(crate::Response::into_body)
8679        }
8680
8681        /// Streams each page in the collection.
8682        pub fn by_page(
8683            self,
8684        ) -> impl google_cloud_gax::paginator::Paginator<
8685            google_cloud_longrunning::model::ListOperationsResponse,
8686            crate::Error,
8687        > {
8688            use std::clone::Clone;
8689            let token = self.0.request.page_token.clone();
8690            let execute = move |token: String| {
8691                let mut builder = self.clone();
8692                builder.0.request = builder.0.request.set_page_token(token);
8693                builder.send()
8694            };
8695            google_cloud_gax::paginator::internal::new_paginator(token, execute)
8696        }
8697
8698        /// Streams each item in the collection.
8699        pub fn by_item(
8700            self,
8701        ) -> impl google_cloud_gax::paginator::ItemPaginator<
8702            google_cloud_longrunning::model::ListOperationsResponse,
8703            crate::Error,
8704        > {
8705            use google_cloud_gax::paginator::Paginator;
8706            self.by_page().items()
8707        }
8708
8709        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
8710        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8711            self.0.request.name = v.into();
8712            self
8713        }
8714
8715        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
8716        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8717            self.0.request.filter = v.into();
8718            self
8719        }
8720
8721        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
8722        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8723            self.0.request.page_size = v.into();
8724            self
8725        }
8726
8727        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
8728        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8729            self.0.request.page_token = v.into();
8730            self
8731        }
8732
8733        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
8734        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
8735            self.0.request.return_partial_success = v.into();
8736            self
8737        }
8738    }
8739
8740    #[doc(hidden)]
8741    impl crate::RequestBuilder for ListOperations {
8742        fn request_options(&mut self) -> &mut crate::RequestOptions {
8743            &mut self.0.options
8744        }
8745    }
8746
8747    /// The request builder for [HubService::get_operation][crate::client::HubService::get_operation] calls.
8748    ///
8749    /// # Example
8750    /// ```
8751    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::GetOperation;
8752    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
8753    ///
8754    /// let builder = prepare_request_builder();
8755    /// let response = builder.send().await?;
8756    /// # Ok(()) }
8757    ///
8758    /// fn prepare_request_builder() -> GetOperation {
8759    ///   # panic!();
8760    ///   // ... details omitted ...
8761    /// }
8762    /// ```
8763    #[derive(Clone, Debug)]
8764    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
8765
8766    impl GetOperation {
8767        pub(crate) fn new(
8768            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8769        ) -> Self {
8770            Self(RequestBuilder::new(stub))
8771        }
8772
8773        /// Sets the full request, replacing any prior values.
8774        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
8775            mut self,
8776            v: V,
8777        ) -> Self {
8778            self.0.request = v.into();
8779            self
8780        }
8781
8782        /// Sets all the options, replacing any prior values.
8783        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8784            self.0.options = v.into();
8785            self
8786        }
8787
8788        /// Sends the request.
8789        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8790            (*self.0.stub)
8791                .get_operation(self.0.request, self.0.options)
8792                .await
8793                .map(crate::Response::into_body)
8794        }
8795
8796        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
8797        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8798            self.0.request.name = v.into();
8799            self
8800        }
8801    }
8802
8803    #[doc(hidden)]
8804    impl crate::RequestBuilder for GetOperation {
8805        fn request_options(&mut self) -> &mut crate::RequestOptions {
8806            &mut self.0.options
8807        }
8808    }
8809
8810    /// The request builder for [HubService::delete_operation][crate::client::HubService::delete_operation] calls.
8811    ///
8812    /// # Example
8813    /// ```
8814    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::DeleteOperation;
8815    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
8816    ///
8817    /// let builder = prepare_request_builder();
8818    /// let response = builder.send().await?;
8819    /// # Ok(()) }
8820    ///
8821    /// fn prepare_request_builder() -> DeleteOperation {
8822    ///   # panic!();
8823    ///   // ... details omitted ...
8824    /// }
8825    /// ```
8826    #[derive(Clone, Debug)]
8827    pub struct DeleteOperation(
8828        RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
8829    );
8830
8831    impl DeleteOperation {
8832        pub(crate) fn new(
8833            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8834        ) -> Self {
8835            Self(RequestBuilder::new(stub))
8836        }
8837
8838        /// Sets the full request, replacing any prior values.
8839        pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
8840            mut self,
8841            v: V,
8842        ) -> Self {
8843            self.0.request = v.into();
8844            self
8845        }
8846
8847        /// Sets all the options, replacing any prior values.
8848        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8849            self.0.options = v.into();
8850            self
8851        }
8852
8853        /// Sends the request.
8854        pub async fn send(self) -> Result<()> {
8855            (*self.0.stub)
8856                .delete_operation(self.0.request, self.0.options)
8857                .await
8858                .map(crate::Response::into_body)
8859        }
8860
8861        /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
8862        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8863            self.0.request.name = v.into();
8864            self
8865        }
8866    }
8867
8868    #[doc(hidden)]
8869    impl crate::RequestBuilder for DeleteOperation {
8870        fn request_options(&mut self) -> &mut crate::RequestOptions {
8871            &mut self.0.options
8872        }
8873    }
8874
8875    /// The request builder for [HubService::cancel_operation][crate::client::HubService::cancel_operation] calls.
8876    ///
8877    /// # Example
8878    /// ```
8879    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::CancelOperation;
8880    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
8881    ///
8882    /// let builder = prepare_request_builder();
8883    /// let response = builder.send().await?;
8884    /// # Ok(()) }
8885    ///
8886    /// fn prepare_request_builder() -> CancelOperation {
8887    ///   # panic!();
8888    ///   // ... details omitted ...
8889    /// }
8890    /// ```
8891    #[derive(Clone, Debug)]
8892    pub struct CancelOperation(
8893        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
8894    );
8895
8896    impl CancelOperation {
8897        pub(crate) fn new(
8898            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8899        ) -> Self {
8900            Self(RequestBuilder::new(stub))
8901        }
8902
8903        /// Sets the full request, replacing any prior values.
8904        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
8905            mut self,
8906            v: V,
8907        ) -> Self {
8908            self.0.request = v.into();
8909            self
8910        }
8911
8912        /// Sets all the options, replacing any prior values.
8913        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8914            self.0.options = v.into();
8915            self
8916        }
8917
8918        /// Sends the request.
8919        pub async fn send(self) -> Result<()> {
8920            (*self.0.stub)
8921                .cancel_operation(self.0.request, self.0.options)
8922                .await
8923                .map(crate::Response::into_body)
8924        }
8925
8926        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
8927        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8928            self.0.request.name = v.into();
8929            self
8930        }
8931    }
8932
8933    #[doc(hidden)]
8934    impl crate::RequestBuilder for CancelOperation {
8935        fn request_options(&mut self) -> &mut crate::RequestOptions {
8936            &mut self.0.options
8937        }
8938    }
8939}
8940
8941/// Request and client builders for [InternalRangeService][crate::client::InternalRangeService].
8942pub mod internal_range_service {
8943    use crate::Result;
8944
8945    /// A builder for [InternalRangeService][crate::client::InternalRangeService].
8946    ///
8947    /// ```
8948    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
8949    /// # use google_cloud_networkconnectivity_v1::*;
8950    /// # use builder::internal_range_service::ClientBuilder;
8951    /// # use client::InternalRangeService;
8952    /// let builder : ClientBuilder = InternalRangeService::builder();
8953    /// let client = builder
8954    ///     .with_endpoint("https://networkconnectivity.googleapis.com")
8955    ///     .build().await?;
8956    /// # Ok(()) }
8957    /// ```
8958    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
8959
8960    pub(crate) mod client {
8961        use super::super::super::client::InternalRangeService;
8962        pub struct Factory;
8963        impl crate::ClientFactory for Factory {
8964            type Client = InternalRangeService;
8965            type Credentials = gaxi::options::Credentials;
8966            async fn build(
8967                self,
8968                config: gaxi::options::ClientConfig,
8969            ) -> crate::ClientBuilderResult<Self::Client> {
8970                Self::Client::new(config).await
8971            }
8972        }
8973    }
8974
8975    /// Common implementation for [crate::client::InternalRangeService] request builders.
8976    #[derive(Clone, Debug)]
8977    pub(crate) struct RequestBuilder<R: std::default::Default> {
8978        stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
8979        request: R,
8980        options: crate::RequestOptions,
8981    }
8982
8983    impl<R> RequestBuilder<R>
8984    where
8985        R: std::default::Default,
8986    {
8987        pub(crate) fn new(
8988            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
8989        ) -> Self {
8990            Self {
8991                stub,
8992                request: R::default(),
8993                options: crate::RequestOptions::default(),
8994            }
8995        }
8996    }
8997
8998    /// The request builder for [InternalRangeService::list_internal_ranges][crate::client::InternalRangeService::list_internal_ranges] calls.
8999    ///
9000    /// # Example
9001    /// ```
9002    /// # use google_cloud_networkconnectivity_v1::builder::internal_range_service::ListInternalRanges;
9003    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
9004    /// use google_cloud_gax::paginator::ItemPaginator;
9005    ///
9006    /// let builder = prepare_request_builder();
9007    /// let mut items = builder.by_item();
9008    /// while let Some(result) = items.next().await {
9009    ///   let item = result?;
9010    /// }
9011    /// # Ok(()) }
9012    ///
9013    /// fn prepare_request_builder() -> ListInternalRanges {
9014    ///   # panic!();
9015    ///   // ... details omitted ...
9016    /// }
9017    /// ```
9018    #[derive(Clone, Debug)]
9019    pub struct ListInternalRanges(RequestBuilder<crate::model::ListInternalRangesRequest>);
9020
9021    impl ListInternalRanges {
9022        pub(crate) fn new(
9023            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9024        ) -> Self {
9025            Self(RequestBuilder::new(stub))
9026        }
9027
9028        /// Sets the full request, replacing any prior values.
9029        pub fn with_request<V: Into<crate::model::ListInternalRangesRequest>>(
9030            mut self,
9031            v: V,
9032        ) -> Self {
9033            self.0.request = v.into();
9034            self
9035        }
9036
9037        /// Sets all the options, replacing any prior values.
9038        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9039            self.0.options = v.into();
9040            self
9041        }
9042
9043        /// Sends the request.
9044        pub async fn send(self) -> Result<crate::model::ListInternalRangesResponse> {
9045            (*self.0.stub)
9046                .list_internal_ranges(self.0.request, self.0.options)
9047                .await
9048                .map(crate::Response::into_body)
9049        }
9050
9051        /// Streams each page in the collection.
9052        pub fn by_page(
9053            self,
9054        ) -> impl google_cloud_gax::paginator::Paginator<
9055            crate::model::ListInternalRangesResponse,
9056            crate::Error,
9057        > {
9058            use std::clone::Clone;
9059            let token = self.0.request.page_token.clone();
9060            let execute = move |token: String| {
9061                let mut builder = self.clone();
9062                builder.0.request = builder.0.request.set_page_token(token);
9063                builder.send()
9064            };
9065            google_cloud_gax::paginator::internal::new_paginator(token, execute)
9066        }
9067
9068        /// Streams each item in the collection.
9069        pub fn by_item(
9070            self,
9071        ) -> impl google_cloud_gax::paginator::ItemPaginator<
9072            crate::model::ListInternalRangesResponse,
9073            crate::Error,
9074        > {
9075            use google_cloud_gax::paginator::Paginator;
9076            self.by_page().items()
9077        }
9078
9079        /// Sets the value of [parent][crate::model::ListInternalRangesRequest::parent].
9080        ///
9081        /// This is a **required** field for requests.
9082        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
9083            self.0.request.parent = v.into();
9084            self
9085        }
9086
9087        /// Sets the value of [page_size][crate::model::ListInternalRangesRequest::page_size].
9088        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
9089            self.0.request.page_size = v.into();
9090            self
9091        }
9092
9093        /// Sets the value of [page_token][crate::model::ListInternalRangesRequest::page_token].
9094        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
9095            self.0.request.page_token = v.into();
9096            self
9097        }
9098
9099        /// Sets the value of [filter][crate::model::ListInternalRangesRequest::filter].
9100        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
9101            self.0.request.filter = v.into();
9102            self
9103        }
9104
9105        /// Sets the value of [order_by][crate::model::ListInternalRangesRequest::order_by].
9106        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
9107            self.0.request.order_by = v.into();
9108            self
9109        }
9110    }
9111
9112    #[doc(hidden)]
9113    impl crate::RequestBuilder for ListInternalRanges {
9114        fn request_options(&mut self) -> &mut crate::RequestOptions {
9115            &mut self.0.options
9116        }
9117    }
9118
9119    /// The request builder for [InternalRangeService::get_internal_range][crate::client::InternalRangeService::get_internal_range] calls.
9120    ///
9121    /// # Example
9122    /// ```
9123    /// # use google_cloud_networkconnectivity_v1::builder::internal_range_service::GetInternalRange;
9124    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
9125    ///
9126    /// let builder = prepare_request_builder();
9127    /// let response = builder.send().await?;
9128    /// # Ok(()) }
9129    ///
9130    /// fn prepare_request_builder() -> GetInternalRange {
9131    ///   # panic!();
9132    ///   // ... details omitted ...
9133    /// }
9134    /// ```
9135    #[derive(Clone, Debug)]
9136    pub struct GetInternalRange(RequestBuilder<crate::model::GetInternalRangeRequest>);
9137
9138    impl GetInternalRange {
9139        pub(crate) fn new(
9140            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9141        ) -> Self {
9142            Self(RequestBuilder::new(stub))
9143        }
9144
9145        /// Sets the full request, replacing any prior values.
9146        pub fn with_request<V: Into<crate::model::GetInternalRangeRequest>>(
9147            mut self,
9148            v: V,
9149        ) -> Self {
9150            self.0.request = v.into();
9151            self
9152        }
9153
9154        /// Sets all the options, replacing any prior values.
9155        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9156            self.0.options = v.into();
9157            self
9158        }
9159
9160        /// Sends the request.
9161        pub async fn send(self) -> Result<crate::model::InternalRange> {
9162            (*self.0.stub)
9163                .get_internal_range(self.0.request, self.0.options)
9164                .await
9165                .map(crate::Response::into_body)
9166        }
9167
9168        /// Sets the value of [name][crate::model::GetInternalRangeRequest::name].
9169        ///
9170        /// This is a **required** field for requests.
9171        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9172            self.0.request.name = v.into();
9173            self
9174        }
9175    }
9176
9177    #[doc(hidden)]
9178    impl crate::RequestBuilder for GetInternalRange {
9179        fn request_options(&mut self) -> &mut crate::RequestOptions {
9180            &mut self.0.options
9181        }
9182    }
9183
9184    /// The request builder for [InternalRangeService::create_internal_range][crate::client::InternalRangeService::create_internal_range] calls.
9185    ///
9186    /// # Example
9187    /// ```
9188    /// # use google_cloud_networkconnectivity_v1::builder::internal_range_service::CreateInternalRange;
9189    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
9190    /// use google_cloud_lro::Poller;
9191    ///
9192    /// let builder = prepare_request_builder();
9193    /// let response = builder.poller().until_done().await?;
9194    /// # Ok(()) }
9195    ///
9196    /// fn prepare_request_builder() -> CreateInternalRange {
9197    ///   # panic!();
9198    ///   // ... details omitted ...
9199    /// }
9200    /// ```
9201    #[derive(Clone, Debug)]
9202    pub struct CreateInternalRange(RequestBuilder<crate::model::CreateInternalRangeRequest>);
9203
9204    impl CreateInternalRange {
9205        pub(crate) fn new(
9206            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9207        ) -> Self {
9208            Self(RequestBuilder::new(stub))
9209        }
9210
9211        /// Sets the full request, replacing any prior values.
9212        pub fn with_request<V: Into<crate::model::CreateInternalRangeRequest>>(
9213            mut self,
9214            v: V,
9215        ) -> Self {
9216            self.0.request = v.into();
9217            self
9218        }
9219
9220        /// Sets all the options, replacing any prior values.
9221        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9222            self.0.options = v.into();
9223            self
9224        }
9225
9226        /// Sends the request.
9227        ///
9228        /// # Long running operations
9229        ///
9230        /// This starts, but does not poll, a longrunning operation. More information
9231        /// on [create_internal_range][crate::client::InternalRangeService::create_internal_range].
9232        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9233            (*self.0.stub)
9234                .create_internal_range(self.0.request, self.0.options)
9235                .await
9236                .map(crate::Response::into_body)
9237        }
9238
9239        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_internal_range`.
9240        pub fn poller(
9241            self,
9242        ) -> impl google_cloud_lro::Poller<crate::model::InternalRange, crate::model::OperationMetadata>
9243        {
9244            type Operation = google_cloud_lro::internal::Operation<
9245                crate::model::InternalRange,
9246                crate::model::OperationMetadata,
9247            >;
9248            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9249            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9250            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
9251            if let Some(ref mut details) = poller_options.tracing {
9252                details.method_name = "google_cloud_networkconnectivity_v1::client::InternalRangeService::create_internal_range::until_done";
9253            }
9254
9255            let stub = self.0.stub.clone();
9256            let mut options = self.0.options.clone();
9257            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
9258            let query = move |name| {
9259                let stub = stub.clone();
9260                let options = options.clone();
9261                async {
9262                    let op = GetOperation::new(stub)
9263                        .set_name(name)
9264                        .with_options(options)
9265                        .send()
9266                        .await?;
9267                    Ok(Operation::new(op))
9268                }
9269            };
9270
9271            let start = move || async {
9272                let op = self.send().await?;
9273                Ok(Operation::new(op))
9274            };
9275
9276            use google_cloud_lro::internal::PollerExt;
9277            {
9278                google_cloud_lro::internal::new_poller(
9279                    polling_error_policy,
9280                    polling_backoff_policy,
9281                    start,
9282                    query,
9283                )
9284            }
9285            .with_options(poller_options)
9286        }
9287
9288        /// Sets the value of [parent][crate::model::CreateInternalRangeRequest::parent].
9289        ///
9290        /// This is a **required** field for requests.
9291        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
9292            self.0.request.parent = v.into();
9293            self
9294        }
9295
9296        /// Sets the value of [internal_range_id][crate::model::CreateInternalRangeRequest::internal_range_id].
9297        pub fn set_internal_range_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9298            self.0.request.internal_range_id = v.into();
9299            self
9300        }
9301
9302        /// Sets the value of [internal_range][crate::model::CreateInternalRangeRequest::internal_range].
9303        ///
9304        /// This is a **required** field for requests.
9305        pub fn set_internal_range<T>(mut self, v: T) -> Self
9306        where
9307            T: std::convert::Into<crate::model::InternalRange>,
9308        {
9309            self.0.request.internal_range = std::option::Option::Some(v.into());
9310            self
9311        }
9312
9313        /// Sets or clears the value of [internal_range][crate::model::CreateInternalRangeRequest::internal_range].
9314        ///
9315        /// This is a **required** field for requests.
9316        pub fn set_or_clear_internal_range<T>(mut self, v: std::option::Option<T>) -> Self
9317        where
9318            T: std::convert::Into<crate::model::InternalRange>,
9319        {
9320            self.0.request.internal_range = v.map(|x| x.into());
9321            self
9322        }
9323
9324        /// Sets the value of [request_id][crate::model::CreateInternalRangeRequest::request_id].
9325        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9326            self.0.request.request_id = v.into();
9327            self
9328        }
9329    }
9330
9331    #[doc(hidden)]
9332    impl crate::RequestBuilder for CreateInternalRange {
9333        fn request_options(&mut self) -> &mut crate::RequestOptions {
9334            &mut self.0.options
9335        }
9336    }
9337
9338    /// The request builder for [InternalRangeService::update_internal_range][crate::client::InternalRangeService::update_internal_range] calls.
9339    ///
9340    /// # Example
9341    /// ```
9342    /// # use google_cloud_networkconnectivity_v1::builder::internal_range_service::UpdateInternalRange;
9343    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
9344    /// use google_cloud_lro::Poller;
9345    ///
9346    /// let builder = prepare_request_builder();
9347    /// let response = builder.poller().until_done().await?;
9348    /// # Ok(()) }
9349    ///
9350    /// fn prepare_request_builder() -> UpdateInternalRange {
9351    ///   # panic!();
9352    ///   // ... details omitted ...
9353    /// }
9354    /// ```
9355    #[derive(Clone, Debug)]
9356    pub struct UpdateInternalRange(RequestBuilder<crate::model::UpdateInternalRangeRequest>);
9357
9358    impl UpdateInternalRange {
9359        pub(crate) fn new(
9360            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9361        ) -> Self {
9362            Self(RequestBuilder::new(stub))
9363        }
9364
9365        /// Sets the full request, replacing any prior values.
9366        pub fn with_request<V: Into<crate::model::UpdateInternalRangeRequest>>(
9367            mut self,
9368            v: V,
9369        ) -> Self {
9370            self.0.request = v.into();
9371            self
9372        }
9373
9374        /// Sets all the options, replacing any prior values.
9375        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9376            self.0.options = v.into();
9377            self
9378        }
9379
9380        /// Sends the request.
9381        ///
9382        /// # Long running operations
9383        ///
9384        /// This starts, but does not poll, a longrunning operation. More information
9385        /// on [update_internal_range][crate::client::InternalRangeService::update_internal_range].
9386        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9387            (*self.0.stub)
9388                .update_internal_range(self.0.request, self.0.options)
9389                .await
9390                .map(crate::Response::into_body)
9391        }
9392
9393        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_internal_range`.
9394        pub fn poller(
9395            self,
9396        ) -> impl google_cloud_lro::Poller<crate::model::InternalRange, crate::model::OperationMetadata>
9397        {
9398            type Operation = google_cloud_lro::internal::Operation<
9399                crate::model::InternalRange,
9400                crate::model::OperationMetadata,
9401            >;
9402            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9403            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9404            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
9405            if let Some(ref mut details) = poller_options.tracing {
9406                details.method_name = "google_cloud_networkconnectivity_v1::client::InternalRangeService::update_internal_range::until_done";
9407            }
9408
9409            let stub = self.0.stub.clone();
9410            let mut options = self.0.options.clone();
9411            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
9412            let query = move |name| {
9413                let stub = stub.clone();
9414                let options = options.clone();
9415                async {
9416                    let op = GetOperation::new(stub)
9417                        .set_name(name)
9418                        .with_options(options)
9419                        .send()
9420                        .await?;
9421                    Ok(Operation::new(op))
9422                }
9423            };
9424
9425            let start = move || async {
9426                let op = self.send().await?;
9427                Ok(Operation::new(op))
9428            };
9429
9430            use google_cloud_lro::internal::PollerExt;
9431            {
9432                google_cloud_lro::internal::new_poller(
9433                    polling_error_policy,
9434                    polling_backoff_policy,
9435                    start,
9436                    query,
9437                )
9438            }
9439            .with_options(poller_options)
9440        }
9441
9442        /// Sets the value of [update_mask][crate::model::UpdateInternalRangeRequest::update_mask].
9443        pub fn set_update_mask<T>(mut self, v: T) -> Self
9444        where
9445            T: std::convert::Into<wkt::FieldMask>,
9446        {
9447            self.0.request.update_mask = std::option::Option::Some(v.into());
9448            self
9449        }
9450
9451        /// Sets or clears the value of [update_mask][crate::model::UpdateInternalRangeRequest::update_mask].
9452        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
9453        where
9454            T: std::convert::Into<wkt::FieldMask>,
9455        {
9456            self.0.request.update_mask = v.map(|x| x.into());
9457            self
9458        }
9459
9460        /// Sets the value of [internal_range][crate::model::UpdateInternalRangeRequest::internal_range].
9461        ///
9462        /// This is a **required** field for requests.
9463        pub fn set_internal_range<T>(mut self, v: T) -> Self
9464        where
9465            T: std::convert::Into<crate::model::InternalRange>,
9466        {
9467            self.0.request.internal_range = std::option::Option::Some(v.into());
9468            self
9469        }
9470
9471        /// Sets or clears the value of [internal_range][crate::model::UpdateInternalRangeRequest::internal_range].
9472        ///
9473        /// This is a **required** field for requests.
9474        pub fn set_or_clear_internal_range<T>(mut self, v: std::option::Option<T>) -> Self
9475        where
9476            T: std::convert::Into<crate::model::InternalRange>,
9477        {
9478            self.0.request.internal_range = v.map(|x| x.into());
9479            self
9480        }
9481
9482        /// Sets the value of [request_id][crate::model::UpdateInternalRangeRequest::request_id].
9483        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9484            self.0.request.request_id = v.into();
9485            self
9486        }
9487    }
9488
9489    #[doc(hidden)]
9490    impl crate::RequestBuilder for UpdateInternalRange {
9491        fn request_options(&mut self) -> &mut crate::RequestOptions {
9492            &mut self.0.options
9493        }
9494    }
9495
9496    /// The request builder for [InternalRangeService::delete_internal_range][crate::client::InternalRangeService::delete_internal_range] calls.
9497    ///
9498    /// # Example
9499    /// ```
9500    /// # use google_cloud_networkconnectivity_v1::builder::internal_range_service::DeleteInternalRange;
9501    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
9502    /// use google_cloud_lro::Poller;
9503    ///
9504    /// let builder = prepare_request_builder();
9505    /// let response = builder.poller().until_done().await?;
9506    /// # Ok(()) }
9507    ///
9508    /// fn prepare_request_builder() -> DeleteInternalRange {
9509    ///   # panic!();
9510    ///   // ... details omitted ...
9511    /// }
9512    /// ```
9513    #[derive(Clone, Debug)]
9514    pub struct DeleteInternalRange(RequestBuilder<crate::model::DeleteInternalRangeRequest>);
9515
9516    impl DeleteInternalRange {
9517        pub(crate) fn new(
9518            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9519        ) -> Self {
9520            Self(RequestBuilder::new(stub))
9521        }
9522
9523        /// Sets the full request, replacing any prior values.
9524        pub fn with_request<V: Into<crate::model::DeleteInternalRangeRequest>>(
9525            mut self,
9526            v: V,
9527        ) -> Self {
9528            self.0.request = v.into();
9529            self
9530        }
9531
9532        /// Sets all the options, replacing any prior values.
9533        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9534            self.0.options = v.into();
9535            self
9536        }
9537
9538        /// Sends the request.
9539        ///
9540        /// # Long running operations
9541        ///
9542        /// This starts, but does not poll, a longrunning operation. More information
9543        /// on [delete_internal_range][crate::client::InternalRangeService::delete_internal_range].
9544        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9545            (*self.0.stub)
9546                .delete_internal_range(self.0.request, self.0.options)
9547                .await
9548                .map(crate::Response::into_body)
9549        }
9550
9551        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_internal_range`.
9552        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
9553            type Operation =
9554                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
9555            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9556            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9557            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
9558            if let Some(ref mut details) = poller_options.tracing {
9559                details.method_name = "google_cloud_networkconnectivity_v1::client::InternalRangeService::delete_internal_range::until_done";
9560            }
9561
9562            let stub = self.0.stub.clone();
9563            let mut options = self.0.options.clone();
9564            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
9565            let query = move |name| {
9566                let stub = stub.clone();
9567                let options = options.clone();
9568                async {
9569                    let op = GetOperation::new(stub)
9570                        .set_name(name)
9571                        .with_options(options)
9572                        .send()
9573                        .await?;
9574                    Ok(Operation::new(op))
9575                }
9576            };
9577
9578            let start = move || async {
9579                let op = self.send().await?;
9580                Ok(Operation::new(op))
9581            };
9582
9583            use google_cloud_lro::internal::PollerExt;
9584            {
9585                google_cloud_lro::internal::new_unit_response_poller(
9586                    polling_error_policy,
9587                    polling_backoff_policy,
9588                    start,
9589                    query,
9590                )
9591            }
9592            .with_options(poller_options)
9593        }
9594
9595        /// Sets the value of [name][crate::model::DeleteInternalRangeRequest::name].
9596        ///
9597        /// This is a **required** field for requests.
9598        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9599            self.0.request.name = v.into();
9600            self
9601        }
9602
9603        /// Sets the value of [request_id][crate::model::DeleteInternalRangeRequest::request_id].
9604        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9605            self.0.request.request_id = v.into();
9606            self
9607        }
9608    }
9609
9610    #[doc(hidden)]
9611    impl crate::RequestBuilder for DeleteInternalRange {
9612        fn request_options(&mut self) -> &mut crate::RequestOptions {
9613            &mut self.0.options
9614        }
9615    }
9616
9617    /// The request builder for [InternalRangeService::list_locations][crate::client::InternalRangeService::list_locations] calls.
9618    ///
9619    /// # Example
9620    /// ```
9621    /// # use google_cloud_networkconnectivity_v1::builder::internal_range_service::ListLocations;
9622    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
9623    /// use google_cloud_gax::paginator::ItemPaginator;
9624    ///
9625    /// let builder = prepare_request_builder();
9626    /// let mut items = builder.by_item();
9627    /// while let Some(result) = items.next().await {
9628    ///   let item = result?;
9629    /// }
9630    /// # Ok(()) }
9631    ///
9632    /// fn prepare_request_builder() -> ListLocations {
9633    ///   # panic!();
9634    ///   // ... details omitted ...
9635    /// }
9636    /// ```
9637    #[derive(Clone, Debug)]
9638    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
9639
9640    impl ListLocations {
9641        pub(crate) fn new(
9642            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9643        ) -> Self {
9644            Self(RequestBuilder::new(stub))
9645        }
9646
9647        /// Sets the full request, replacing any prior values.
9648        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
9649            mut self,
9650            v: V,
9651        ) -> Self {
9652            self.0.request = v.into();
9653            self
9654        }
9655
9656        /// Sets all the options, replacing any prior values.
9657        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9658            self.0.options = v.into();
9659            self
9660        }
9661
9662        /// Sends the request.
9663        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
9664            (*self.0.stub)
9665                .list_locations(self.0.request, self.0.options)
9666                .await
9667                .map(crate::Response::into_body)
9668        }
9669
9670        /// Streams each page in the collection.
9671        pub fn by_page(
9672            self,
9673        ) -> impl google_cloud_gax::paginator::Paginator<
9674            google_cloud_location::model::ListLocationsResponse,
9675            crate::Error,
9676        > {
9677            use std::clone::Clone;
9678            let token = self.0.request.page_token.clone();
9679            let execute = move |token: String| {
9680                let mut builder = self.clone();
9681                builder.0.request = builder.0.request.set_page_token(token);
9682                builder.send()
9683            };
9684            google_cloud_gax::paginator::internal::new_paginator(token, execute)
9685        }
9686
9687        /// Streams each item in the collection.
9688        pub fn by_item(
9689            self,
9690        ) -> impl google_cloud_gax::paginator::ItemPaginator<
9691            google_cloud_location::model::ListLocationsResponse,
9692            crate::Error,
9693        > {
9694            use google_cloud_gax::paginator::Paginator;
9695            self.by_page().items()
9696        }
9697
9698        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
9699        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9700            self.0.request.name = v.into();
9701            self
9702        }
9703
9704        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
9705        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
9706            self.0.request.filter = v.into();
9707            self
9708        }
9709
9710        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
9711        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
9712            self.0.request.page_size = v.into();
9713            self
9714        }
9715
9716        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
9717        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
9718            self.0.request.page_token = v.into();
9719            self
9720        }
9721    }
9722
9723    #[doc(hidden)]
9724    impl crate::RequestBuilder for ListLocations {
9725        fn request_options(&mut self) -> &mut crate::RequestOptions {
9726            &mut self.0.options
9727        }
9728    }
9729
9730    /// The request builder for [InternalRangeService::get_location][crate::client::InternalRangeService::get_location] calls.
9731    ///
9732    /// # Example
9733    /// ```
9734    /// # use google_cloud_networkconnectivity_v1::builder::internal_range_service::GetLocation;
9735    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
9736    ///
9737    /// let builder = prepare_request_builder();
9738    /// let response = builder.send().await?;
9739    /// # Ok(()) }
9740    ///
9741    /// fn prepare_request_builder() -> GetLocation {
9742    ///   # panic!();
9743    ///   // ... details omitted ...
9744    /// }
9745    /// ```
9746    #[derive(Clone, Debug)]
9747    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
9748
9749    impl GetLocation {
9750        pub(crate) fn new(
9751            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9752        ) -> Self {
9753            Self(RequestBuilder::new(stub))
9754        }
9755
9756        /// Sets the full request, replacing any prior values.
9757        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
9758            mut self,
9759            v: V,
9760        ) -> Self {
9761            self.0.request = v.into();
9762            self
9763        }
9764
9765        /// Sets all the options, replacing any prior values.
9766        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9767            self.0.options = v.into();
9768            self
9769        }
9770
9771        /// Sends the request.
9772        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
9773            (*self.0.stub)
9774                .get_location(self.0.request, self.0.options)
9775                .await
9776                .map(crate::Response::into_body)
9777        }
9778
9779        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
9780        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9781            self.0.request.name = v.into();
9782            self
9783        }
9784    }
9785
9786    #[doc(hidden)]
9787    impl crate::RequestBuilder for GetLocation {
9788        fn request_options(&mut self) -> &mut crate::RequestOptions {
9789            &mut self.0.options
9790        }
9791    }
9792
9793    /// The request builder for [InternalRangeService::set_iam_policy][crate::client::InternalRangeService::set_iam_policy] calls.
9794    ///
9795    /// # Example
9796    /// ```
9797    /// # use google_cloud_networkconnectivity_v1::builder::internal_range_service::SetIamPolicy;
9798    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
9799    ///
9800    /// let builder = prepare_request_builder();
9801    /// let response = builder.send().await?;
9802    /// # Ok(()) }
9803    ///
9804    /// fn prepare_request_builder() -> SetIamPolicy {
9805    ///   # panic!();
9806    ///   // ... details omitted ...
9807    /// }
9808    /// ```
9809    #[derive(Clone, Debug)]
9810    pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
9811
9812    impl SetIamPolicy {
9813        pub(crate) fn new(
9814            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9815        ) -> Self {
9816            Self(RequestBuilder::new(stub))
9817        }
9818
9819        /// Sets the full request, replacing any prior values.
9820        pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
9821            mut self,
9822            v: V,
9823        ) -> Self {
9824            self.0.request = v.into();
9825            self
9826        }
9827
9828        /// Sets all the options, replacing any prior values.
9829        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9830            self.0.options = v.into();
9831            self
9832        }
9833
9834        /// Sends the request.
9835        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
9836            (*self.0.stub)
9837                .set_iam_policy(self.0.request, self.0.options)
9838                .await
9839                .map(crate::Response::into_body)
9840        }
9841
9842        /// Sets the value of [resource][google_cloud_iam_v1::model::SetIamPolicyRequest::resource].
9843        ///
9844        /// This is a **required** field for requests.
9845        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
9846            self.0.request.resource = v.into();
9847            self
9848        }
9849
9850        /// Sets the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
9851        ///
9852        /// This is a **required** field for requests.
9853        pub fn set_policy<T>(mut self, v: T) -> Self
9854        where
9855            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
9856        {
9857            self.0.request.policy = std::option::Option::Some(v.into());
9858            self
9859        }
9860
9861        /// Sets or clears the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
9862        ///
9863        /// This is a **required** field for requests.
9864        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
9865        where
9866            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
9867        {
9868            self.0.request.policy = v.map(|x| x.into());
9869            self
9870        }
9871
9872        /// Sets the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
9873        pub fn set_update_mask<T>(mut self, v: T) -> Self
9874        where
9875            T: std::convert::Into<wkt::FieldMask>,
9876        {
9877            self.0.request.update_mask = std::option::Option::Some(v.into());
9878            self
9879        }
9880
9881        /// Sets or clears the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
9882        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
9883        where
9884            T: std::convert::Into<wkt::FieldMask>,
9885        {
9886            self.0.request.update_mask = v.map(|x| x.into());
9887            self
9888        }
9889    }
9890
9891    #[doc(hidden)]
9892    impl crate::RequestBuilder for SetIamPolicy {
9893        fn request_options(&mut self) -> &mut crate::RequestOptions {
9894            &mut self.0.options
9895        }
9896    }
9897
9898    /// The request builder for [InternalRangeService::get_iam_policy][crate::client::InternalRangeService::get_iam_policy] calls.
9899    ///
9900    /// # Example
9901    /// ```
9902    /// # use google_cloud_networkconnectivity_v1::builder::internal_range_service::GetIamPolicy;
9903    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
9904    ///
9905    /// let builder = prepare_request_builder();
9906    /// let response = builder.send().await?;
9907    /// # Ok(()) }
9908    ///
9909    /// fn prepare_request_builder() -> GetIamPolicy {
9910    ///   # panic!();
9911    ///   // ... details omitted ...
9912    /// }
9913    /// ```
9914    #[derive(Clone, Debug)]
9915    pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
9916
9917    impl GetIamPolicy {
9918        pub(crate) fn new(
9919            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9920        ) -> Self {
9921            Self(RequestBuilder::new(stub))
9922        }
9923
9924        /// Sets the full request, replacing any prior values.
9925        pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
9926            mut self,
9927            v: V,
9928        ) -> Self {
9929            self.0.request = v.into();
9930            self
9931        }
9932
9933        /// Sets all the options, replacing any prior values.
9934        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9935            self.0.options = v.into();
9936            self
9937        }
9938
9939        /// Sends the request.
9940        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
9941            (*self.0.stub)
9942                .get_iam_policy(self.0.request, self.0.options)
9943                .await
9944                .map(crate::Response::into_body)
9945        }
9946
9947        /// Sets the value of [resource][google_cloud_iam_v1::model::GetIamPolicyRequest::resource].
9948        ///
9949        /// This is a **required** field for requests.
9950        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
9951            self.0.request.resource = v.into();
9952            self
9953        }
9954
9955        /// Sets the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
9956        pub fn set_options<T>(mut self, v: T) -> Self
9957        where
9958            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
9959        {
9960            self.0.request.options = std::option::Option::Some(v.into());
9961            self
9962        }
9963
9964        /// Sets or clears the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
9965        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
9966        where
9967            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
9968        {
9969            self.0.request.options = v.map(|x| x.into());
9970            self
9971        }
9972    }
9973
9974    #[doc(hidden)]
9975    impl crate::RequestBuilder for GetIamPolicy {
9976        fn request_options(&mut self) -> &mut crate::RequestOptions {
9977            &mut self.0.options
9978        }
9979    }
9980
9981    /// The request builder for [InternalRangeService::test_iam_permissions][crate::client::InternalRangeService::test_iam_permissions] calls.
9982    ///
9983    /// # Example
9984    /// ```
9985    /// # use google_cloud_networkconnectivity_v1::builder::internal_range_service::TestIamPermissions;
9986    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
9987    ///
9988    /// let builder = prepare_request_builder();
9989    /// let response = builder.send().await?;
9990    /// # Ok(()) }
9991    ///
9992    /// fn prepare_request_builder() -> TestIamPermissions {
9993    ///   # panic!();
9994    ///   // ... details omitted ...
9995    /// }
9996    /// ```
9997    #[derive(Clone, Debug)]
9998    pub struct TestIamPermissions(
9999        RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
10000    );
10001
10002    impl TestIamPermissions {
10003        pub(crate) fn new(
10004            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
10005        ) -> Self {
10006            Self(RequestBuilder::new(stub))
10007        }
10008
10009        /// Sets the full request, replacing any prior values.
10010        pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
10011            mut self,
10012            v: V,
10013        ) -> Self {
10014            self.0.request = v.into();
10015            self
10016        }
10017
10018        /// Sets all the options, replacing any prior values.
10019        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10020            self.0.options = v.into();
10021            self
10022        }
10023
10024        /// Sends the request.
10025        pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
10026            (*self.0.stub)
10027                .test_iam_permissions(self.0.request, self.0.options)
10028                .await
10029                .map(crate::Response::into_body)
10030        }
10031
10032        /// Sets the value of [resource][google_cloud_iam_v1::model::TestIamPermissionsRequest::resource].
10033        ///
10034        /// This is a **required** field for requests.
10035        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
10036            self.0.request.resource = v.into();
10037            self
10038        }
10039
10040        /// Sets the value of [permissions][google_cloud_iam_v1::model::TestIamPermissionsRequest::permissions].
10041        ///
10042        /// This is a **required** field for requests.
10043        pub fn set_permissions<T, V>(mut self, v: T) -> Self
10044        where
10045            T: std::iter::IntoIterator<Item = V>,
10046            V: std::convert::Into<std::string::String>,
10047        {
10048            use std::iter::Iterator;
10049            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
10050            self
10051        }
10052    }
10053
10054    #[doc(hidden)]
10055    impl crate::RequestBuilder for TestIamPermissions {
10056        fn request_options(&mut self) -> &mut crate::RequestOptions {
10057            &mut self.0.options
10058        }
10059    }
10060
10061    /// The request builder for [InternalRangeService::list_operations][crate::client::InternalRangeService::list_operations] calls.
10062    ///
10063    /// # Example
10064    /// ```
10065    /// # use google_cloud_networkconnectivity_v1::builder::internal_range_service::ListOperations;
10066    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
10067    /// use google_cloud_gax::paginator::ItemPaginator;
10068    ///
10069    /// let builder = prepare_request_builder();
10070    /// let mut items = builder.by_item();
10071    /// while let Some(result) = items.next().await {
10072    ///   let item = result?;
10073    /// }
10074    /// # Ok(()) }
10075    ///
10076    /// fn prepare_request_builder() -> ListOperations {
10077    ///   # panic!();
10078    ///   // ... details omitted ...
10079    /// }
10080    /// ```
10081    #[derive(Clone, Debug)]
10082    pub struct ListOperations(
10083        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
10084    );
10085
10086    impl ListOperations {
10087        pub(crate) fn new(
10088            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
10089        ) -> Self {
10090            Self(RequestBuilder::new(stub))
10091        }
10092
10093        /// Sets the full request, replacing any prior values.
10094        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
10095            mut self,
10096            v: V,
10097        ) -> Self {
10098            self.0.request = v.into();
10099            self
10100        }
10101
10102        /// Sets all the options, replacing any prior values.
10103        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10104            self.0.options = v.into();
10105            self
10106        }
10107
10108        /// Sends the request.
10109        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
10110            (*self.0.stub)
10111                .list_operations(self.0.request, self.0.options)
10112                .await
10113                .map(crate::Response::into_body)
10114        }
10115
10116        /// Streams each page in the collection.
10117        pub fn by_page(
10118            self,
10119        ) -> impl google_cloud_gax::paginator::Paginator<
10120            google_cloud_longrunning::model::ListOperationsResponse,
10121            crate::Error,
10122        > {
10123            use std::clone::Clone;
10124            let token = self.0.request.page_token.clone();
10125            let execute = move |token: String| {
10126                let mut builder = self.clone();
10127                builder.0.request = builder.0.request.set_page_token(token);
10128                builder.send()
10129            };
10130            google_cloud_gax::paginator::internal::new_paginator(token, execute)
10131        }
10132
10133        /// Streams each item in the collection.
10134        pub fn by_item(
10135            self,
10136        ) -> impl google_cloud_gax::paginator::ItemPaginator<
10137            google_cloud_longrunning::model::ListOperationsResponse,
10138            crate::Error,
10139        > {
10140            use google_cloud_gax::paginator::Paginator;
10141            self.by_page().items()
10142        }
10143
10144        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
10145        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10146            self.0.request.name = v.into();
10147            self
10148        }
10149
10150        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
10151        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
10152            self.0.request.filter = v.into();
10153            self
10154        }
10155
10156        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
10157        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
10158            self.0.request.page_size = v.into();
10159            self
10160        }
10161
10162        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
10163        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
10164            self.0.request.page_token = v.into();
10165            self
10166        }
10167
10168        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
10169        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
10170            self.0.request.return_partial_success = v.into();
10171            self
10172        }
10173    }
10174
10175    #[doc(hidden)]
10176    impl crate::RequestBuilder for ListOperations {
10177        fn request_options(&mut self) -> &mut crate::RequestOptions {
10178            &mut self.0.options
10179        }
10180    }
10181
10182    /// The request builder for [InternalRangeService::get_operation][crate::client::InternalRangeService::get_operation] calls.
10183    ///
10184    /// # Example
10185    /// ```
10186    /// # use google_cloud_networkconnectivity_v1::builder::internal_range_service::GetOperation;
10187    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
10188    ///
10189    /// let builder = prepare_request_builder();
10190    /// let response = builder.send().await?;
10191    /// # Ok(()) }
10192    ///
10193    /// fn prepare_request_builder() -> GetOperation {
10194    ///   # panic!();
10195    ///   // ... details omitted ...
10196    /// }
10197    /// ```
10198    #[derive(Clone, Debug)]
10199    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
10200
10201    impl GetOperation {
10202        pub(crate) fn new(
10203            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
10204        ) -> Self {
10205            Self(RequestBuilder::new(stub))
10206        }
10207
10208        /// Sets the full request, replacing any prior values.
10209        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
10210            mut self,
10211            v: V,
10212        ) -> Self {
10213            self.0.request = v.into();
10214            self
10215        }
10216
10217        /// Sets all the options, replacing any prior values.
10218        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10219            self.0.options = v.into();
10220            self
10221        }
10222
10223        /// Sends the request.
10224        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
10225            (*self.0.stub)
10226                .get_operation(self.0.request, self.0.options)
10227                .await
10228                .map(crate::Response::into_body)
10229        }
10230
10231        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
10232        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10233            self.0.request.name = v.into();
10234            self
10235        }
10236    }
10237
10238    #[doc(hidden)]
10239    impl crate::RequestBuilder for GetOperation {
10240        fn request_options(&mut self) -> &mut crate::RequestOptions {
10241            &mut self.0.options
10242        }
10243    }
10244
10245    /// The request builder for [InternalRangeService::delete_operation][crate::client::InternalRangeService::delete_operation] calls.
10246    ///
10247    /// # Example
10248    /// ```
10249    /// # use google_cloud_networkconnectivity_v1::builder::internal_range_service::DeleteOperation;
10250    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
10251    ///
10252    /// let builder = prepare_request_builder();
10253    /// let response = builder.send().await?;
10254    /// # Ok(()) }
10255    ///
10256    /// fn prepare_request_builder() -> DeleteOperation {
10257    ///   # panic!();
10258    ///   // ... details omitted ...
10259    /// }
10260    /// ```
10261    #[derive(Clone, Debug)]
10262    pub struct DeleteOperation(
10263        RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
10264    );
10265
10266    impl DeleteOperation {
10267        pub(crate) fn new(
10268            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
10269        ) -> Self {
10270            Self(RequestBuilder::new(stub))
10271        }
10272
10273        /// Sets the full request, replacing any prior values.
10274        pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
10275            mut self,
10276            v: V,
10277        ) -> Self {
10278            self.0.request = v.into();
10279            self
10280        }
10281
10282        /// Sets all the options, replacing any prior values.
10283        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10284            self.0.options = v.into();
10285            self
10286        }
10287
10288        /// Sends the request.
10289        pub async fn send(self) -> Result<()> {
10290            (*self.0.stub)
10291                .delete_operation(self.0.request, self.0.options)
10292                .await
10293                .map(crate::Response::into_body)
10294        }
10295
10296        /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
10297        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10298            self.0.request.name = v.into();
10299            self
10300        }
10301    }
10302
10303    #[doc(hidden)]
10304    impl crate::RequestBuilder for DeleteOperation {
10305        fn request_options(&mut self) -> &mut crate::RequestOptions {
10306            &mut self.0.options
10307        }
10308    }
10309
10310    /// The request builder for [InternalRangeService::cancel_operation][crate::client::InternalRangeService::cancel_operation] calls.
10311    ///
10312    /// # Example
10313    /// ```
10314    /// # use google_cloud_networkconnectivity_v1::builder::internal_range_service::CancelOperation;
10315    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
10316    ///
10317    /// let builder = prepare_request_builder();
10318    /// let response = builder.send().await?;
10319    /// # Ok(()) }
10320    ///
10321    /// fn prepare_request_builder() -> CancelOperation {
10322    ///   # panic!();
10323    ///   // ... details omitted ...
10324    /// }
10325    /// ```
10326    #[derive(Clone, Debug)]
10327    pub struct CancelOperation(
10328        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
10329    );
10330
10331    impl CancelOperation {
10332        pub(crate) fn new(
10333            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
10334        ) -> Self {
10335            Self(RequestBuilder::new(stub))
10336        }
10337
10338        /// Sets the full request, replacing any prior values.
10339        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
10340            mut self,
10341            v: V,
10342        ) -> Self {
10343            self.0.request = v.into();
10344            self
10345        }
10346
10347        /// Sets all the options, replacing any prior values.
10348        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10349            self.0.options = v.into();
10350            self
10351        }
10352
10353        /// Sends the request.
10354        pub async fn send(self) -> Result<()> {
10355            (*self.0.stub)
10356                .cancel_operation(self.0.request, self.0.options)
10357                .await
10358                .map(crate::Response::into_body)
10359        }
10360
10361        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
10362        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10363            self.0.request.name = v.into();
10364            self
10365        }
10366    }
10367
10368    #[doc(hidden)]
10369    impl crate::RequestBuilder for CancelOperation {
10370        fn request_options(&mut self) -> &mut crate::RequestOptions {
10371            &mut self.0.options
10372        }
10373    }
10374}
10375
10376/// Request and client builders for [PolicyBasedRoutingService][crate::client::PolicyBasedRoutingService].
10377pub mod policy_based_routing_service {
10378    use crate::Result;
10379
10380    /// A builder for [PolicyBasedRoutingService][crate::client::PolicyBasedRoutingService].
10381    ///
10382    /// ```
10383    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
10384    /// # use google_cloud_networkconnectivity_v1::*;
10385    /// # use builder::policy_based_routing_service::ClientBuilder;
10386    /// # use client::PolicyBasedRoutingService;
10387    /// let builder : ClientBuilder = PolicyBasedRoutingService::builder();
10388    /// let client = builder
10389    ///     .with_endpoint("https://networkconnectivity.googleapis.com")
10390    ///     .build().await?;
10391    /// # Ok(()) }
10392    /// ```
10393    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
10394
10395    pub(crate) mod client {
10396        use super::super::super::client::PolicyBasedRoutingService;
10397        pub struct Factory;
10398        impl crate::ClientFactory for Factory {
10399            type Client = PolicyBasedRoutingService;
10400            type Credentials = gaxi::options::Credentials;
10401            async fn build(
10402                self,
10403                config: gaxi::options::ClientConfig,
10404            ) -> crate::ClientBuilderResult<Self::Client> {
10405                Self::Client::new(config).await
10406            }
10407        }
10408    }
10409
10410    /// Common implementation for [crate::client::PolicyBasedRoutingService] request builders.
10411    #[derive(Clone, Debug)]
10412    pub(crate) struct RequestBuilder<R: std::default::Default> {
10413        stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10414        request: R,
10415        options: crate::RequestOptions,
10416    }
10417
10418    impl<R> RequestBuilder<R>
10419    where
10420        R: std::default::Default,
10421    {
10422        pub(crate) fn new(
10423            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10424        ) -> Self {
10425            Self {
10426                stub,
10427                request: R::default(),
10428                options: crate::RequestOptions::default(),
10429            }
10430        }
10431    }
10432
10433    /// The request builder for [PolicyBasedRoutingService::list_policy_based_routes][crate::client::PolicyBasedRoutingService::list_policy_based_routes] calls.
10434    ///
10435    /// # Example
10436    /// ```
10437    /// # use google_cloud_networkconnectivity_v1::builder::policy_based_routing_service::ListPolicyBasedRoutes;
10438    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
10439    /// use google_cloud_gax::paginator::ItemPaginator;
10440    ///
10441    /// let builder = prepare_request_builder();
10442    /// let mut items = builder.by_item();
10443    /// while let Some(result) = items.next().await {
10444    ///   let item = result?;
10445    /// }
10446    /// # Ok(()) }
10447    ///
10448    /// fn prepare_request_builder() -> ListPolicyBasedRoutes {
10449    ///   # panic!();
10450    ///   // ... details omitted ...
10451    /// }
10452    /// ```
10453    #[derive(Clone, Debug)]
10454    pub struct ListPolicyBasedRoutes(RequestBuilder<crate::model::ListPolicyBasedRoutesRequest>);
10455
10456    impl ListPolicyBasedRoutes {
10457        pub(crate) fn new(
10458            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10459        ) -> Self {
10460            Self(RequestBuilder::new(stub))
10461        }
10462
10463        /// Sets the full request, replacing any prior values.
10464        pub fn with_request<V: Into<crate::model::ListPolicyBasedRoutesRequest>>(
10465            mut self,
10466            v: V,
10467        ) -> Self {
10468            self.0.request = v.into();
10469            self
10470        }
10471
10472        /// Sets all the options, replacing any prior values.
10473        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10474            self.0.options = v.into();
10475            self
10476        }
10477
10478        /// Sends the request.
10479        pub async fn send(self) -> Result<crate::model::ListPolicyBasedRoutesResponse> {
10480            (*self.0.stub)
10481                .list_policy_based_routes(self.0.request, self.0.options)
10482                .await
10483                .map(crate::Response::into_body)
10484        }
10485
10486        /// Streams each page in the collection.
10487        pub fn by_page(
10488            self,
10489        ) -> impl google_cloud_gax::paginator::Paginator<
10490            crate::model::ListPolicyBasedRoutesResponse,
10491            crate::Error,
10492        > {
10493            use std::clone::Clone;
10494            let token = self.0.request.page_token.clone();
10495            let execute = move |token: String| {
10496                let mut builder = self.clone();
10497                builder.0.request = builder.0.request.set_page_token(token);
10498                builder.send()
10499            };
10500            google_cloud_gax::paginator::internal::new_paginator(token, execute)
10501        }
10502
10503        /// Streams each item in the collection.
10504        pub fn by_item(
10505            self,
10506        ) -> impl google_cloud_gax::paginator::ItemPaginator<
10507            crate::model::ListPolicyBasedRoutesResponse,
10508            crate::Error,
10509        > {
10510            use google_cloud_gax::paginator::Paginator;
10511            self.by_page().items()
10512        }
10513
10514        /// Sets the value of [parent][crate::model::ListPolicyBasedRoutesRequest::parent].
10515        ///
10516        /// This is a **required** field for requests.
10517        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
10518            self.0.request.parent = v.into();
10519            self
10520        }
10521
10522        /// Sets the value of [page_size][crate::model::ListPolicyBasedRoutesRequest::page_size].
10523        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
10524            self.0.request.page_size = v.into();
10525            self
10526        }
10527
10528        /// Sets the value of [page_token][crate::model::ListPolicyBasedRoutesRequest::page_token].
10529        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
10530            self.0.request.page_token = v.into();
10531            self
10532        }
10533
10534        /// Sets the value of [filter][crate::model::ListPolicyBasedRoutesRequest::filter].
10535        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
10536            self.0.request.filter = v.into();
10537            self
10538        }
10539
10540        /// Sets the value of [order_by][crate::model::ListPolicyBasedRoutesRequest::order_by].
10541        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
10542            self.0.request.order_by = v.into();
10543            self
10544        }
10545    }
10546
10547    #[doc(hidden)]
10548    impl crate::RequestBuilder for ListPolicyBasedRoutes {
10549        fn request_options(&mut self) -> &mut crate::RequestOptions {
10550            &mut self.0.options
10551        }
10552    }
10553
10554    /// The request builder for [PolicyBasedRoutingService::get_policy_based_route][crate::client::PolicyBasedRoutingService::get_policy_based_route] calls.
10555    ///
10556    /// # Example
10557    /// ```
10558    /// # use google_cloud_networkconnectivity_v1::builder::policy_based_routing_service::GetPolicyBasedRoute;
10559    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
10560    ///
10561    /// let builder = prepare_request_builder();
10562    /// let response = builder.send().await?;
10563    /// # Ok(()) }
10564    ///
10565    /// fn prepare_request_builder() -> GetPolicyBasedRoute {
10566    ///   # panic!();
10567    ///   // ... details omitted ...
10568    /// }
10569    /// ```
10570    #[derive(Clone, Debug)]
10571    pub struct GetPolicyBasedRoute(RequestBuilder<crate::model::GetPolicyBasedRouteRequest>);
10572
10573    impl GetPolicyBasedRoute {
10574        pub(crate) fn new(
10575            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10576        ) -> Self {
10577            Self(RequestBuilder::new(stub))
10578        }
10579
10580        /// Sets the full request, replacing any prior values.
10581        pub fn with_request<V: Into<crate::model::GetPolicyBasedRouteRequest>>(
10582            mut self,
10583            v: V,
10584        ) -> Self {
10585            self.0.request = v.into();
10586            self
10587        }
10588
10589        /// Sets all the options, replacing any prior values.
10590        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10591            self.0.options = v.into();
10592            self
10593        }
10594
10595        /// Sends the request.
10596        pub async fn send(self) -> Result<crate::model::PolicyBasedRoute> {
10597            (*self.0.stub)
10598                .get_policy_based_route(self.0.request, self.0.options)
10599                .await
10600                .map(crate::Response::into_body)
10601        }
10602
10603        /// Sets the value of [name][crate::model::GetPolicyBasedRouteRequest::name].
10604        ///
10605        /// This is a **required** field for requests.
10606        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10607            self.0.request.name = v.into();
10608            self
10609        }
10610    }
10611
10612    #[doc(hidden)]
10613    impl crate::RequestBuilder for GetPolicyBasedRoute {
10614        fn request_options(&mut self) -> &mut crate::RequestOptions {
10615            &mut self.0.options
10616        }
10617    }
10618
10619    /// The request builder for [PolicyBasedRoutingService::create_policy_based_route][crate::client::PolicyBasedRoutingService::create_policy_based_route] calls.
10620    ///
10621    /// # Example
10622    /// ```
10623    /// # use google_cloud_networkconnectivity_v1::builder::policy_based_routing_service::CreatePolicyBasedRoute;
10624    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
10625    /// use google_cloud_lro::Poller;
10626    ///
10627    /// let builder = prepare_request_builder();
10628    /// let response = builder.poller().until_done().await?;
10629    /// # Ok(()) }
10630    ///
10631    /// fn prepare_request_builder() -> CreatePolicyBasedRoute {
10632    ///   # panic!();
10633    ///   // ... details omitted ...
10634    /// }
10635    /// ```
10636    #[derive(Clone, Debug)]
10637    pub struct CreatePolicyBasedRoute(RequestBuilder<crate::model::CreatePolicyBasedRouteRequest>);
10638
10639    impl CreatePolicyBasedRoute {
10640        pub(crate) fn new(
10641            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10642        ) -> Self {
10643            Self(RequestBuilder::new(stub))
10644        }
10645
10646        /// Sets the full request, replacing any prior values.
10647        pub fn with_request<V: Into<crate::model::CreatePolicyBasedRouteRequest>>(
10648            mut self,
10649            v: V,
10650        ) -> Self {
10651            self.0.request = v.into();
10652            self
10653        }
10654
10655        /// Sets all the options, replacing any prior values.
10656        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10657            self.0.options = v.into();
10658            self
10659        }
10660
10661        /// Sends the request.
10662        ///
10663        /// # Long running operations
10664        ///
10665        /// This starts, but does not poll, a longrunning operation. More information
10666        /// on [create_policy_based_route][crate::client::PolicyBasedRoutingService::create_policy_based_route].
10667        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
10668            (*self.0.stub)
10669                .create_policy_based_route(self.0.request, self.0.options)
10670                .await
10671                .map(crate::Response::into_body)
10672        }
10673
10674        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_policy_based_route`.
10675        pub fn poller(
10676            self,
10677        ) -> impl google_cloud_lro::Poller<crate::model::PolicyBasedRoute, crate::model::OperationMetadata>
10678        {
10679            type Operation = google_cloud_lro::internal::Operation<
10680                crate::model::PolicyBasedRoute,
10681                crate::model::OperationMetadata,
10682            >;
10683            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
10684            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
10685            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
10686            if let Some(ref mut details) = poller_options.tracing {
10687                details.method_name = "google_cloud_networkconnectivity_v1::client::PolicyBasedRoutingService::create_policy_based_route::until_done";
10688            }
10689
10690            let stub = self.0.stub.clone();
10691            let mut options = self.0.options.clone();
10692            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
10693            let query = move |name| {
10694                let stub = stub.clone();
10695                let options = options.clone();
10696                async {
10697                    let op = GetOperation::new(stub)
10698                        .set_name(name)
10699                        .with_options(options)
10700                        .send()
10701                        .await?;
10702                    Ok(Operation::new(op))
10703                }
10704            };
10705
10706            let start = move || async {
10707                let op = self.send().await?;
10708                Ok(Operation::new(op))
10709            };
10710
10711            use google_cloud_lro::internal::PollerExt;
10712            {
10713                google_cloud_lro::internal::new_poller(
10714                    polling_error_policy,
10715                    polling_backoff_policy,
10716                    start,
10717                    query,
10718                )
10719            }
10720            .with_options(poller_options)
10721        }
10722
10723        /// Sets the value of [parent][crate::model::CreatePolicyBasedRouteRequest::parent].
10724        ///
10725        /// This is a **required** field for requests.
10726        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
10727            self.0.request.parent = v.into();
10728            self
10729        }
10730
10731        /// Sets the value of [policy_based_route_id][crate::model::CreatePolicyBasedRouteRequest::policy_based_route_id].
10732        ///
10733        /// This is a **required** field for requests.
10734        pub fn set_policy_based_route_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
10735            self.0.request.policy_based_route_id = v.into();
10736            self
10737        }
10738
10739        /// Sets the value of [policy_based_route][crate::model::CreatePolicyBasedRouteRequest::policy_based_route].
10740        ///
10741        /// This is a **required** field for requests.
10742        pub fn set_policy_based_route<T>(mut self, v: T) -> Self
10743        where
10744            T: std::convert::Into<crate::model::PolicyBasedRoute>,
10745        {
10746            self.0.request.policy_based_route = std::option::Option::Some(v.into());
10747            self
10748        }
10749
10750        /// Sets or clears the value of [policy_based_route][crate::model::CreatePolicyBasedRouteRequest::policy_based_route].
10751        ///
10752        /// This is a **required** field for requests.
10753        pub fn set_or_clear_policy_based_route<T>(mut self, v: std::option::Option<T>) -> Self
10754        where
10755            T: std::convert::Into<crate::model::PolicyBasedRoute>,
10756        {
10757            self.0.request.policy_based_route = v.map(|x| x.into());
10758            self
10759        }
10760
10761        /// Sets the value of [request_id][crate::model::CreatePolicyBasedRouteRequest::request_id].
10762        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
10763            self.0.request.request_id = v.into();
10764            self
10765        }
10766    }
10767
10768    #[doc(hidden)]
10769    impl crate::RequestBuilder for CreatePolicyBasedRoute {
10770        fn request_options(&mut self) -> &mut crate::RequestOptions {
10771            &mut self.0.options
10772        }
10773    }
10774
10775    /// The request builder for [PolicyBasedRoutingService::delete_policy_based_route][crate::client::PolicyBasedRoutingService::delete_policy_based_route] calls.
10776    ///
10777    /// # Example
10778    /// ```
10779    /// # use google_cloud_networkconnectivity_v1::builder::policy_based_routing_service::DeletePolicyBasedRoute;
10780    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
10781    /// use google_cloud_lro::Poller;
10782    ///
10783    /// let builder = prepare_request_builder();
10784    /// let response = builder.poller().until_done().await?;
10785    /// # Ok(()) }
10786    ///
10787    /// fn prepare_request_builder() -> DeletePolicyBasedRoute {
10788    ///   # panic!();
10789    ///   // ... details omitted ...
10790    /// }
10791    /// ```
10792    #[derive(Clone, Debug)]
10793    pub struct DeletePolicyBasedRoute(RequestBuilder<crate::model::DeletePolicyBasedRouteRequest>);
10794
10795    impl DeletePolicyBasedRoute {
10796        pub(crate) fn new(
10797            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10798        ) -> Self {
10799            Self(RequestBuilder::new(stub))
10800        }
10801
10802        /// Sets the full request, replacing any prior values.
10803        pub fn with_request<V: Into<crate::model::DeletePolicyBasedRouteRequest>>(
10804            mut self,
10805            v: V,
10806        ) -> Self {
10807            self.0.request = v.into();
10808            self
10809        }
10810
10811        /// Sets all the options, replacing any prior values.
10812        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10813            self.0.options = v.into();
10814            self
10815        }
10816
10817        /// Sends the request.
10818        ///
10819        /// # Long running operations
10820        ///
10821        /// This starts, but does not poll, a longrunning operation. More information
10822        /// on [delete_policy_based_route][crate::client::PolicyBasedRoutingService::delete_policy_based_route].
10823        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
10824            (*self.0.stub)
10825                .delete_policy_based_route(self.0.request, self.0.options)
10826                .await
10827                .map(crate::Response::into_body)
10828        }
10829
10830        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_policy_based_route`.
10831        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
10832            type Operation =
10833                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
10834            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
10835            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
10836            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
10837            if let Some(ref mut details) = poller_options.tracing {
10838                details.method_name = "google_cloud_networkconnectivity_v1::client::PolicyBasedRoutingService::delete_policy_based_route::until_done";
10839            }
10840
10841            let stub = self.0.stub.clone();
10842            let mut options = self.0.options.clone();
10843            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
10844            let query = move |name| {
10845                let stub = stub.clone();
10846                let options = options.clone();
10847                async {
10848                    let op = GetOperation::new(stub)
10849                        .set_name(name)
10850                        .with_options(options)
10851                        .send()
10852                        .await?;
10853                    Ok(Operation::new(op))
10854                }
10855            };
10856
10857            let start = move || async {
10858                let op = self.send().await?;
10859                Ok(Operation::new(op))
10860            };
10861
10862            use google_cloud_lro::internal::PollerExt;
10863            {
10864                google_cloud_lro::internal::new_unit_response_poller(
10865                    polling_error_policy,
10866                    polling_backoff_policy,
10867                    start,
10868                    query,
10869                )
10870            }
10871            .with_options(poller_options)
10872        }
10873
10874        /// Sets the value of [name][crate::model::DeletePolicyBasedRouteRequest::name].
10875        ///
10876        /// This is a **required** field for requests.
10877        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10878            self.0.request.name = v.into();
10879            self
10880        }
10881
10882        /// Sets the value of [request_id][crate::model::DeletePolicyBasedRouteRequest::request_id].
10883        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
10884            self.0.request.request_id = v.into();
10885            self
10886        }
10887    }
10888
10889    #[doc(hidden)]
10890    impl crate::RequestBuilder for DeletePolicyBasedRoute {
10891        fn request_options(&mut self) -> &mut crate::RequestOptions {
10892            &mut self.0.options
10893        }
10894    }
10895
10896    /// The request builder for [PolicyBasedRoutingService::list_locations][crate::client::PolicyBasedRoutingService::list_locations] calls.
10897    ///
10898    /// # Example
10899    /// ```
10900    /// # use google_cloud_networkconnectivity_v1::builder::policy_based_routing_service::ListLocations;
10901    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
10902    /// use google_cloud_gax::paginator::ItemPaginator;
10903    ///
10904    /// let builder = prepare_request_builder();
10905    /// let mut items = builder.by_item();
10906    /// while let Some(result) = items.next().await {
10907    ///   let item = result?;
10908    /// }
10909    /// # Ok(()) }
10910    ///
10911    /// fn prepare_request_builder() -> ListLocations {
10912    ///   # panic!();
10913    ///   // ... details omitted ...
10914    /// }
10915    /// ```
10916    #[derive(Clone, Debug)]
10917    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
10918
10919    impl ListLocations {
10920        pub(crate) fn new(
10921            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10922        ) -> Self {
10923            Self(RequestBuilder::new(stub))
10924        }
10925
10926        /// Sets the full request, replacing any prior values.
10927        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
10928            mut self,
10929            v: V,
10930        ) -> Self {
10931            self.0.request = v.into();
10932            self
10933        }
10934
10935        /// Sets all the options, replacing any prior values.
10936        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10937            self.0.options = v.into();
10938            self
10939        }
10940
10941        /// Sends the request.
10942        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
10943            (*self.0.stub)
10944                .list_locations(self.0.request, self.0.options)
10945                .await
10946                .map(crate::Response::into_body)
10947        }
10948
10949        /// Streams each page in the collection.
10950        pub fn by_page(
10951            self,
10952        ) -> impl google_cloud_gax::paginator::Paginator<
10953            google_cloud_location::model::ListLocationsResponse,
10954            crate::Error,
10955        > {
10956            use std::clone::Clone;
10957            let token = self.0.request.page_token.clone();
10958            let execute = move |token: String| {
10959                let mut builder = self.clone();
10960                builder.0.request = builder.0.request.set_page_token(token);
10961                builder.send()
10962            };
10963            google_cloud_gax::paginator::internal::new_paginator(token, execute)
10964        }
10965
10966        /// Streams each item in the collection.
10967        pub fn by_item(
10968            self,
10969        ) -> impl google_cloud_gax::paginator::ItemPaginator<
10970            google_cloud_location::model::ListLocationsResponse,
10971            crate::Error,
10972        > {
10973            use google_cloud_gax::paginator::Paginator;
10974            self.by_page().items()
10975        }
10976
10977        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
10978        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10979            self.0.request.name = v.into();
10980            self
10981        }
10982
10983        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
10984        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
10985            self.0.request.filter = v.into();
10986            self
10987        }
10988
10989        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
10990        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
10991            self.0.request.page_size = v.into();
10992            self
10993        }
10994
10995        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
10996        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
10997            self.0.request.page_token = v.into();
10998            self
10999        }
11000    }
11001
11002    #[doc(hidden)]
11003    impl crate::RequestBuilder for ListLocations {
11004        fn request_options(&mut self) -> &mut crate::RequestOptions {
11005            &mut self.0.options
11006        }
11007    }
11008
11009    /// The request builder for [PolicyBasedRoutingService::get_location][crate::client::PolicyBasedRoutingService::get_location] calls.
11010    ///
11011    /// # Example
11012    /// ```
11013    /// # use google_cloud_networkconnectivity_v1::builder::policy_based_routing_service::GetLocation;
11014    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
11015    ///
11016    /// let builder = prepare_request_builder();
11017    /// let response = builder.send().await?;
11018    /// # Ok(()) }
11019    ///
11020    /// fn prepare_request_builder() -> GetLocation {
11021    ///   # panic!();
11022    ///   // ... details omitted ...
11023    /// }
11024    /// ```
11025    #[derive(Clone, Debug)]
11026    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
11027
11028    impl GetLocation {
11029        pub(crate) fn new(
11030            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
11031        ) -> Self {
11032            Self(RequestBuilder::new(stub))
11033        }
11034
11035        /// Sets the full request, replacing any prior values.
11036        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
11037            mut self,
11038            v: V,
11039        ) -> Self {
11040            self.0.request = v.into();
11041            self
11042        }
11043
11044        /// Sets all the options, replacing any prior values.
11045        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11046            self.0.options = v.into();
11047            self
11048        }
11049
11050        /// Sends the request.
11051        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
11052            (*self.0.stub)
11053                .get_location(self.0.request, self.0.options)
11054                .await
11055                .map(crate::Response::into_body)
11056        }
11057
11058        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
11059        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11060            self.0.request.name = v.into();
11061            self
11062        }
11063    }
11064
11065    #[doc(hidden)]
11066    impl crate::RequestBuilder for GetLocation {
11067        fn request_options(&mut self) -> &mut crate::RequestOptions {
11068            &mut self.0.options
11069        }
11070    }
11071
11072    /// The request builder for [PolicyBasedRoutingService::set_iam_policy][crate::client::PolicyBasedRoutingService::set_iam_policy] calls.
11073    ///
11074    /// # Example
11075    /// ```
11076    /// # use google_cloud_networkconnectivity_v1::builder::policy_based_routing_service::SetIamPolicy;
11077    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
11078    ///
11079    /// let builder = prepare_request_builder();
11080    /// let response = builder.send().await?;
11081    /// # Ok(()) }
11082    ///
11083    /// fn prepare_request_builder() -> SetIamPolicy {
11084    ///   # panic!();
11085    ///   // ... details omitted ...
11086    /// }
11087    /// ```
11088    #[derive(Clone, Debug)]
11089    pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
11090
11091    impl SetIamPolicy {
11092        pub(crate) fn new(
11093            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
11094        ) -> Self {
11095            Self(RequestBuilder::new(stub))
11096        }
11097
11098        /// Sets the full request, replacing any prior values.
11099        pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
11100            mut self,
11101            v: V,
11102        ) -> Self {
11103            self.0.request = v.into();
11104            self
11105        }
11106
11107        /// Sets all the options, replacing any prior values.
11108        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11109            self.0.options = v.into();
11110            self
11111        }
11112
11113        /// Sends the request.
11114        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
11115            (*self.0.stub)
11116                .set_iam_policy(self.0.request, self.0.options)
11117                .await
11118                .map(crate::Response::into_body)
11119        }
11120
11121        /// Sets the value of [resource][google_cloud_iam_v1::model::SetIamPolicyRequest::resource].
11122        ///
11123        /// This is a **required** field for requests.
11124        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
11125            self.0.request.resource = v.into();
11126            self
11127        }
11128
11129        /// Sets the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
11130        ///
11131        /// This is a **required** field for requests.
11132        pub fn set_policy<T>(mut self, v: T) -> Self
11133        where
11134            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
11135        {
11136            self.0.request.policy = std::option::Option::Some(v.into());
11137            self
11138        }
11139
11140        /// Sets or clears the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
11141        ///
11142        /// This is a **required** field for requests.
11143        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
11144        where
11145            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
11146        {
11147            self.0.request.policy = v.map(|x| x.into());
11148            self
11149        }
11150
11151        /// Sets the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
11152        pub fn set_update_mask<T>(mut self, v: T) -> Self
11153        where
11154            T: std::convert::Into<wkt::FieldMask>,
11155        {
11156            self.0.request.update_mask = std::option::Option::Some(v.into());
11157            self
11158        }
11159
11160        /// Sets or clears the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
11161        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
11162        where
11163            T: std::convert::Into<wkt::FieldMask>,
11164        {
11165            self.0.request.update_mask = v.map(|x| x.into());
11166            self
11167        }
11168    }
11169
11170    #[doc(hidden)]
11171    impl crate::RequestBuilder for SetIamPolicy {
11172        fn request_options(&mut self) -> &mut crate::RequestOptions {
11173            &mut self.0.options
11174        }
11175    }
11176
11177    /// The request builder for [PolicyBasedRoutingService::get_iam_policy][crate::client::PolicyBasedRoutingService::get_iam_policy] calls.
11178    ///
11179    /// # Example
11180    /// ```
11181    /// # use google_cloud_networkconnectivity_v1::builder::policy_based_routing_service::GetIamPolicy;
11182    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
11183    ///
11184    /// let builder = prepare_request_builder();
11185    /// let response = builder.send().await?;
11186    /// # Ok(()) }
11187    ///
11188    /// fn prepare_request_builder() -> GetIamPolicy {
11189    ///   # panic!();
11190    ///   // ... details omitted ...
11191    /// }
11192    /// ```
11193    #[derive(Clone, Debug)]
11194    pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
11195
11196    impl GetIamPolicy {
11197        pub(crate) fn new(
11198            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
11199        ) -> Self {
11200            Self(RequestBuilder::new(stub))
11201        }
11202
11203        /// Sets the full request, replacing any prior values.
11204        pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
11205            mut self,
11206            v: V,
11207        ) -> Self {
11208            self.0.request = v.into();
11209            self
11210        }
11211
11212        /// Sets all the options, replacing any prior values.
11213        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11214            self.0.options = v.into();
11215            self
11216        }
11217
11218        /// Sends the request.
11219        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
11220            (*self.0.stub)
11221                .get_iam_policy(self.0.request, self.0.options)
11222                .await
11223                .map(crate::Response::into_body)
11224        }
11225
11226        /// Sets the value of [resource][google_cloud_iam_v1::model::GetIamPolicyRequest::resource].
11227        ///
11228        /// This is a **required** field for requests.
11229        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
11230            self.0.request.resource = v.into();
11231            self
11232        }
11233
11234        /// Sets the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
11235        pub fn set_options<T>(mut self, v: T) -> Self
11236        where
11237            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
11238        {
11239            self.0.request.options = std::option::Option::Some(v.into());
11240            self
11241        }
11242
11243        /// Sets or clears the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
11244        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
11245        where
11246            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
11247        {
11248            self.0.request.options = v.map(|x| x.into());
11249            self
11250        }
11251    }
11252
11253    #[doc(hidden)]
11254    impl crate::RequestBuilder for GetIamPolicy {
11255        fn request_options(&mut self) -> &mut crate::RequestOptions {
11256            &mut self.0.options
11257        }
11258    }
11259
11260    /// The request builder for [PolicyBasedRoutingService::test_iam_permissions][crate::client::PolicyBasedRoutingService::test_iam_permissions] calls.
11261    ///
11262    /// # Example
11263    /// ```
11264    /// # use google_cloud_networkconnectivity_v1::builder::policy_based_routing_service::TestIamPermissions;
11265    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
11266    ///
11267    /// let builder = prepare_request_builder();
11268    /// let response = builder.send().await?;
11269    /// # Ok(()) }
11270    ///
11271    /// fn prepare_request_builder() -> TestIamPermissions {
11272    ///   # panic!();
11273    ///   // ... details omitted ...
11274    /// }
11275    /// ```
11276    #[derive(Clone, Debug)]
11277    pub struct TestIamPermissions(
11278        RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
11279    );
11280
11281    impl TestIamPermissions {
11282        pub(crate) fn new(
11283            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
11284        ) -> Self {
11285            Self(RequestBuilder::new(stub))
11286        }
11287
11288        /// Sets the full request, replacing any prior values.
11289        pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
11290            mut self,
11291            v: V,
11292        ) -> Self {
11293            self.0.request = v.into();
11294            self
11295        }
11296
11297        /// Sets all the options, replacing any prior values.
11298        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11299            self.0.options = v.into();
11300            self
11301        }
11302
11303        /// Sends the request.
11304        pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
11305            (*self.0.stub)
11306                .test_iam_permissions(self.0.request, self.0.options)
11307                .await
11308                .map(crate::Response::into_body)
11309        }
11310
11311        /// Sets the value of [resource][google_cloud_iam_v1::model::TestIamPermissionsRequest::resource].
11312        ///
11313        /// This is a **required** field for requests.
11314        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
11315            self.0.request.resource = v.into();
11316            self
11317        }
11318
11319        /// Sets the value of [permissions][google_cloud_iam_v1::model::TestIamPermissionsRequest::permissions].
11320        ///
11321        /// This is a **required** field for requests.
11322        pub fn set_permissions<T, V>(mut self, v: T) -> Self
11323        where
11324            T: std::iter::IntoIterator<Item = V>,
11325            V: std::convert::Into<std::string::String>,
11326        {
11327            use std::iter::Iterator;
11328            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
11329            self
11330        }
11331    }
11332
11333    #[doc(hidden)]
11334    impl crate::RequestBuilder for TestIamPermissions {
11335        fn request_options(&mut self) -> &mut crate::RequestOptions {
11336            &mut self.0.options
11337        }
11338    }
11339
11340    /// The request builder for [PolicyBasedRoutingService::list_operations][crate::client::PolicyBasedRoutingService::list_operations] calls.
11341    ///
11342    /// # Example
11343    /// ```
11344    /// # use google_cloud_networkconnectivity_v1::builder::policy_based_routing_service::ListOperations;
11345    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
11346    /// use google_cloud_gax::paginator::ItemPaginator;
11347    ///
11348    /// let builder = prepare_request_builder();
11349    /// let mut items = builder.by_item();
11350    /// while let Some(result) = items.next().await {
11351    ///   let item = result?;
11352    /// }
11353    /// # Ok(()) }
11354    ///
11355    /// fn prepare_request_builder() -> ListOperations {
11356    ///   # panic!();
11357    ///   // ... details omitted ...
11358    /// }
11359    /// ```
11360    #[derive(Clone, Debug)]
11361    pub struct ListOperations(
11362        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
11363    );
11364
11365    impl ListOperations {
11366        pub(crate) fn new(
11367            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
11368        ) -> Self {
11369            Self(RequestBuilder::new(stub))
11370        }
11371
11372        /// Sets the full request, replacing any prior values.
11373        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
11374            mut self,
11375            v: V,
11376        ) -> Self {
11377            self.0.request = v.into();
11378            self
11379        }
11380
11381        /// Sets all the options, replacing any prior values.
11382        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11383            self.0.options = v.into();
11384            self
11385        }
11386
11387        /// Sends the request.
11388        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
11389            (*self.0.stub)
11390                .list_operations(self.0.request, self.0.options)
11391                .await
11392                .map(crate::Response::into_body)
11393        }
11394
11395        /// Streams each page in the collection.
11396        pub fn by_page(
11397            self,
11398        ) -> impl google_cloud_gax::paginator::Paginator<
11399            google_cloud_longrunning::model::ListOperationsResponse,
11400            crate::Error,
11401        > {
11402            use std::clone::Clone;
11403            let token = self.0.request.page_token.clone();
11404            let execute = move |token: String| {
11405                let mut builder = self.clone();
11406                builder.0.request = builder.0.request.set_page_token(token);
11407                builder.send()
11408            };
11409            google_cloud_gax::paginator::internal::new_paginator(token, execute)
11410        }
11411
11412        /// Streams each item in the collection.
11413        pub fn by_item(
11414            self,
11415        ) -> impl google_cloud_gax::paginator::ItemPaginator<
11416            google_cloud_longrunning::model::ListOperationsResponse,
11417            crate::Error,
11418        > {
11419            use google_cloud_gax::paginator::Paginator;
11420            self.by_page().items()
11421        }
11422
11423        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
11424        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11425            self.0.request.name = v.into();
11426            self
11427        }
11428
11429        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
11430        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
11431            self.0.request.filter = v.into();
11432            self
11433        }
11434
11435        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
11436        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
11437            self.0.request.page_size = v.into();
11438            self
11439        }
11440
11441        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
11442        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
11443            self.0.request.page_token = v.into();
11444            self
11445        }
11446
11447        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
11448        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
11449            self.0.request.return_partial_success = v.into();
11450            self
11451        }
11452    }
11453
11454    #[doc(hidden)]
11455    impl crate::RequestBuilder for ListOperations {
11456        fn request_options(&mut self) -> &mut crate::RequestOptions {
11457            &mut self.0.options
11458        }
11459    }
11460
11461    /// The request builder for [PolicyBasedRoutingService::get_operation][crate::client::PolicyBasedRoutingService::get_operation] calls.
11462    ///
11463    /// # Example
11464    /// ```
11465    /// # use google_cloud_networkconnectivity_v1::builder::policy_based_routing_service::GetOperation;
11466    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
11467    ///
11468    /// let builder = prepare_request_builder();
11469    /// let response = builder.send().await?;
11470    /// # Ok(()) }
11471    ///
11472    /// fn prepare_request_builder() -> GetOperation {
11473    ///   # panic!();
11474    ///   // ... details omitted ...
11475    /// }
11476    /// ```
11477    #[derive(Clone, Debug)]
11478    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
11479
11480    impl GetOperation {
11481        pub(crate) fn new(
11482            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
11483        ) -> Self {
11484            Self(RequestBuilder::new(stub))
11485        }
11486
11487        /// Sets the full request, replacing any prior values.
11488        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
11489            mut self,
11490            v: V,
11491        ) -> Self {
11492            self.0.request = v.into();
11493            self
11494        }
11495
11496        /// Sets all the options, replacing any prior values.
11497        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11498            self.0.options = v.into();
11499            self
11500        }
11501
11502        /// Sends the request.
11503        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
11504            (*self.0.stub)
11505                .get_operation(self.0.request, self.0.options)
11506                .await
11507                .map(crate::Response::into_body)
11508        }
11509
11510        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
11511        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11512            self.0.request.name = v.into();
11513            self
11514        }
11515    }
11516
11517    #[doc(hidden)]
11518    impl crate::RequestBuilder for GetOperation {
11519        fn request_options(&mut self) -> &mut crate::RequestOptions {
11520            &mut self.0.options
11521        }
11522    }
11523
11524    /// The request builder for [PolicyBasedRoutingService::delete_operation][crate::client::PolicyBasedRoutingService::delete_operation] calls.
11525    ///
11526    /// # Example
11527    /// ```
11528    /// # use google_cloud_networkconnectivity_v1::builder::policy_based_routing_service::DeleteOperation;
11529    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
11530    ///
11531    /// let builder = prepare_request_builder();
11532    /// let response = builder.send().await?;
11533    /// # Ok(()) }
11534    ///
11535    /// fn prepare_request_builder() -> DeleteOperation {
11536    ///   # panic!();
11537    ///   // ... details omitted ...
11538    /// }
11539    /// ```
11540    #[derive(Clone, Debug)]
11541    pub struct DeleteOperation(
11542        RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
11543    );
11544
11545    impl DeleteOperation {
11546        pub(crate) fn new(
11547            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
11548        ) -> Self {
11549            Self(RequestBuilder::new(stub))
11550        }
11551
11552        /// Sets the full request, replacing any prior values.
11553        pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
11554            mut self,
11555            v: V,
11556        ) -> Self {
11557            self.0.request = v.into();
11558            self
11559        }
11560
11561        /// Sets all the options, replacing any prior values.
11562        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11563            self.0.options = v.into();
11564            self
11565        }
11566
11567        /// Sends the request.
11568        pub async fn send(self) -> Result<()> {
11569            (*self.0.stub)
11570                .delete_operation(self.0.request, self.0.options)
11571                .await
11572                .map(crate::Response::into_body)
11573        }
11574
11575        /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
11576        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11577            self.0.request.name = v.into();
11578            self
11579        }
11580    }
11581
11582    #[doc(hidden)]
11583    impl crate::RequestBuilder for DeleteOperation {
11584        fn request_options(&mut self) -> &mut crate::RequestOptions {
11585            &mut self.0.options
11586        }
11587    }
11588
11589    /// The request builder for [PolicyBasedRoutingService::cancel_operation][crate::client::PolicyBasedRoutingService::cancel_operation] calls.
11590    ///
11591    /// # Example
11592    /// ```
11593    /// # use google_cloud_networkconnectivity_v1::builder::policy_based_routing_service::CancelOperation;
11594    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
11595    ///
11596    /// let builder = prepare_request_builder();
11597    /// let response = builder.send().await?;
11598    /// # Ok(()) }
11599    ///
11600    /// fn prepare_request_builder() -> CancelOperation {
11601    ///   # panic!();
11602    ///   // ... details omitted ...
11603    /// }
11604    /// ```
11605    #[derive(Clone, Debug)]
11606    pub struct CancelOperation(
11607        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
11608    );
11609
11610    impl CancelOperation {
11611        pub(crate) fn new(
11612            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
11613        ) -> Self {
11614            Self(RequestBuilder::new(stub))
11615        }
11616
11617        /// Sets the full request, replacing any prior values.
11618        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
11619            mut self,
11620            v: V,
11621        ) -> Self {
11622            self.0.request = v.into();
11623            self
11624        }
11625
11626        /// Sets all the options, replacing any prior values.
11627        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11628            self.0.options = v.into();
11629            self
11630        }
11631
11632        /// Sends the request.
11633        pub async fn send(self) -> Result<()> {
11634            (*self.0.stub)
11635                .cancel_operation(self.0.request, self.0.options)
11636                .await
11637                .map(crate::Response::into_body)
11638        }
11639
11640        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
11641        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11642            self.0.request.name = v.into();
11643            self
11644        }
11645    }
11646
11647    #[doc(hidden)]
11648    impl crate::RequestBuilder for CancelOperation {
11649        fn request_options(&mut self) -> &mut crate::RequestOptions {
11650            &mut self.0.options
11651        }
11652    }
11653}