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
335            let stub = self.0.stub.clone();
336            let mut options = self.0.options.clone();
337            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
338            let query = move |name| {
339                let stub = stub.clone();
340                let options = options.clone();
341                async {
342                    let op = GetOperation::new(stub)
343                        .set_name(name)
344                        .with_options(options)
345                        .send()
346                        .await?;
347                    Ok(Operation::new(op))
348                }
349            };
350
351            let start = move || async {
352                let op = self.send().await?;
353                Ok(Operation::new(op))
354            };
355
356            google_cloud_lro::internal::new_poller(
357                polling_error_policy,
358                polling_backoff_policy,
359                start,
360                query,
361            )
362        }
363
364        /// Sets the value of [parent][crate::model::CreateServiceConnectionMapRequest::parent].
365        ///
366        /// This is a **required** field for requests.
367        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
368            self.0.request.parent = v.into();
369            self
370        }
371
372        /// Sets the value of [service_connection_map_id][crate::model::CreateServiceConnectionMapRequest::service_connection_map_id].
373        pub fn set_service_connection_map_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
374            self.0.request.service_connection_map_id = v.into();
375            self
376        }
377
378        /// Sets the value of [service_connection_map][crate::model::CreateServiceConnectionMapRequest::service_connection_map].
379        ///
380        /// This is a **required** field for requests.
381        pub fn set_service_connection_map<T>(mut self, v: T) -> Self
382        where
383            T: std::convert::Into<crate::model::ServiceConnectionMap>,
384        {
385            self.0.request.service_connection_map = std::option::Option::Some(v.into());
386            self
387        }
388
389        /// Sets or clears the value of [service_connection_map][crate::model::CreateServiceConnectionMapRequest::service_connection_map].
390        ///
391        /// This is a **required** field for requests.
392        pub fn set_or_clear_service_connection_map<T>(mut self, v: std::option::Option<T>) -> Self
393        where
394            T: std::convert::Into<crate::model::ServiceConnectionMap>,
395        {
396            self.0.request.service_connection_map = v.map(|x| x.into());
397            self
398        }
399
400        /// Sets the value of [request_id][crate::model::CreateServiceConnectionMapRequest::request_id].
401        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
402            self.0.request.request_id = v.into();
403            self
404        }
405    }
406
407    #[doc(hidden)]
408    impl crate::RequestBuilder for CreateServiceConnectionMap {
409        fn request_options(&mut self) -> &mut crate::RequestOptions {
410            &mut self.0.options
411        }
412    }
413
414    /// The request builder for [CrossNetworkAutomationService::update_service_connection_map][crate::client::CrossNetworkAutomationService::update_service_connection_map] calls.
415    ///
416    /// # Example
417    /// ```
418    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::UpdateServiceConnectionMap;
419    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
420    /// use google_cloud_lro::Poller;
421    ///
422    /// let builder = prepare_request_builder();
423    /// let response = builder.poller().until_done().await?;
424    /// # Ok(()) }
425    ///
426    /// fn prepare_request_builder() -> UpdateServiceConnectionMap {
427    ///   # panic!();
428    ///   // ... details omitted ...
429    /// }
430    /// ```
431    #[derive(Clone, Debug)]
432    pub struct UpdateServiceConnectionMap(
433        RequestBuilder<crate::model::UpdateServiceConnectionMapRequest>,
434    );
435
436    impl UpdateServiceConnectionMap {
437        pub(crate) fn new(
438            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
439        ) -> Self {
440            Self(RequestBuilder::new(stub))
441        }
442
443        /// Sets the full request, replacing any prior values.
444        pub fn with_request<V: Into<crate::model::UpdateServiceConnectionMapRequest>>(
445            mut self,
446            v: V,
447        ) -> Self {
448            self.0.request = v.into();
449            self
450        }
451
452        /// Sets all the options, replacing any prior values.
453        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
454            self.0.options = v.into();
455            self
456        }
457
458        /// Sends the request.
459        ///
460        /// # Long running operations
461        ///
462        /// This starts, but does not poll, a longrunning operation. More information
463        /// on [update_service_connection_map][crate::client::CrossNetworkAutomationService::update_service_connection_map].
464        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
465            (*self.0.stub)
466                .update_service_connection_map(self.0.request, self.0.options)
467                .await
468                .map(crate::Response::into_body)
469        }
470
471        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_service_connection_map`.
472        pub fn poller(
473            self,
474        ) -> impl google_cloud_lro::Poller<
475            crate::model::ServiceConnectionMap,
476            crate::model::OperationMetadata,
477        > {
478            type Operation = google_cloud_lro::internal::Operation<
479                crate::model::ServiceConnectionMap,
480                crate::model::OperationMetadata,
481            >;
482            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
483            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
484
485            let stub = self.0.stub.clone();
486            let mut options = self.0.options.clone();
487            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
488            let query = move |name| {
489                let stub = stub.clone();
490                let options = options.clone();
491                async {
492                    let op = GetOperation::new(stub)
493                        .set_name(name)
494                        .with_options(options)
495                        .send()
496                        .await?;
497                    Ok(Operation::new(op))
498                }
499            };
500
501            let start = move || async {
502                let op = self.send().await?;
503                Ok(Operation::new(op))
504            };
505
506            google_cloud_lro::internal::new_poller(
507                polling_error_policy,
508                polling_backoff_policy,
509                start,
510                query,
511            )
512        }
513
514        /// Sets the value of [update_mask][crate::model::UpdateServiceConnectionMapRequest::update_mask].
515        pub fn set_update_mask<T>(mut self, v: T) -> Self
516        where
517            T: std::convert::Into<wkt::FieldMask>,
518        {
519            self.0.request.update_mask = std::option::Option::Some(v.into());
520            self
521        }
522
523        /// Sets or clears the value of [update_mask][crate::model::UpdateServiceConnectionMapRequest::update_mask].
524        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
525        where
526            T: std::convert::Into<wkt::FieldMask>,
527        {
528            self.0.request.update_mask = v.map(|x| x.into());
529            self
530        }
531
532        /// Sets the value of [service_connection_map][crate::model::UpdateServiceConnectionMapRequest::service_connection_map].
533        ///
534        /// This is a **required** field for requests.
535        pub fn set_service_connection_map<T>(mut self, v: T) -> Self
536        where
537            T: std::convert::Into<crate::model::ServiceConnectionMap>,
538        {
539            self.0.request.service_connection_map = std::option::Option::Some(v.into());
540            self
541        }
542
543        /// Sets or clears the value of [service_connection_map][crate::model::UpdateServiceConnectionMapRequest::service_connection_map].
544        ///
545        /// This is a **required** field for requests.
546        pub fn set_or_clear_service_connection_map<T>(mut self, v: std::option::Option<T>) -> Self
547        where
548            T: std::convert::Into<crate::model::ServiceConnectionMap>,
549        {
550            self.0.request.service_connection_map = v.map(|x| x.into());
551            self
552        }
553
554        /// Sets the value of [request_id][crate::model::UpdateServiceConnectionMapRequest::request_id].
555        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
556            self.0.request.request_id = v.into();
557            self
558        }
559    }
560
561    #[doc(hidden)]
562    impl crate::RequestBuilder for UpdateServiceConnectionMap {
563        fn request_options(&mut self) -> &mut crate::RequestOptions {
564            &mut self.0.options
565        }
566    }
567
568    /// The request builder for [CrossNetworkAutomationService::delete_service_connection_map][crate::client::CrossNetworkAutomationService::delete_service_connection_map] calls.
569    ///
570    /// # Example
571    /// ```
572    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::DeleteServiceConnectionMap;
573    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
574    /// use google_cloud_lro::Poller;
575    ///
576    /// let builder = prepare_request_builder();
577    /// let response = builder.poller().until_done().await?;
578    /// # Ok(()) }
579    ///
580    /// fn prepare_request_builder() -> DeleteServiceConnectionMap {
581    ///   # panic!();
582    ///   // ... details omitted ...
583    /// }
584    /// ```
585    #[derive(Clone, Debug)]
586    pub struct DeleteServiceConnectionMap(
587        RequestBuilder<crate::model::DeleteServiceConnectionMapRequest>,
588    );
589
590    impl DeleteServiceConnectionMap {
591        pub(crate) fn new(
592            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
593        ) -> Self {
594            Self(RequestBuilder::new(stub))
595        }
596
597        /// Sets the full request, replacing any prior values.
598        pub fn with_request<V: Into<crate::model::DeleteServiceConnectionMapRequest>>(
599            mut self,
600            v: V,
601        ) -> Self {
602            self.0.request = v.into();
603            self
604        }
605
606        /// Sets all the options, replacing any prior values.
607        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
608            self.0.options = v.into();
609            self
610        }
611
612        /// Sends the request.
613        ///
614        /// # Long running operations
615        ///
616        /// This starts, but does not poll, a longrunning operation. More information
617        /// on [delete_service_connection_map][crate::client::CrossNetworkAutomationService::delete_service_connection_map].
618        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
619            (*self.0.stub)
620                .delete_service_connection_map(self.0.request, self.0.options)
621                .await
622                .map(crate::Response::into_body)
623        }
624
625        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_service_connection_map`.
626        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
627            type Operation =
628                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
629            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
630            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
631
632            let stub = self.0.stub.clone();
633            let mut options = self.0.options.clone();
634            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
635            let query = move |name| {
636                let stub = stub.clone();
637                let options = options.clone();
638                async {
639                    let op = GetOperation::new(stub)
640                        .set_name(name)
641                        .with_options(options)
642                        .send()
643                        .await?;
644                    Ok(Operation::new(op))
645                }
646            };
647
648            let start = move || async {
649                let op = self.send().await?;
650                Ok(Operation::new(op))
651            };
652
653            google_cloud_lro::internal::new_unit_response_poller(
654                polling_error_policy,
655                polling_backoff_policy,
656                start,
657                query,
658            )
659        }
660
661        /// Sets the value of [name][crate::model::DeleteServiceConnectionMapRequest::name].
662        ///
663        /// This is a **required** field for requests.
664        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
665            self.0.request.name = v.into();
666            self
667        }
668
669        /// Sets the value of [request_id][crate::model::DeleteServiceConnectionMapRequest::request_id].
670        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
671            self.0.request.request_id = v.into();
672            self
673        }
674
675        /// Sets the value of [etag][crate::model::DeleteServiceConnectionMapRequest::etag].
676        pub fn set_etag<T>(mut self, v: T) -> Self
677        where
678            T: std::convert::Into<std::string::String>,
679        {
680            self.0.request.etag = std::option::Option::Some(v.into());
681            self
682        }
683
684        /// Sets or clears the value of [etag][crate::model::DeleteServiceConnectionMapRequest::etag].
685        pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
686        where
687            T: std::convert::Into<std::string::String>,
688        {
689            self.0.request.etag = v.map(|x| x.into());
690            self
691        }
692    }
693
694    #[doc(hidden)]
695    impl crate::RequestBuilder for DeleteServiceConnectionMap {
696        fn request_options(&mut self) -> &mut crate::RequestOptions {
697            &mut self.0.options
698        }
699    }
700
701    /// The request builder for [CrossNetworkAutomationService::list_service_connection_policies][crate::client::CrossNetworkAutomationService::list_service_connection_policies] calls.
702    ///
703    /// # Example
704    /// ```
705    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::ListServiceConnectionPolicies;
706    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
707    /// use google_cloud_gax::paginator::ItemPaginator;
708    ///
709    /// let builder = prepare_request_builder();
710    /// let mut items = builder.by_item();
711    /// while let Some(result) = items.next().await {
712    ///   let item = result?;
713    /// }
714    /// # Ok(()) }
715    ///
716    /// fn prepare_request_builder() -> ListServiceConnectionPolicies {
717    ///   # panic!();
718    ///   // ... details omitted ...
719    /// }
720    /// ```
721    #[derive(Clone, Debug)]
722    pub struct ListServiceConnectionPolicies(
723        RequestBuilder<crate::model::ListServiceConnectionPoliciesRequest>,
724    );
725
726    impl ListServiceConnectionPolicies {
727        pub(crate) fn new(
728            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
729        ) -> Self {
730            Self(RequestBuilder::new(stub))
731        }
732
733        /// Sets the full request, replacing any prior values.
734        pub fn with_request<V: Into<crate::model::ListServiceConnectionPoliciesRequest>>(
735            mut self,
736            v: V,
737        ) -> Self {
738            self.0.request = v.into();
739            self
740        }
741
742        /// Sets all the options, replacing any prior values.
743        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
744            self.0.options = v.into();
745            self
746        }
747
748        /// Sends the request.
749        pub async fn send(self) -> Result<crate::model::ListServiceConnectionPoliciesResponse> {
750            (*self.0.stub)
751                .list_service_connection_policies(self.0.request, self.0.options)
752                .await
753                .map(crate::Response::into_body)
754        }
755
756        /// Streams each page in the collection.
757        pub fn by_page(
758            self,
759        ) -> impl google_cloud_gax::paginator::Paginator<
760            crate::model::ListServiceConnectionPoliciesResponse,
761            crate::Error,
762        > {
763            use std::clone::Clone;
764            let token = self.0.request.page_token.clone();
765            let execute = move |token: String| {
766                let mut builder = self.clone();
767                builder.0.request = builder.0.request.set_page_token(token);
768                builder.send()
769            };
770            google_cloud_gax::paginator::internal::new_paginator(token, execute)
771        }
772
773        /// Streams each item in the collection.
774        pub fn by_item(
775            self,
776        ) -> impl google_cloud_gax::paginator::ItemPaginator<
777            crate::model::ListServiceConnectionPoliciesResponse,
778            crate::Error,
779        > {
780            use google_cloud_gax::paginator::Paginator;
781            self.by_page().items()
782        }
783
784        /// Sets the value of [parent][crate::model::ListServiceConnectionPoliciesRequest::parent].
785        ///
786        /// This is a **required** field for requests.
787        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
788            self.0.request.parent = v.into();
789            self
790        }
791
792        /// Sets the value of [page_size][crate::model::ListServiceConnectionPoliciesRequest::page_size].
793        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
794            self.0.request.page_size = v.into();
795            self
796        }
797
798        /// Sets the value of [page_token][crate::model::ListServiceConnectionPoliciesRequest::page_token].
799        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
800            self.0.request.page_token = v.into();
801            self
802        }
803
804        /// Sets the value of [filter][crate::model::ListServiceConnectionPoliciesRequest::filter].
805        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
806            self.0.request.filter = v.into();
807            self
808        }
809
810        /// Sets the value of [order_by][crate::model::ListServiceConnectionPoliciesRequest::order_by].
811        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
812            self.0.request.order_by = v.into();
813            self
814        }
815    }
816
817    #[doc(hidden)]
818    impl crate::RequestBuilder for ListServiceConnectionPolicies {
819        fn request_options(&mut self) -> &mut crate::RequestOptions {
820            &mut self.0.options
821        }
822    }
823
824    /// The request builder for [CrossNetworkAutomationService::get_service_connection_policy][crate::client::CrossNetworkAutomationService::get_service_connection_policy] calls.
825    ///
826    /// # Example
827    /// ```
828    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::GetServiceConnectionPolicy;
829    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
830    ///
831    /// let builder = prepare_request_builder();
832    /// let response = builder.send().await?;
833    /// # Ok(()) }
834    ///
835    /// fn prepare_request_builder() -> GetServiceConnectionPolicy {
836    ///   # panic!();
837    ///   // ... details omitted ...
838    /// }
839    /// ```
840    #[derive(Clone, Debug)]
841    pub struct GetServiceConnectionPolicy(
842        RequestBuilder<crate::model::GetServiceConnectionPolicyRequest>,
843    );
844
845    impl GetServiceConnectionPolicy {
846        pub(crate) fn new(
847            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
848        ) -> Self {
849            Self(RequestBuilder::new(stub))
850        }
851
852        /// Sets the full request, replacing any prior values.
853        pub fn with_request<V: Into<crate::model::GetServiceConnectionPolicyRequest>>(
854            mut self,
855            v: V,
856        ) -> Self {
857            self.0.request = v.into();
858            self
859        }
860
861        /// Sets all the options, replacing any prior values.
862        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
863            self.0.options = v.into();
864            self
865        }
866
867        /// Sends the request.
868        pub async fn send(self) -> Result<crate::model::ServiceConnectionPolicy> {
869            (*self.0.stub)
870                .get_service_connection_policy(self.0.request, self.0.options)
871                .await
872                .map(crate::Response::into_body)
873        }
874
875        /// Sets the value of [name][crate::model::GetServiceConnectionPolicyRequest::name].
876        ///
877        /// This is a **required** field for requests.
878        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
879            self.0.request.name = v.into();
880            self
881        }
882    }
883
884    #[doc(hidden)]
885    impl crate::RequestBuilder for GetServiceConnectionPolicy {
886        fn request_options(&mut self) -> &mut crate::RequestOptions {
887            &mut self.0.options
888        }
889    }
890
891    /// The request builder for [CrossNetworkAutomationService::create_service_connection_policy][crate::client::CrossNetworkAutomationService::create_service_connection_policy] calls.
892    ///
893    /// # Example
894    /// ```
895    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::CreateServiceConnectionPolicy;
896    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
897    /// use google_cloud_lro::Poller;
898    ///
899    /// let builder = prepare_request_builder();
900    /// let response = builder.poller().until_done().await?;
901    /// # Ok(()) }
902    ///
903    /// fn prepare_request_builder() -> CreateServiceConnectionPolicy {
904    ///   # panic!();
905    ///   // ... details omitted ...
906    /// }
907    /// ```
908    #[derive(Clone, Debug)]
909    pub struct CreateServiceConnectionPolicy(
910        RequestBuilder<crate::model::CreateServiceConnectionPolicyRequest>,
911    );
912
913    impl CreateServiceConnectionPolicy {
914        pub(crate) fn new(
915            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
916        ) -> Self {
917            Self(RequestBuilder::new(stub))
918        }
919
920        /// Sets the full request, replacing any prior values.
921        pub fn with_request<V: Into<crate::model::CreateServiceConnectionPolicyRequest>>(
922            mut self,
923            v: V,
924        ) -> Self {
925            self.0.request = v.into();
926            self
927        }
928
929        /// Sets all the options, replacing any prior values.
930        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
931            self.0.options = v.into();
932            self
933        }
934
935        /// Sends the request.
936        ///
937        /// # Long running operations
938        ///
939        /// This starts, but does not poll, a longrunning operation. More information
940        /// on [create_service_connection_policy][crate::client::CrossNetworkAutomationService::create_service_connection_policy].
941        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
942            (*self.0.stub)
943                .create_service_connection_policy(self.0.request, self.0.options)
944                .await
945                .map(crate::Response::into_body)
946        }
947
948        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_service_connection_policy`.
949        pub fn poller(
950            self,
951        ) -> impl google_cloud_lro::Poller<
952            crate::model::ServiceConnectionPolicy,
953            crate::model::OperationMetadata,
954        > {
955            type Operation = google_cloud_lro::internal::Operation<
956                crate::model::ServiceConnectionPolicy,
957                crate::model::OperationMetadata,
958            >;
959            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
960            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
961
962            let stub = self.0.stub.clone();
963            let mut options = self.0.options.clone();
964            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
965            let query = move |name| {
966                let stub = stub.clone();
967                let options = options.clone();
968                async {
969                    let op = GetOperation::new(stub)
970                        .set_name(name)
971                        .with_options(options)
972                        .send()
973                        .await?;
974                    Ok(Operation::new(op))
975                }
976            };
977
978            let start = move || async {
979                let op = self.send().await?;
980                Ok(Operation::new(op))
981            };
982
983            google_cloud_lro::internal::new_poller(
984                polling_error_policy,
985                polling_backoff_policy,
986                start,
987                query,
988            )
989        }
990
991        /// Sets the value of [parent][crate::model::CreateServiceConnectionPolicyRequest::parent].
992        ///
993        /// This is a **required** field for requests.
994        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
995            self.0.request.parent = v.into();
996            self
997        }
998
999        /// Sets the value of [service_connection_policy_id][crate::model::CreateServiceConnectionPolicyRequest::service_connection_policy_id].
1000        pub fn set_service_connection_policy_id<T: Into<std::string::String>>(
1001            mut self,
1002            v: T,
1003        ) -> Self {
1004            self.0.request.service_connection_policy_id = v.into();
1005            self
1006        }
1007
1008        /// Sets the value of [service_connection_policy][crate::model::CreateServiceConnectionPolicyRequest::service_connection_policy].
1009        ///
1010        /// This is a **required** field for requests.
1011        pub fn set_service_connection_policy<T>(mut self, v: T) -> Self
1012        where
1013            T: std::convert::Into<crate::model::ServiceConnectionPolicy>,
1014        {
1015            self.0.request.service_connection_policy = std::option::Option::Some(v.into());
1016            self
1017        }
1018
1019        /// Sets or clears the value of [service_connection_policy][crate::model::CreateServiceConnectionPolicyRequest::service_connection_policy].
1020        ///
1021        /// This is a **required** field for requests.
1022        pub fn set_or_clear_service_connection_policy<T>(
1023            mut self,
1024            v: std::option::Option<T>,
1025        ) -> Self
1026        where
1027            T: std::convert::Into<crate::model::ServiceConnectionPolicy>,
1028        {
1029            self.0.request.service_connection_policy = v.map(|x| x.into());
1030            self
1031        }
1032
1033        /// Sets the value of [request_id][crate::model::CreateServiceConnectionPolicyRequest::request_id].
1034        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1035            self.0.request.request_id = v.into();
1036            self
1037        }
1038    }
1039
1040    #[doc(hidden)]
1041    impl crate::RequestBuilder for CreateServiceConnectionPolicy {
1042        fn request_options(&mut self) -> &mut crate::RequestOptions {
1043            &mut self.0.options
1044        }
1045    }
1046
1047    /// The request builder for [CrossNetworkAutomationService::update_service_connection_policy][crate::client::CrossNetworkAutomationService::update_service_connection_policy] calls.
1048    ///
1049    /// # Example
1050    /// ```
1051    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::UpdateServiceConnectionPolicy;
1052    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
1053    /// use google_cloud_lro::Poller;
1054    ///
1055    /// let builder = prepare_request_builder();
1056    /// let response = builder.poller().until_done().await?;
1057    /// # Ok(()) }
1058    ///
1059    /// fn prepare_request_builder() -> UpdateServiceConnectionPolicy {
1060    ///   # panic!();
1061    ///   // ... details omitted ...
1062    /// }
1063    /// ```
1064    #[derive(Clone, Debug)]
1065    pub struct UpdateServiceConnectionPolicy(
1066        RequestBuilder<crate::model::UpdateServiceConnectionPolicyRequest>,
1067    );
1068
1069    impl UpdateServiceConnectionPolicy {
1070        pub(crate) fn new(
1071            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1072        ) -> Self {
1073            Self(RequestBuilder::new(stub))
1074        }
1075
1076        /// Sets the full request, replacing any prior values.
1077        pub fn with_request<V: Into<crate::model::UpdateServiceConnectionPolicyRequest>>(
1078            mut self,
1079            v: V,
1080        ) -> Self {
1081            self.0.request = v.into();
1082            self
1083        }
1084
1085        /// Sets all the options, replacing any prior values.
1086        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1087            self.0.options = v.into();
1088            self
1089        }
1090
1091        /// Sends the request.
1092        ///
1093        /// # Long running operations
1094        ///
1095        /// This starts, but does not poll, a longrunning operation. More information
1096        /// on [update_service_connection_policy][crate::client::CrossNetworkAutomationService::update_service_connection_policy].
1097        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1098            (*self.0.stub)
1099                .update_service_connection_policy(self.0.request, self.0.options)
1100                .await
1101                .map(crate::Response::into_body)
1102        }
1103
1104        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_service_connection_policy`.
1105        pub fn poller(
1106            self,
1107        ) -> impl google_cloud_lro::Poller<
1108            crate::model::ServiceConnectionPolicy,
1109            crate::model::OperationMetadata,
1110        > {
1111            type Operation = google_cloud_lro::internal::Operation<
1112                crate::model::ServiceConnectionPolicy,
1113                crate::model::OperationMetadata,
1114            >;
1115            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1116            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1117
1118            let stub = self.0.stub.clone();
1119            let mut options = self.0.options.clone();
1120            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1121            let query = move |name| {
1122                let stub = stub.clone();
1123                let options = options.clone();
1124                async {
1125                    let op = GetOperation::new(stub)
1126                        .set_name(name)
1127                        .with_options(options)
1128                        .send()
1129                        .await?;
1130                    Ok(Operation::new(op))
1131                }
1132            };
1133
1134            let start = move || async {
1135                let op = self.send().await?;
1136                Ok(Operation::new(op))
1137            };
1138
1139            google_cloud_lro::internal::new_poller(
1140                polling_error_policy,
1141                polling_backoff_policy,
1142                start,
1143                query,
1144            )
1145        }
1146
1147        /// Sets the value of [update_mask][crate::model::UpdateServiceConnectionPolicyRequest::update_mask].
1148        pub fn set_update_mask<T>(mut self, v: T) -> Self
1149        where
1150            T: std::convert::Into<wkt::FieldMask>,
1151        {
1152            self.0.request.update_mask = std::option::Option::Some(v.into());
1153            self
1154        }
1155
1156        /// Sets or clears the value of [update_mask][crate::model::UpdateServiceConnectionPolicyRequest::update_mask].
1157        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1158        where
1159            T: std::convert::Into<wkt::FieldMask>,
1160        {
1161            self.0.request.update_mask = v.map(|x| x.into());
1162            self
1163        }
1164
1165        /// Sets the value of [service_connection_policy][crate::model::UpdateServiceConnectionPolicyRequest::service_connection_policy].
1166        ///
1167        /// This is a **required** field for requests.
1168        pub fn set_service_connection_policy<T>(mut self, v: T) -> Self
1169        where
1170            T: std::convert::Into<crate::model::ServiceConnectionPolicy>,
1171        {
1172            self.0.request.service_connection_policy = std::option::Option::Some(v.into());
1173            self
1174        }
1175
1176        /// Sets or clears the value of [service_connection_policy][crate::model::UpdateServiceConnectionPolicyRequest::service_connection_policy].
1177        ///
1178        /// This is a **required** field for requests.
1179        pub fn set_or_clear_service_connection_policy<T>(
1180            mut self,
1181            v: std::option::Option<T>,
1182        ) -> Self
1183        where
1184            T: std::convert::Into<crate::model::ServiceConnectionPolicy>,
1185        {
1186            self.0.request.service_connection_policy = v.map(|x| x.into());
1187            self
1188        }
1189
1190        /// Sets the value of [request_id][crate::model::UpdateServiceConnectionPolicyRequest::request_id].
1191        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1192            self.0.request.request_id = v.into();
1193            self
1194        }
1195    }
1196
1197    #[doc(hidden)]
1198    impl crate::RequestBuilder for UpdateServiceConnectionPolicy {
1199        fn request_options(&mut self) -> &mut crate::RequestOptions {
1200            &mut self.0.options
1201        }
1202    }
1203
1204    /// The request builder for [CrossNetworkAutomationService::delete_service_connection_policy][crate::client::CrossNetworkAutomationService::delete_service_connection_policy] calls.
1205    ///
1206    /// # Example
1207    /// ```
1208    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::DeleteServiceConnectionPolicy;
1209    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
1210    /// use google_cloud_lro::Poller;
1211    ///
1212    /// let builder = prepare_request_builder();
1213    /// let response = builder.poller().until_done().await?;
1214    /// # Ok(()) }
1215    ///
1216    /// fn prepare_request_builder() -> DeleteServiceConnectionPolicy {
1217    ///   # panic!();
1218    ///   // ... details omitted ...
1219    /// }
1220    /// ```
1221    #[derive(Clone, Debug)]
1222    pub struct DeleteServiceConnectionPolicy(
1223        RequestBuilder<crate::model::DeleteServiceConnectionPolicyRequest>,
1224    );
1225
1226    impl DeleteServiceConnectionPolicy {
1227        pub(crate) fn new(
1228            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1229        ) -> Self {
1230            Self(RequestBuilder::new(stub))
1231        }
1232
1233        /// Sets the full request, replacing any prior values.
1234        pub fn with_request<V: Into<crate::model::DeleteServiceConnectionPolicyRequest>>(
1235            mut self,
1236            v: V,
1237        ) -> Self {
1238            self.0.request = v.into();
1239            self
1240        }
1241
1242        /// Sets all the options, replacing any prior values.
1243        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1244            self.0.options = v.into();
1245            self
1246        }
1247
1248        /// Sends the request.
1249        ///
1250        /// # Long running operations
1251        ///
1252        /// This starts, but does not poll, a longrunning operation. More information
1253        /// on [delete_service_connection_policy][crate::client::CrossNetworkAutomationService::delete_service_connection_policy].
1254        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1255            (*self.0.stub)
1256                .delete_service_connection_policy(self.0.request, self.0.options)
1257                .await
1258                .map(crate::Response::into_body)
1259        }
1260
1261        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_service_connection_policy`.
1262        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
1263            type Operation =
1264                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
1265            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1266            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1267
1268            let stub = self.0.stub.clone();
1269            let mut options = self.0.options.clone();
1270            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1271            let query = move |name| {
1272                let stub = stub.clone();
1273                let options = options.clone();
1274                async {
1275                    let op = GetOperation::new(stub)
1276                        .set_name(name)
1277                        .with_options(options)
1278                        .send()
1279                        .await?;
1280                    Ok(Operation::new(op))
1281                }
1282            };
1283
1284            let start = move || async {
1285                let op = self.send().await?;
1286                Ok(Operation::new(op))
1287            };
1288
1289            google_cloud_lro::internal::new_unit_response_poller(
1290                polling_error_policy,
1291                polling_backoff_policy,
1292                start,
1293                query,
1294            )
1295        }
1296
1297        /// Sets the value of [name][crate::model::DeleteServiceConnectionPolicyRequest::name].
1298        ///
1299        /// This is a **required** field for requests.
1300        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1301            self.0.request.name = v.into();
1302            self
1303        }
1304
1305        /// Sets the value of [request_id][crate::model::DeleteServiceConnectionPolicyRequest::request_id].
1306        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1307            self.0.request.request_id = v.into();
1308            self
1309        }
1310
1311        /// Sets the value of [etag][crate::model::DeleteServiceConnectionPolicyRequest::etag].
1312        pub fn set_etag<T>(mut self, v: T) -> Self
1313        where
1314            T: std::convert::Into<std::string::String>,
1315        {
1316            self.0.request.etag = std::option::Option::Some(v.into());
1317            self
1318        }
1319
1320        /// Sets or clears the value of [etag][crate::model::DeleteServiceConnectionPolicyRequest::etag].
1321        pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
1322        where
1323            T: std::convert::Into<std::string::String>,
1324        {
1325            self.0.request.etag = v.map(|x| x.into());
1326            self
1327        }
1328    }
1329
1330    #[doc(hidden)]
1331    impl crate::RequestBuilder for DeleteServiceConnectionPolicy {
1332        fn request_options(&mut self) -> &mut crate::RequestOptions {
1333            &mut self.0.options
1334        }
1335    }
1336
1337    /// The request builder for [CrossNetworkAutomationService::list_service_classes][crate::client::CrossNetworkAutomationService::list_service_classes] calls.
1338    ///
1339    /// # Example
1340    /// ```
1341    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::ListServiceClasses;
1342    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
1343    /// use google_cloud_gax::paginator::ItemPaginator;
1344    ///
1345    /// let builder = prepare_request_builder();
1346    /// let mut items = builder.by_item();
1347    /// while let Some(result) = items.next().await {
1348    ///   let item = result?;
1349    /// }
1350    /// # Ok(()) }
1351    ///
1352    /// fn prepare_request_builder() -> ListServiceClasses {
1353    ///   # panic!();
1354    ///   // ... details omitted ...
1355    /// }
1356    /// ```
1357    #[derive(Clone, Debug)]
1358    pub struct ListServiceClasses(RequestBuilder<crate::model::ListServiceClassesRequest>);
1359
1360    impl ListServiceClasses {
1361        pub(crate) fn new(
1362            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1363        ) -> Self {
1364            Self(RequestBuilder::new(stub))
1365        }
1366
1367        /// Sets the full request, replacing any prior values.
1368        pub fn with_request<V: Into<crate::model::ListServiceClassesRequest>>(
1369            mut self,
1370            v: V,
1371        ) -> Self {
1372            self.0.request = v.into();
1373            self
1374        }
1375
1376        /// Sets all the options, replacing any prior values.
1377        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1378            self.0.options = v.into();
1379            self
1380        }
1381
1382        /// Sends the request.
1383        pub async fn send(self) -> Result<crate::model::ListServiceClassesResponse> {
1384            (*self.0.stub)
1385                .list_service_classes(self.0.request, self.0.options)
1386                .await
1387                .map(crate::Response::into_body)
1388        }
1389
1390        /// Streams each page in the collection.
1391        pub fn by_page(
1392            self,
1393        ) -> impl google_cloud_gax::paginator::Paginator<
1394            crate::model::ListServiceClassesResponse,
1395            crate::Error,
1396        > {
1397            use std::clone::Clone;
1398            let token = self.0.request.page_token.clone();
1399            let execute = move |token: String| {
1400                let mut builder = self.clone();
1401                builder.0.request = builder.0.request.set_page_token(token);
1402                builder.send()
1403            };
1404            google_cloud_gax::paginator::internal::new_paginator(token, execute)
1405        }
1406
1407        /// Streams each item in the collection.
1408        pub fn by_item(
1409            self,
1410        ) -> impl google_cloud_gax::paginator::ItemPaginator<
1411            crate::model::ListServiceClassesResponse,
1412            crate::Error,
1413        > {
1414            use google_cloud_gax::paginator::Paginator;
1415            self.by_page().items()
1416        }
1417
1418        /// Sets the value of [parent][crate::model::ListServiceClassesRequest::parent].
1419        ///
1420        /// This is a **required** field for requests.
1421        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1422            self.0.request.parent = v.into();
1423            self
1424        }
1425
1426        /// Sets the value of [page_size][crate::model::ListServiceClassesRequest::page_size].
1427        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1428            self.0.request.page_size = v.into();
1429            self
1430        }
1431
1432        /// Sets the value of [page_token][crate::model::ListServiceClassesRequest::page_token].
1433        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1434            self.0.request.page_token = v.into();
1435            self
1436        }
1437
1438        /// Sets the value of [filter][crate::model::ListServiceClassesRequest::filter].
1439        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1440            self.0.request.filter = v.into();
1441            self
1442        }
1443
1444        /// Sets the value of [order_by][crate::model::ListServiceClassesRequest::order_by].
1445        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1446            self.0.request.order_by = v.into();
1447            self
1448        }
1449    }
1450
1451    #[doc(hidden)]
1452    impl crate::RequestBuilder for ListServiceClasses {
1453        fn request_options(&mut self) -> &mut crate::RequestOptions {
1454            &mut self.0.options
1455        }
1456    }
1457
1458    /// The request builder for [CrossNetworkAutomationService::get_service_class][crate::client::CrossNetworkAutomationService::get_service_class] calls.
1459    ///
1460    /// # Example
1461    /// ```
1462    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::GetServiceClass;
1463    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
1464    ///
1465    /// let builder = prepare_request_builder();
1466    /// let response = builder.send().await?;
1467    /// # Ok(()) }
1468    ///
1469    /// fn prepare_request_builder() -> GetServiceClass {
1470    ///   # panic!();
1471    ///   // ... details omitted ...
1472    /// }
1473    /// ```
1474    #[derive(Clone, Debug)]
1475    pub struct GetServiceClass(RequestBuilder<crate::model::GetServiceClassRequest>);
1476
1477    impl GetServiceClass {
1478        pub(crate) fn new(
1479            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1480        ) -> Self {
1481            Self(RequestBuilder::new(stub))
1482        }
1483
1484        /// Sets the full request, replacing any prior values.
1485        pub fn with_request<V: Into<crate::model::GetServiceClassRequest>>(mut self, v: V) -> Self {
1486            self.0.request = v.into();
1487            self
1488        }
1489
1490        /// Sets all the options, replacing any prior values.
1491        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1492            self.0.options = v.into();
1493            self
1494        }
1495
1496        /// Sends the request.
1497        pub async fn send(self) -> Result<crate::model::ServiceClass> {
1498            (*self.0.stub)
1499                .get_service_class(self.0.request, self.0.options)
1500                .await
1501                .map(crate::Response::into_body)
1502        }
1503
1504        /// Sets the value of [name][crate::model::GetServiceClassRequest::name].
1505        ///
1506        /// This is a **required** field for requests.
1507        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1508            self.0.request.name = v.into();
1509            self
1510        }
1511    }
1512
1513    #[doc(hidden)]
1514    impl crate::RequestBuilder for GetServiceClass {
1515        fn request_options(&mut self) -> &mut crate::RequestOptions {
1516            &mut self.0.options
1517        }
1518    }
1519
1520    /// The request builder for [CrossNetworkAutomationService::update_service_class][crate::client::CrossNetworkAutomationService::update_service_class] calls.
1521    ///
1522    /// # Example
1523    /// ```
1524    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::UpdateServiceClass;
1525    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
1526    /// use google_cloud_lro::Poller;
1527    ///
1528    /// let builder = prepare_request_builder();
1529    /// let response = builder.poller().until_done().await?;
1530    /// # Ok(()) }
1531    ///
1532    /// fn prepare_request_builder() -> UpdateServiceClass {
1533    ///   # panic!();
1534    ///   // ... details omitted ...
1535    /// }
1536    /// ```
1537    #[derive(Clone, Debug)]
1538    pub struct UpdateServiceClass(RequestBuilder<crate::model::UpdateServiceClassRequest>);
1539
1540    impl UpdateServiceClass {
1541        pub(crate) fn new(
1542            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1543        ) -> Self {
1544            Self(RequestBuilder::new(stub))
1545        }
1546
1547        /// Sets the full request, replacing any prior values.
1548        pub fn with_request<V: Into<crate::model::UpdateServiceClassRequest>>(
1549            mut self,
1550            v: V,
1551        ) -> Self {
1552            self.0.request = v.into();
1553            self
1554        }
1555
1556        /// Sets all the options, replacing any prior values.
1557        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1558            self.0.options = v.into();
1559            self
1560        }
1561
1562        /// Sends the request.
1563        ///
1564        /// # Long running operations
1565        ///
1566        /// This starts, but does not poll, a longrunning operation. More information
1567        /// on [update_service_class][crate::client::CrossNetworkAutomationService::update_service_class].
1568        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1569            (*self.0.stub)
1570                .update_service_class(self.0.request, self.0.options)
1571                .await
1572                .map(crate::Response::into_body)
1573        }
1574
1575        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_service_class`.
1576        pub fn poller(
1577            self,
1578        ) -> impl google_cloud_lro::Poller<crate::model::ServiceClass, crate::model::OperationMetadata>
1579        {
1580            type Operation = google_cloud_lro::internal::Operation<
1581                crate::model::ServiceClass,
1582                crate::model::OperationMetadata,
1583            >;
1584            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1585            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1586
1587            let stub = self.0.stub.clone();
1588            let mut options = self.0.options.clone();
1589            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1590            let query = move |name| {
1591                let stub = stub.clone();
1592                let options = options.clone();
1593                async {
1594                    let op = GetOperation::new(stub)
1595                        .set_name(name)
1596                        .with_options(options)
1597                        .send()
1598                        .await?;
1599                    Ok(Operation::new(op))
1600                }
1601            };
1602
1603            let start = move || async {
1604                let op = self.send().await?;
1605                Ok(Operation::new(op))
1606            };
1607
1608            google_cloud_lro::internal::new_poller(
1609                polling_error_policy,
1610                polling_backoff_policy,
1611                start,
1612                query,
1613            )
1614        }
1615
1616        /// Sets the value of [update_mask][crate::model::UpdateServiceClassRequest::update_mask].
1617        pub fn set_update_mask<T>(mut self, v: T) -> Self
1618        where
1619            T: std::convert::Into<wkt::FieldMask>,
1620        {
1621            self.0.request.update_mask = std::option::Option::Some(v.into());
1622            self
1623        }
1624
1625        /// Sets or clears the value of [update_mask][crate::model::UpdateServiceClassRequest::update_mask].
1626        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1627        where
1628            T: std::convert::Into<wkt::FieldMask>,
1629        {
1630            self.0.request.update_mask = v.map(|x| x.into());
1631            self
1632        }
1633
1634        /// Sets the value of [service_class][crate::model::UpdateServiceClassRequest::service_class].
1635        ///
1636        /// This is a **required** field for requests.
1637        pub fn set_service_class<T>(mut self, v: T) -> Self
1638        where
1639            T: std::convert::Into<crate::model::ServiceClass>,
1640        {
1641            self.0.request.service_class = std::option::Option::Some(v.into());
1642            self
1643        }
1644
1645        /// Sets or clears the value of [service_class][crate::model::UpdateServiceClassRequest::service_class].
1646        ///
1647        /// This is a **required** field for requests.
1648        pub fn set_or_clear_service_class<T>(mut self, v: std::option::Option<T>) -> Self
1649        where
1650            T: std::convert::Into<crate::model::ServiceClass>,
1651        {
1652            self.0.request.service_class = v.map(|x| x.into());
1653            self
1654        }
1655
1656        /// Sets the value of [request_id][crate::model::UpdateServiceClassRequest::request_id].
1657        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1658            self.0.request.request_id = v.into();
1659            self
1660        }
1661    }
1662
1663    #[doc(hidden)]
1664    impl crate::RequestBuilder for UpdateServiceClass {
1665        fn request_options(&mut self) -> &mut crate::RequestOptions {
1666            &mut self.0.options
1667        }
1668    }
1669
1670    /// The request builder for [CrossNetworkAutomationService::delete_service_class][crate::client::CrossNetworkAutomationService::delete_service_class] calls.
1671    ///
1672    /// # Example
1673    /// ```
1674    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::DeleteServiceClass;
1675    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
1676    /// use google_cloud_lro::Poller;
1677    ///
1678    /// let builder = prepare_request_builder();
1679    /// let response = builder.poller().until_done().await?;
1680    /// # Ok(()) }
1681    ///
1682    /// fn prepare_request_builder() -> DeleteServiceClass {
1683    ///   # panic!();
1684    ///   // ... details omitted ...
1685    /// }
1686    /// ```
1687    #[derive(Clone, Debug)]
1688    pub struct DeleteServiceClass(RequestBuilder<crate::model::DeleteServiceClassRequest>);
1689
1690    impl DeleteServiceClass {
1691        pub(crate) fn new(
1692            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1693        ) -> Self {
1694            Self(RequestBuilder::new(stub))
1695        }
1696
1697        /// Sets the full request, replacing any prior values.
1698        pub fn with_request<V: Into<crate::model::DeleteServiceClassRequest>>(
1699            mut self,
1700            v: V,
1701        ) -> Self {
1702            self.0.request = v.into();
1703            self
1704        }
1705
1706        /// Sets all the options, replacing any prior values.
1707        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1708            self.0.options = v.into();
1709            self
1710        }
1711
1712        /// Sends the request.
1713        ///
1714        /// # Long running operations
1715        ///
1716        /// This starts, but does not poll, a longrunning operation. More information
1717        /// on [delete_service_class][crate::client::CrossNetworkAutomationService::delete_service_class].
1718        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1719            (*self.0.stub)
1720                .delete_service_class(self.0.request, self.0.options)
1721                .await
1722                .map(crate::Response::into_body)
1723        }
1724
1725        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_service_class`.
1726        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
1727            type Operation =
1728                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
1729            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1730            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1731
1732            let stub = self.0.stub.clone();
1733            let mut options = self.0.options.clone();
1734            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1735            let query = move |name| {
1736                let stub = stub.clone();
1737                let options = options.clone();
1738                async {
1739                    let op = GetOperation::new(stub)
1740                        .set_name(name)
1741                        .with_options(options)
1742                        .send()
1743                        .await?;
1744                    Ok(Operation::new(op))
1745                }
1746            };
1747
1748            let start = move || async {
1749                let op = self.send().await?;
1750                Ok(Operation::new(op))
1751            };
1752
1753            google_cloud_lro::internal::new_unit_response_poller(
1754                polling_error_policy,
1755                polling_backoff_policy,
1756                start,
1757                query,
1758            )
1759        }
1760
1761        /// Sets the value of [name][crate::model::DeleteServiceClassRequest::name].
1762        ///
1763        /// This is a **required** field for requests.
1764        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1765            self.0.request.name = v.into();
1766            self
1767        }
1768
1769        /// Sets the value of [request_id][crate::model::DeleteServiceClassRequest::request_id].
1770        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1771            self.0.request.request_id = v.into();
1772            self
1773        }
1774
1775        /// Sets the value of [etag][crate::model::DeleteServiceClassRequest::etag].
1776        pub fn set_etag<T>(mut self, v: T) -> Self
1777        where
1778            T: std::convert::Into<std::string::String>,
1779        {
1780            self.0.request.etag = std::option::Option::Some(v.into());
1781            self
1782        }
1783
1784        /// Sets or clears the value of [etag][crate::model::DeleteServiceClassRequest::etag].
1785        pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
1786        where
1787            T: std::convert::Into<std::string::String>,
1788        {
1789            self.0.request.etag = v.map(|x| x.into());
1790            self
1791        }
1792    }
1793
1794    #[doc(hidden)]
1795    impl crate::RequestBuilder for DeleteServiceClass {
1796        fn request_options(&mut self) -> &mut crate::RequestOptions {
1797            &mut self.0.options
1798        }
1799    }
1800
1801    /// The request builder for [CrossNetworkAutomationService::get_service_connection_token][crate::client::CrossNetworkAutomationService::get_service_connection_token] calls.
1802    ///
1803    /// # Example
1804    /// ```
1805    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::GetServiceConnectionToken;
1806    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
1807    ///
1808    /// let builder = prepare_request_builder();
1809    /// let response = builder.send().await?;
1810    /// # Ok(()) }
1811    ///
1812    /// fn prepare_request_builder() -> GetServiceConnectionToken {
1813    ///   # panic!();
1814    ///   // ... details omitted ...
1815    /// }
1816    /// ```
1817    #[derive(Clone, Debug)]
1818    pub struct GetServiceConnectionToken(
1819        RequestBuilder<crate::model::GetServiceConnectionTokenRequest>,
1820    );
1821
1822    impl GetServiceConnectionToken {
1823        pub(crate) fn new(
1824            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1825        ) -> Self {
1826            Self(RequestBuilder::new(stub))
1827        }
1828
1829        /// Sets the full request, replacing any prior values.
1830        pub fn with_request<V: Into<crate::model::GetServiceConnectionTokenRequest>>(
1831            mut self,
1832            v: V,
1833        ) -> Self {
1834            self.0.request = v.into();
1835            self
1836        }
1837
1838        /// Sets all the options, replacing any prior values.
1839        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1840            self.0.options = v.into();
1841            self
1842        }
1843
1844        /// Sends the request.
1845        pub async fn send(self) -> Result<crate::model::ServiceConnectionToken> {
1846            (*self.0.stub)
1847                .get_service_connection_token(self.0.request, self.0.options)
1848                .await
1849                .map(crate::Response::into_body)
1850        }
1851
1852        /// Sets the value of [name][crate::model::GetServiceConnectionTokenRequest::name].
1853        ///
1854        /// This is a **required** field for requests.
1855        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1856            self.0.request.name = v.into();
1857            self
1858        }
1859    }
1860
1861    #[doc(hidden)]
1862    impl crate::RequestBuilder for GetServiceConnectionToken {
1863        fn request_options(&mut self) -> &mut crate::RequestOptions {
1864            &mut self.0.options
1865        }
1866    }
1867
1868    /// The request builder for [CrossNetworkAutomationService::list_service_connection_tokens][crate::client::CrossNetworkAutomationService::list_service_connection_tokens] calls.
1869    ///
1870    /// # Example
1871    /// ```
1872    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::ListServiceConnectionTokens;
1873    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
1874    /// use google_cloud_gax::paginator::ItemPaginator;
1875    ///
1876    /// let builder = prepare_request_builder();
1877    /// let mut items = builder.by_item();
1878    /// while let Some(result) = items.next().await {
1879    ///   let item = result?;
1880    /// }
1881    /// # Ok(()) }
1882    ///
1883    /// fn prepare_request_builder() -> ListServiceConnectionTokens {
1884    ///   # panic!();
1885    ///   // ... details omitted ...
1886    /// }
1887    /// ```
1888    #[derive(Clone, Debug)]
1889    pub struct ListServiceConnectionTokens(
1890        RequestBuilder<crate::model::ListServiceConnectionTokensRequest>,
1891    );
1892
1893    impl ListServiceConnectionTokens {
1894        pub(crate) fn new(
1895            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1896        ) -> Self {
1897            Self(RequestBuilder::new(stub))
1898        }
1899
1900        /// Sets the full request, replacing any prior values.
1901        pub fn with_request<V: Into<crate::model::ListServiceConnectionTokensRequest>>(
1902            mut self,
1903            v: V,
1904        ) -> Self {
1905            self.0.request = v.into();
1906            self
1907        }
1908
1909        /// Sets all the options, replacing any prior values.
1910        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1911            self.0.options = v.into();
1912            self
1913        }
1914
1915        /// Sends the request.
1916        pub async fn send(self) -> Result<crate::model::ListServiceConnectionTokensResponse> {
1917            (*self.0.stub)
1918                .list_service_connection_tokens(self.0.request, self.0.options)
1919                .await
1920                .map(crate::Response::into_body)
1921        }
1922
1923        /// Streams each page in the collection.
1924        pub fn by_page(
1925            self,
1926        ) -> impl google_cloud_gax::paginator::Paginator<
1927            crate::model::ListServiceConnectionTokensResponse,
1928            crate::Error,
1929        > {
1930            use std::clone::Clone;
1931            let token = self.0.request.page_token.clone();
1932            let execute = move |token: String| {
1933                let mut builder = self.clone();
1934                builder.0.request = builder.0.request.set_page_token(token);
1935                builder.send()
1936            };
1937            google_cloud_gax::paginator::internal::new_paginator(token, execute)
1938        }
1939
1940        /// Streams each item in the collection.
1941        pub fn by_item(
1942            self,
1943        ) -> impl google_cloud_gax::paginator::ItemPaginator<
1944            crate::model::ListServiceConnectionTokensResponse,
1945            crate::Error,
1946        > {
1947            use google_cloud_gax::paginator::Paginator;
1948            self.by_page().items()
1949        }
1950
1951        /// Sets the value of [parent][crate::model::ListServiceConnectionTokensRequest::parent].
1952        ///
1953        /// This is a **required** field for requests.
1954        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1955            self.0.request.parent = v.into();
1956            self
1957        }
1958
1959        /// Sets the value of [page_size][crate::model::ListServiceConnectionTokensRequest::page_size].
1960        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1961            self.0.request.page_size = v.into();
1962            self
1963        }
1964
1965        /// Sets the value of [page_token][crate::model::ListServiceConnectionTokensRequest::page_token].
1966        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1967            self.0.request.page_token = v.into();
1968            self
1969        }
1970
1971        /// Sets the value of [filter][crate::model::ListServiceConnectionTokensRequest::filter].
1972        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1973            self.0.request.filter = v.into();
1974            self
1975        }
1976
1977        /// Sets the value of [order_by][crate::model::ListServiceConnectionTokensRequest::order_by].
1978        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1979            self.0.request.order_by = v.into();
1980            self
1981        }
1982    }
1983
1984    #[doc(hidden)]
1985    impl crate::RequestBuilder for ListServiceConnectionTokens {
1986        fn request_options(&mut self) -> &mut crate::RequestOptions {
1987            &mut self.0.options
1988        }
1989    }
1990
1991    /// The request builder for [CrossNetworkAutomationService::create_service_connection_token][crate::client::CrossNetworkAutomationService::create_service_connection_token] calls.
1992    ///
1993    /// # Example
1994    /// ```
1995    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::CreateServiceConnectionToken;
1996    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
1997    /// use google_cloud_lro::Poller;
1998    ///
1999    /// let builder = prepare_request_builder();
2000    /// let response = builder.poller().until_done().await?;
2001    /// # Ok(()) }
2002    ///
2003    /// fn prepare_request_builder() -> CreateServiceConnectionToken {
2004    ///   # panic!();
2005    ///   // ... details omitted ...
2006    /// }
2007    /// ```
2008    #[derive(Clone, Debug)]
2009    pub struct CreateServiceConnectionToken(
2010        RequestBuilder<crate::model::CreateServiceConnectionTokenRequest>,
2011    );
2012
2013    impl CreateServiceConnectionToken {
2014        pub(crate) fn new(
2015            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2016        ) -> Self {
2017            Self(RequestBuilder::new(stub))
2018        }
2019
2020        /// Sets the full request, replacing any prior values.
2021        pub fn with_request<V: Into<crate::model::CreateServiceConnectionTokenRequest>>(
2022            mut self,
2023            v: V,
2024        ) -> Self {
2025            self.0.request = v.into();
2026            self
2027        }
2028
2029        /// Sets all the options, replacing any prior values.
2030        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2031            self.0.options = v.into();
2032            self
2033        }
2034
2035        /// Sends the request.
2036        ///
2037        /// # Long running operations
2038        ///
2039        /// This starts, but does not poll, a longrunning operation. More information
2040        /// on [create_service_connection_token][crate::client::CrossNetworkAutomationService::create_service_connection_token].
2041        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2042            (*self.0.stub)
2043                .create_service_connection_token(self.0.request, self.0.options)
2044                .await
2045                .map(crate::Response::into_body)
2046        }
2047
2048        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_service_connection_token`.
2049        pub fn poller(
2050            self,
2051        ) -> impl google_cloud_lro::Poller<
2052            crate::model::ServiceConnectionToken,
2053            crate::model::OperationMetadata,
2054        > {
2055            type Operation = google_cloud_lro::internal::Operation<
2056                crate::model::ServiceConnectionToken,
2057                crate::model::OperationMetadata,
2058            >;
2059            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2060            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2061
2062            let stub = self.0.stub.clone();
2063            let mut options = self.0.options.clone();
2064            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2065            let query = move |name| {
2066                let stub = stub.clone();
2067                let options = options.clone();
2068                async {
2069                    let op = GetOperation::new(stub)
2070                        .set_name(name)
2071                        .with_options(options)
2072                        .send()
2073                        .await?;
2074                    Ok(Operation::new(op))
2075                }
2076            };
2077
2078            let start = move || async {
2079                let op = self.send().await?;
2080                Ok(Operation::new(op))
2081            };
2082
2083            google_cloud_lro::internal::new_poller(
2084                polling_error_policy,
2085                polling_backoff_policy,
2086                start,
2087                query,
2088            )
2089        }
2090
2091        /// Sets the value of [parent][crate::model::CreateServiceConnectionTokenRequest::parent].
2092        ///
2093        /// This is a **required** field for requests.
2094        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2095            self.0.request.parent = v.into();
2096            self
2097        }
2098
2099        /// Sets the value of [service_connection_token_id][crate::model::CreateServiceConnectionTokenRequest::service_connection_token_id].
2100        pub fn set_service_connection_token_id<T: Into<std::string::String>>(
2101            mut self,
2102            v: T,
2103        ) -> Self {
2104            self.0.request.service_connection_token_id = v.into();
2105            self
2106        }
2107
2108        /// Sets the value of [service_connection_token][crate::model::CreateServiceConnectionTokenRequest::service_connection_token].
2109        ///
2110        /// This is a **required** field for requests.
2111        pub fn set_service_connection_token<T>(mut self, v: T) -> Self
2112        where
2113            T: std::convert::Into<crate::model::ServiceConnectionToken>,
2114        {
2115            self.0.request.service_connection_token = std::option::Option::Some(v.into());
2116            self
2117        }
2118
2119        /// Sets or clears the value of [service_connection_token][crate::model::CreateServiceConnectionTokenRequest::service_connection_token].
2120        ///
2121        /// This is a **required** field for requests.
2122        pub fn set_or_clear_service_connection_token<T>(mut self, v: std::option::Option<T>) -> Self
2123        where
2124            T: std::convert::Into<crate::model::ServiceConnectionToken>,
2125        {
2126            self.0.request.service_connection_token = v.map(|x| x.into());
2127            self
2128        }
2129
2130        /// Sets the value of [request_id][crate::model::CreateServiceConnectionTokenRequest::request_id].
2131        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2132            self.0.request.request_id = v.into();
2133            self
2134        }
2135    }
2136
2137    #[doc(hidden)]
2138    impl crate::RequestBuilder for CreateServiceConnectionToken {
2139        fn request_options(&mut self) -> &mut crate::RequestOptions {
2140            &mut self.0.options
2141        }
2142    }
2143
2144    /// The request builder for [CrossNetworkAutomationService::delete_service_connection_token][crate::client::CrossNetworkAutomationService::delete_service_connection_token] calls.
2145    ///
2146    /// # Example
2147    /// ```
2148    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::DeleteServiceConnectionToken;
2149    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
2150    /// use google_cloud_lro::Poller;
2151    ///
2152    /// let builder = prepare_request_builder();
2153    /// let response = builder.poller().until_done().await?;
2154    /// # Ok(()) }
2155    ///
2156    /// fn prepare_request_builder() -> DeleteServiceConnectionToken {
2157    ///   # panic!();
2158    ///   // ... details omitted ...
2159    /// }
2160    /// ```
2161    #[derive(Clone, Debug)]
2162    pub struct DeleteServiceConnectionToken(
2163        RequestBuilder<crate::model::DeleteServiceConnectionTokenRequest>,
2164    );
2165
2166    impl DeleteServiceConnectionToken {
2167        pub(crate) fn new(
2168            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2169        ) -> Self {
2170            Self(RequestBuilder::new(stub))
2171        }
2172
2173        /// Sets the full request, replacing any prior values.
2174        pub fn with_request<V: Into<crate::model::DeleteServiceConnectionTokenRequest>>(
2175            mut self,
2176            v: V,
2177        ) -> Self {
2178            self.0.request = v.into();
2179            self
2180        }
2181
2182        /// Sets all the options, replacing any prior values.
2183        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2184            self.0.options = v.into();
2185            self
2186        }
2187
2188        /// Sends the request.
2189        ///
2190        /// # Long running operations
2191        ///
2192        /// This starts, but does not poll, a longrunning operation. More information
2193        /// on [delete_service_connection_token][crate::client::CrossNetworkAutomationService::delete_service_connection_token].
2194        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2195            (*self.0.stub)
2196                .delete_service_connection_token(self.0.request, self.0.options)
2197                .await
2198                .map(crate::Response::into_body)
2199        }
2200
2201        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_service_connection_token`.
2202        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
2203            type Operation =
2204                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2205            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2206            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2207
2208            let stub = self.0.stub.clone();
2209            let mut options = self.0.options.clone();
2210            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2211            let query = move |name| {
2212                let stub = stub.clone();
2213                let options = options.clone();
2214                async {
2215                    let op = GetOperation::new(stub)
2216                        .set_name(name)
2217                        .with_options(options)
2218                        .send()
2219                        .await?;
2220                    Ok(Operation::new(op))
2221                }
2222            };
2223
2224            let start = move || async {
2225                let op = self.send().await?;
2226                Ok(Operation::new(op))
2227            };
2228
2229            google_cloud_lro::internal::new_unit_response_poller(
2230                polling_error_policy,
2231                polling_backoff_policy,
2232                start,
2233                query,
2234            )
2235        }
2236
2237        /// Sets the value of [name][crate::model::DeleteServiceConnectionTokenRequest::name].
2238        ///
2239        /// This is a **required** field for requests.
2240        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2241            self.0.request.name = v.into();
2242            self
2243        }
2244
2245        /// Sets the value of [request_id][crate::model::DeleteServiceConnectionTokenRequest::request_id].
2246        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2247            self.0.request.request_id = v.into();
2248            self
2249        }
2250
2251        /// Sets the value of [etag][crate::model::DeleteServiceConnectionTokenRequest::etag].
2252        pub fn set_etag<T>(mut self, v: T) -> Self
2253        where
2254            T: std::convert::Into<std::string::String>,
2255        {
2256            self.0.request.etag = std::option::Option::Some(v.into());
2257            self
2258        }
2259
2260        /// Sets or clears the value of [etag][crate::model::DeleteServiceConnectionTokenRequest::etag].
2261        pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
2262        where
2263            T: std::convert::Into<std::string::String>,
2264        {
2265            self.0.request.etag = v.map(|x| x.into());
2266            self
2267        }
2268    }
2269
2270    #[doc(hidden)]
2271    impl crate::RequestBuilder for DeleteServiceConnectionToken {
2272        fn request_options(&mut self) -> &mut crate::RequestOptions {
2273            &mut self.0.options
2274        }
2275    }
2276
2277    /// The request builder for [CrossNetworkAutomationService::list_locations][crate::client::CrossNetworkAutomationService::list_locations] calls.
2278    ///
2279    /// # Example
2280    /// ```
2281    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::ListLocations;
2282    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
2283    /// use google_cloud_gax::paginator::ItemPaginator;
2284    ///
2285    /// let builder = prepare_request_builder();
2286    /// let mut items = builder.by_item();
2287    /// while let Some(result) = items.next().await {
2288    ///   let item = result?;
2289    /// }
2290    /// # Ok(()) }
2291    ///
2292    /// fn prepare_request_builder() -> ListLocations {
2293    ///   # panic!();
2294    ///   // ... details omitted ...
2295    /// }
2296    /// ```
2297    #[derive(Clone, Debug)]
2298    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
2299
2300    impl ListLocations {
2301        pub(crate) fn new(
2302            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2303        ) -> Self {
2304            Self(RequestBuilder::new(stub))
2305        }
2306
2307        /// Sets the full request, replacing any prior values.
2308        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
2309            mut self,
2310            v: V,
2311        ) -> Self {
2312            self.0.request = v.into();
2313            self
2314        }
2315
2316        /// Sets all the options, replacing any prior values.
2317        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2318            self.0.options = v.into();
2319            self
2320        }
2321
2322        /// Sends the request.
2323        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
2324            (*self.0.stub)
2325                .list_locations(self.0.request, self.0.options)
2326                .await
2327                .map(crate::Response::into_body)
2328        }
2329
2330        /// Streams each page in the collection.
2331        pub fn by_page(
2332            self,
2333        ) -> impl google_cloud_gax::paginator::Paginator<
2334            google_cloud_location::model::ListLocationsResponse,
2335            crate::Error,
2336        > {
2337            use std::clone::Clone;
2338            let token = self.0.request.page_token.clone();
2339            let execute = move |token: String| {
2340                let mut builder = self.clone();
2341                builder.0.request = builder.0.request.set_page_token(token);
2342                builder.send()
2343            };
2344            google_cloud_gax::paginator::internal::new_paginator(token, execute)
2345        }
2346
2347        /// Streams each item in the collection.
2348        pub fn by_item(
2349            self,
2350        ) -> impl google_cloud_gax::paginator::ItemPaginator<
2351            google_cloud_location::model::ListLocationsResponse,
2352            crate::Error,
2353        > {
2354            use google_cloud_gax::paginator::Paginator;
2355            self.by_page().items()
2356        }
2357
2358        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
2359        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2360            self.0.request.name = v.into();
2361            self
2362        }
2363
2364        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
2365        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2366            self.0.request.filter = v.into();
2367            self
2368        }
2369
2370        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
2371        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2372            self.0.request.page_size = v.into();
2373            self
2374        }
2375
2376        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
2377        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2378            self.0.request.page_token = v.into();
2379            self
2380        }
2381    }
2382
2383    #[doc(hidden)]
2384    impl crate::RequestBuilder for ListLocations {
2385        fn request_options(&mut self) -> &mut crate::RequestOptions {
2386            &mut self.0.options
2387        }
2388    }
2389
2390    /// The request builder for [CrossNetworkAutomationService::get_location][crate::client::CrossNetworkAutomationService::get_location] calls.
2391    ///
2392    /// # Example
2393    /// ```
2394    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::GetLocation;
2395    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
2396    ///
2397    /// let builder = prepare_request_builder();
2398    /// let response = builder.send().await?;
2399    /// # Ok(()) }
2400    ///
2401    /// fn prepare_request_builder() -> GetLocation {
2402    ///   # panic!();
2403    ///   // ... details omitted ...
2404    /// }
2405    /// ```
2406    #[derive(Clone, Debug)]
2407    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
2408
2409    impl GetLocation {
2410        pub(crate) fn new(
2411            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2412        ) -> Self {
2413            Self(RequestBuilder::new(stub))
2414        }
2415
2416        /// Sets the full request, replacing any prior values.
2417        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
2418            mut self,
2419            v: V,
2420        ) -> Self {
2421            self.0.request = v.into();
2422            self
2423        }
2424
2425        /// Sets all the options, replacing any prior values.
2426        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2427            self.0.options = v.into();
2428            self
2429        }
2430
2431        /// Sends the request.
2432        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
2433            (*self.0.stub)
2434                .get_location(self.0.request, self.0.options)
2435                .await
2436                .map(crate::Response::into_body)
2437        }
2438
2439        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
2440        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2441            self.0.request.name = v.into();
2442            self
2443        }
2444    }
2445
2446    #[doc(hidden)]
2447    impl crate::RequestBuilder for GetLocation {
2448        fn request_options(&mut self) -> &mut crate::RequestOptions {
2449            &mut self.0.options
2450        }
2451    }
2452
2453    /// The request builder for [CrossNetworkAutomationService::set_iam_policy][crate::client::CrossNetworkAutomationService::set_iam_policy] calls.
2454    ///
2455    /// # Example
2456    /// ```
2457    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::SetIamPolicy;
2458    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
2459    ///
2460    /// let builder = prepare_request_builder();
2461    /// let response = builder.send().await?;
2462    /// # Ok(()) }
2463    ///
2464    /// fn prepare_request_builder() -> SetIamPolicy {
2465    ///   # panic!();
2466    ///   // ... details omitted ...
2467    /// }
2468    /// ```
2469    #[derive(Clone, Debug)]
2470    pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
2471
2472    impl SetIamPolicy {
2473        pub(crate) fn new(
2474            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2475        ) -> Self {
2476            Self(RequestBuilder::new(stub))
2477        }
2478
2479        /// Sets the full request, replacing any prior values.
2480        pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
2481            mut self,
2482            v: V,
2483        ) -> Self {
2484            self.0.request = v.into();
2485            self
2486        }
2487
2488        /// Sets all the options, replacing any prior values.
2489        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2490            self.0.options = v.into();
2491            self
2492        }
2493
2494        /// Sends the request.
2495        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
2496            (*self.0.stub)
2497                .set_iam_policy(self.0.request, self.0.options)
2498                .await
2499                .map(crate::Response::into_body)
2500        }
2501
2502        /// Sets the value of [resource][google_cloud_iam_v1::model::SetIamPolicyRequest::resource].
2503        ///
2504        /// This is a **required** field for requests.
2505        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2506            self.0.request.resource = v.into();
2507            self
2508        }
2509
2510        /// Sets the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
2511        ///
2512        /// This is a **required** field for requests.
2513        pub fn set_policy<T>(mut self, v: T) -> Self
2514        where
2515            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
2516        {
2517            self.0.request.policy = std::option::Option::Some(v.into());
2518            self
2519        }
2520
2521        /// Sets or clears the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
2522        ///
2523        /// This is a **required** field for requests.
2524        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
2525        where
2526            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
2527        {
2528            self.0.request.policy = v.map(|x| x.into());
2529            self
2530        }
2531
2532        /// Sets the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
2533        pub fn set_update_mask<T>(mut self, v: T) -> Self
2534        where
2535            T: std::convert::Into<wkt::FieldMask>,
2536        {
2537            self.0.request.update_mask = std::option::Option::Some(v.into());
2538            self
2539        }
2540
2541        /// Sets or clears the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
2542        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2543        where
2544            T: std::convert::Into<wkt::FieldMask>,
2545        {
2546            self.0.request.update_mask = v.map(|x| x.into());
2547            self
2548        }
2549    }
2550
2551    #[doc(hidden)]
2552    impl crate::RequestBuilder for SetIamPolicy {
2553        fn request_options(&mut self) -> &mut crate::RequestOptions {
2554            &mut self.0.options
2555        }
2556    }
2557
2558    /// The request builder for [CrossNetworkAutomationService::get_iam_policy][crate::client::CrossNetworkAutomationService::get_iam_policy] calls.
2559    ///
2560    /// # Example
2561    /// ```
2562    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::GetIamPolicy;
2563    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
2564    ///
2565    /// let builder = prepare_request_builder();
2566    /// let response = builder.send().await?;
2567    /// # Ok(()) }
2568    ///
2569    /// fn prepare_request_builder() -> GetIamPolicy {
2570    ///   # panic!();
2571    ///   // ... details omitted ...
2572    /// }
2573    /// ```
2574    #[derive(Clone, Debug)]
2575    pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
2576
2577    impl GetIamPolicy {
2578        pub(crate) fn new(
2579            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2580        ) -> Self {
2581            Self(RequestBuilder::new(stub))
2582        }
2583
2584        /// Sets the full request, replacing any prior values.
2585        pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
2586            mut self,
2587            v: V,
2588        ) -> Self {
2589            self.0.request = v.into();
2590            self
2591        }
2592
2593        /// Sets all the options, replacing any prior values.
2594        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2595            self.0.options = v.into();
2596            self
2597        }
2598
2599        /// Sends the request.
2600        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
2601            (*self.0.stub)
2602                .get_iam_policy(self.0.request, self.0.options)
2603                .await
2604                .map(crate::Response::into_body)
2605        }
2606
2607        /// Sets the value of [resource][google_cloud_iam_v1::model::GetIamPolicyRequest::resource].
2608        ///
2609        /// This is a **required** field for requests.
2610        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2611            self.0.request.resource = v.into();
2612            self
2613        }
2614
2615        /// Sets the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
2616        pub fn set_options<T>(mut self, v: T) -> Self
2617        where
2618            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
2619        {
2620            self.0.request.options = std::option::Option::Some(v.into());
2621            self
2622        }
2623
2624        /// Sets or clears the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
2625        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
2626        where
2627            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
2628        {
2629            self.0.request.options = v.map(|x| x.into());
2630            self
2631        }
2632    }
2633
2634    #[doc(hidden)]
2635    impl crate::RequestBuilder for GetIamPolicy {
2636        fn request_options(&mut self) -> &mut crate::RequestOptions {
2637            &mut self.0.options
2638        }
2639    }
2640
2641    /// The request builder for [CrossNetworkAutomationService::test_iam_permissions][crate::client::CrossNetworkAutomationService::test_iam_permissions] calls.
2642    ///
2643    /// # Example
2644    /// ```
2645    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::TestIamPermissions;
2646    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
2647    ///
2648    /// let builder = prepare_request_builder();
2649    /// let response = builder.send().await?;
2650    /// # Ok(()) }
2651    ///
2652    /// fn prepare_request_builder() -> TestIamPermissions {
2653    ///   # panic!();
2654    ///   // ... details omitted ...
2655    /// }
2656    /// ```
2657    #[derive(Clone, Debug)]
2658    pub struct TestIamPermissions(
2659        RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
2660    );
2661
2662    impl TestIamPermissions {
2663        pub(crate) fn new(
2664            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2665        ) -> Self {
2666            Self(RequestBuilder::new(stub))
2667        }
2668
2669        /// Sets the full request, replacing any prior values.
2670        pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
2671            mut self,
2672            v: V,
2673        ) -> Self {
2674            self.0.request = v.into();
2675            self
2676        }
2677
2678        /// Sets all the options, replacing any prior values.
2679        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2680            self.0.options = v.into();
2681            self
2682        }
2683
2684        /// Sends the request.
2685        pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
2686            (*self.0.stub)
2687                .test_iam_permissions(self.0.request, self.0.options)
2688                .await
2689                .map(crate::Response::into_body)
2690        }
2691
2692        /// Sets the value of [resource][google_cloud_iam_v1::model::TestIamPermissionsRequest::resource].
2693        ///
2694        /// This is a **required** field for requests.
2695        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2696            self.0.request.resource = v.into();
2697            self
2698        }
2699
2700        /// Sets the value of [permissions][google_cloud_iam_v1::model::TestIamPermissionsRequest::permissions].
2701        ///
2702        /// This is a **required** field for requests.
2703        pub fn set_permissions<T, V>(mut self, v: T) -> Self
2704        where
2705            T: std::iter::IntoIterator<Item = V>,
2706            V: std::convert::Into<std::string::String>,
2707        {
2708            use std::iter::Iterator;
2709            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
2710            self
2711        }
2712    }
2713
2714    #[doc(hidden)]
2715    impl crate::RequestBuilder for TestIamPermissions {
2716        fn request_options(&mut self) -> &mut crate::RequestOptions {
2717            &mut self.0.options
2718        }
2719    }
2720
2721    /// The request builder for [CrossNetworkAutomationService::list_operations][crate::client::CrossNetworkAutomationService::list_operations] calls.
2722    ///
2723    /// # Example
2724    /// ```
2725    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::ListOperations;
2726    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
2727    /// use google_cloud_gax::paginator::ItemPaginator;
2728    ///
2729    /// let builder = prepare_request_builder();
2730    /// let mut items = builder.by_item();
2731    /// while let Some(result) = items.next().await {
2732    ///   let item = result?;
2733    /// }
2734    /// # Ok(()) }
2735    ///
2736    /// fn prepare_request_builder() -> ListOperations {
2737    ///   # panic!();
2738    ///   // ... details omitted ...
2739    /// }
2740    /// ```
2741    #[derive(Clone, Debug)]
2742    pub struct ListOperations(
2743        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
2744    );
2745
2746    impl ListOperations {
2747        pub(crate) fn new(
2748            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2749        ) -> Self {
2750            Self(RequestBuilder::new(stub))
2751        }
2752
2753        /// Sets the full request, replacing any prior values.
2754        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
2755            mut self,
2756            v: V,
2757        ) -> Self {
2758            self.0.request = v.into();
2759            self
2760        }
2761
2762        /// Sets all the options, replacing any prior values.
2763        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2764            self.0.options = v.into();
2765            self
2766        }
2767
2768        /// Sends the request.
2769        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
2770            (*self.0.stub)
2771                .list_operations(self.0.request, self.0.options)
2772                .await
2773                .map(crate::Response::into_body)
2774        }
2775
2776        /// Streams each page in the collection.
2777        pub fn by_page(
2778            self,
2779        ) -> impl google_cloud_gax::paginator::Paginator<
2780            google_cloud_longrunning::model::ListOperationsResponse,
2781            crate::Error,
2782        > {
2783            use std::clone::Clone;
2784            let token = self.0.request.page_token.clone();
2785            let execute = move |token: String| {
2786                let mut builder = self.clone();
2787                builder.0.request = builder.0.request.set_page_token(token);
2788                builder.send()
2789            };
2790            google_cloud_gax::paginator::internal::new_paginator(token, execute)
2791        }
2792
2793        /// Streams each item in the collection.
2794        pub fn by_item(
2795            self,
2796        ) -> impl google_cloud_gax::paginator::ItemPaginator<
2797            google_cloud_longrunning::model::ListOperationsResponse,
2798            crate::Error,
2799        > {
2800            use google_cloud_gax::paginator::Paginator;
2801            self.by_page().items()
2802        }
2803
2804        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
2805        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2806            self.0.request.name = v.into();
2807            self
2808        }
2809
2810        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
2811        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2812            self.0.request.filter = v.into();
2813            self
2814        }
2815
2816        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
2817        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2818            self.0.request.page_size = v.into();
2819            self
2820        }
2821
2822        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
2823        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2824            self.0.request.page_token = v.into();
2825            self
2826        }
2827
2828        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
2829        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
2830            self.0.request.return_partial_success = v.into();
2831            self
2832        }
2833    }
2834
2835    #[doc(hidden)]
2836    impl crate::RequestBuilder for ListOperations {
2837        fn request_options(&mut self) -> &mut crate::RequestOptions {
2838            &mut self.0.options
2839        }
2840    }
2841
2842    /// The request builder for [CrossNetworkAutomationService::get_operation][crate::client::CrossNetworkAutomationService::get_operation] calls.
2843    ///
2844    /// # Example
2845    /// ```
2846    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::GetOperation;
2847    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
2848    ///
2849    /// let builder = prepare_request_builder();
2850    /// let response = builder.send().await?;
2851    /// # Ok(()) }
2852    ///
2853    /// fn prepare_request_builder() -> GetOperation {
2854    ///   # panic!();
2855    ///   // ... details omitted ...
2856    /// }
2857    /// ```
2858    #[derive(Clone, Debug)]
2859    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
2860
2861    impl GetOperation {
2862        pub(crate) fn new(
2863            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2864        ) -> Self {
2865            Self(RequestBuilder::new(stub))
2866        }
2867
2868        /// Sets the full request, replacing any prior values.
2869        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
2870            mut self,
2871            v: V,
2872        ) -> Self {
2873            self.0.request = v.into();
2874            self
2875        }
2876
2877        /// Sets all the options, replacing any prior values.
2878        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2879            self.0.options = v.into();
2880            self
2881        }
2882
2883        /// Sends the request.
2884        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2885            (*self.0.stub)
2886                .get_operation(self.0.request, self.0.options)
2887                .await
2888                .map(crate::Response::into_body)
2889        }
2890
2891        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
2892        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2893            self.0.request.name = v.into();
2894            self
2895        }
2896    }
2897
2898    #[doc(hidden)]
2899    impl crate::RequestBuilder for GetOperation {
2900        fn request_options(&mut self) -> &mut crate::RequestOptions {
2901            &mut self.0.options
2902        }
2903    }
2904
2905    /// The request builder for [CrossNetworkAutomationService::delete_operation][crate::client::CrossNetworkAutomationService::delete_operation] calls.
2906    ///
2907    /// # Example
2908    /// ```
2909    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::DeleteOperation;
2910    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
2911    ///
2912    /// let builder = prepare_request_builder();
2913    /// let response = builder.send().await?;
2914    /// # Ok(()) }
2915    ///
2916    /// fn prepare_request_builder() -> DeleteOperation {
2917    ///   # panic!();
2918    ///   // ... details omitted ...
2919    /// }
2920    /// ```
2921    #[derive(Clone, Debug)]
2922    pub struct DeleteOperation(
2923        RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
2924    );
2925
2926    impl DeleteOperation {
2927        pub(crate) fn new(
2928            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2929        ) -> Self {
2930            Self(RequestBuilder::new(stub))
2931        }
2932
2933        /// Sets the full request, replacing any prior values.
2934        pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
2935            mut self,
2936            v: V,
2937        ) -> Self {
2938            self.0.request = v.into();
2939            self
2940        }
2941
2942        /// Sets all the options, replacing any prior values.
2943        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2944            self.0.options = v.into();
2945            self
2946        }
2947
2948        /// Sends the request.
2949        pub async fn send(self) -> Result<()> {
2950            (*self.0.stub)
2951                .delete_operation(self.0.request, self.0.options)
2952                .await
2953                .map(crate::Response::into_body)
2954        }
2955
2956        /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
2957        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2958            self.0.request.name = v.into();
2959            self
2960        }
2961    }
2962
2963    #[doc(hidden)]
2964    impl crate::RequestBuilder for DeleteOperation {
2965        fn request_options(&mut self) -> &mut crate::RequestOptions {
2966            &mut self.0.options
2967        }
2968    }
2969
2970    /// The request builder for [CrossNetworkAutomationService::cancel_operation][crate::client::CrossNetworkAutomationService::cancel_operation] calls.
2971    ///
2972    /// # Example
2973    /// ```
2974    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::CancelOperation;
2975    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
2976    ///
2977    /// let builder = prepare_request_builder();
2978    /// let response = builder.send().await?;
2979    /// # Ok(()) }
2980    ///
2981    /// fn prepare_request_builder() -> CancelOperation {
2982    ///   # panic!();
2983    ///   // ... details omitted ...
2984    /// }
2985    /// ```
2986    #[derive(Clone, Debug)]
2987    pub struct CancelOperation(
2988        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
2989    );
2990
2991    impl CancelOperation {
2992        pub(crate) fn new(
2993            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2994        ) -> Self {
2995            Self(RequestBuilder::new(stub))
2996        }
2997
2998        /// Sets the full request, replacing any prior values.
2999        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
3000            mut self,
3001            v: V,
3002        ) -> Self {
3003            self.0.request = v.into();
3004            self
3005        }
3006
3007        /// Sets all the options, replacing any prior values.
3008        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3009            self.0.options = v.into();
3010            self
3011        }
3012
3013        /// Sends the request.
3014        pub async fn send(self) -> Result<()> {
3015            (*self.0.stub)
3016                .cancel_operation(self.0.request, self.0.options)
3017                .await
3018                .map(crate::Response::into_body)
3019        }
3020
3021        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
3022        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3023            self.0.request.name = v.into();
3024            self
3025        }
3026    }
3027
3028    #[doc(hidden)]
3029    impl crate::RequestBuilder for CancelOperation {
3030        fn request_options(&mut self) -> &mut crate::RequestOptions {
3031            &mut self.0.options
3032        }
3033    }
3034}
3035
3036/// Request and client builders for [DataTransferService][crate::client::DataTransferService].
3037pub mod data_transfer_service {
3038    use crate::Result;
3039
3040    /// A builder for [DataTransferService][crate::client::DataTransferService].
3041    ///
3042    /// ```
3043    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
3044    /// # use google_cloud_networkconnectivity_v1::*;
3045    /// # use builder::data_transfer_service::ClientBuilder;
3046    /// # use client::DataTransferService;
3047    /// let builder : ClientBuilder = DataTransferService::builder();
3048    /// let client = builder
3049    ///     .with_endpoint("https://networkconnectivity.googleapis.com")
3050    ///     .build().await?;
3051    /// # Ok(()) }
3052    /// ```
3053    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
3054
3055    pub(crate) mod client {
3056        use super::super::super::client::DataTransferService;
3057        pub struct Factory;
3058        impl crate::ClientFactory for Factory {
3059            type Client = DataTransferService;
3060            type Credentials = gaxi::options::Credentials;
3061            async fn build(
3062                self,
3063                config: gaxi::options::ClientConfig,
3064            ) -> crate::ClientBuilderResult<Self::Client> {
3065                Self::Client::new(config).await
3066            }
3067        }
3068    }
3069
3070    /// Common implementation for [crate::client::DataTransferService] request builders.
3071    #[derive(Clone, Debug)]
3072    pub(crate) struct RequestBuilder<R: std::default::Default> {
3073        stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3074        request: R,
3075        options: crate::RequestOptions,
3076    }
3077
3078    impl<R> RequestBuilder<R>
3079    where
3080        R: std::default::Default,
3081    {
3082        pub(crate) fn new(
3083            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3084        ) -> Self {
3085            Self {
3086                stub,
3087                request: R::default(),
3088                options: crate::RequestOptions::default(),
3089            }
3090        }
3091    }
3092
3093    /// The request builder for [DataTransferService::list_multicloud_data_transfer_configs][crate::client::DataTransferService::list_multicloud_data_transfer_configs] calls.
3094    ///
3095    /// # Example
3096    /// ```
3097    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::ListMulticloudDataTransferConfigs;
3098    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
3099    /// use google_cloud_gax::paginator::ItemPaginator;
3100    ///
3101    /// let builder = prepare_request_builder();
3102    /// let mut items = builder.by_item();
3103    /// while let Some(result) = items.next().await {
3104    ///   let item = result?;
3105    /// }
3106    /// # Ok(()) }
3107    ///
3108    /// fn prepare_request_builder() -> ListMulticloudDataTransferConfigs {
3109    ///   # panic!();
3110    ///   // ... details omitted ...
3111    /// }
3112    /// ```
3113    #[derive(Clone, Debug)]
3114    pub struct ListMulticloudDataTransferConfigs(
3115        RequestBuilder<crate::model::ListMulticloudDataTransferConfigsRequest>,
3116    );
3117
3118    impl ListMulticloudDataTransferConfigs {
3119        pub(crate) fn new(
3120            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3121        ) -> Self {
3122            Self(RequestBuilder::new(stub))
3123        }
3124
3125        /// Sets the full request, replacing any prior values.
3126        pub fn with_request<V: Into<crate::model::ListMulticloudDataTransferConfigsRequest>>(
3127            mut self,
3128            v: V,
3129        ) -> Self {
3130            self.0.request = v.into();
3131            self
3132        }
3133
3134        /// Sets all the options, replacing any prior values.
3135        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3136            self.0.options = v.into();
3137            self
3138        }
3139
3140        /// Sends the request.
3141        pub async fn send(self) -> Result<crate::model::ListMulticloudDataTransferConfigsResponse> {
3142            (*self.0.stub)
3143                .list_multicloud_data_transfer_configs(self.0.request, self.0.options)
3144                .await
3145                .map(crate::Response::into_body)
3146        }
3147
3148        /// Streams each page in the collection.
3149        pub fn by_page(
3150            self,
3151        ) -> impl google_cloud_gax::paginator::Paginator<
3152            crate::model::ListMulticloudDataTransferConfigsResponse,
3153            crate::Error,
3154        > {
3155            use std::clone::Clone;
3156            let token = self.0.request.page_token.clone();
3157            let execute = move |token: String| {
3158                let mut builder = self.clone();
3159                builder.0.request = builder.0.request.set_page_token(token);
3160                builder.send()
3161            };
3162            google_cloud_gax::paginator::internal::new_paginator(token, execute)
3163        }
3164
3165        /// Streams each item in the collection.
3166        pub fn by_item(
3167            self,
3168        ) -> impl google_cloud_gax::paginator::ItemPaginator<
3169            crate::model::ListMulticloudDataTransferConfigsResponse,
3170            crate::Error,
3171        > {
3172            use google_cloud_gax::paginator::Paginator;
3173            self.by_page().items()
3174        }
3175
3176        /// Sets the value of [parent][crate::model::ListMulticloudDataTransferConfigsRequest::parent].
3177        ///
3178        /// This is a **required** field for requests.
3179        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3180            self.0.request.parent = v.into();
3181            self
3182        }
3183
3184        /// Sets the value of [page_size][crate::model::ListMulticloudDataTransferConfigsRequest::page_size].
3185        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3186            self.0.request.page_size = v.into();
3187            self
3188        }
3189
3190        /// Sets the value of [page_token][crate::model::ListMulticloudDataTransferConfigsRequest::page_token].
3191        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3192            self.0.request.page_token = v.into();
3193            self
3194        }
3195
3196        /// Sets the value of [filter][crate::model::ListMulticloudDataTransferConfigsRequest::filter].
3197        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3198            self.0.request.filter = v.into();
3199            self
3200        }
3201
3202        /// Sets the value of [order_by][crate::model::ListMulticloudDataTransferConfigsRequest::order_by].
3203        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3204            self.0.request.order_by = v.into();
3205            self
3206        }
3207
3208        /// Sets the value of [return_partial_success][crate::model::ListMulticloudDataTransferConfigsRequest::return_partial_success].
3209        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
3210            self.0.request.return_partial_success = v.into();
3211            self
3212        }
3213    }
3214
3215    #[doc(hidden)]
3216    impl crate::RequestBuilder for ListMulticloudDataTransferConfigs {
3217        fn request_options(&mut self) -> &mut crate::RequestOptions {
3218            &mut self.0.options
3219        }
3220    }
3221
3222    /// The request builder for [DataTransferService::get_multicloud_data_transfer_config][crate::client::DataTransferService::get_multicloud_data_transfer_config] calls.
3223    ///
3224    /// # Example
3225    /// ```
3226    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::GetMulticloudDataTransferConfig;
3227    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
3228    ///
3229    /// let builder = prepare_request_builder();
3230    /// let response = builder.send().await?;
3231    /// # Ok(()) }
3232    ///
3233    /// fn prepare_request_builder() -> GetMulticloudDataTransferConfig {
3234    ///   # panic!();
3235    ///   // ... details omitted ...
3236    /// }
3237    /// ```
3238    #[derive(Clone, Debug)]
3239    pub struct GetMulticloudDataTransferConfig(
3240        RequestBuilder<crate::model::GetMulticloudDataTransferConfigRequest>,
3241    );
3242
3243    impl GetMulticloudDataTransferConfig {
3244        pub(crate) fn new(
3245            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3246        ) -> Self {
3247            Self(RequestBuilder::new(stub))
3248        }
3249
3250        /// Sets the full request, replacing any prior values.
3251        pub fn with_request<V: Into<crate::model::GetMulticloudDataTransferConfigRequest>>(
3252            mut self,
3253            v: V,
3254        ) -> Self {
3255            self.0.request = v.into();
3256            self
3257        }
3258
3259        /// Sets all the options, replacing any prior values.
3260        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3261            self.0.options = v.into();
3262            self
3263        }
3264
3265        /// Sends the request.
3266        pub async fn send(self) -> Result<crate::model::MulticloudDataTransferConfig> {
3267            (*self.0.stub)
3268                .get_multicloud_data_transfer_config(self.0.request, self.0.options)
3269                .await
3270                .map(crate::Response::into_body)
3271        }
3272
3273        /// Sets the value of [name][crate::model::GetMulticloudDataTransferConfigRequest::name].
3274        ///
3275        /// This is a **required** field for requests.
3276        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3277            self.0.request.name = v.into();
3278            self
3279        }
3280    }
3281
3282    #[doc(hidden)]
3283    impl crate::RequestBuilder for GetMulticloudDataTransferConfig {
3284        fn request_options(&mut self) -> &mut crate::RequestOptions {
3285            &mut self.0.options
3286        }
3287    }
3288
3289    /// The request builder for [DataTransferService::create_multicloud_data_transfer_config][crate::client::DataTransferService::create_multicloud_data_transfer_config] calls.
3290    ///
3291    /// # Example
3292    /// ```
3293    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::CreateMulticloudDataTransferConfig;
3294    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
3295    /// use google_cloud_lro::Poller;
3296    ///
3297    /// let builder = prepare_request_builder();
3298    /// let response = builder.poller().until_done().await?;
3299    /// # Ok(()) }
3300    ///
3301    /// fn prepare_request_builder() -> CreateMulticloudDataTransferConfig {
3302    ///   # panic!();
3303    ///   // ... details omitted ...
3304    /// }
3305    /// ```
3306    #[derive(Clone, Debug)]
3307    pub struct CreateMulticloudDataTransferConfig(
3308        RequestBuilder<crate::model::CreateMulticloudDataTransferConfigRequest>,
3309    );
3310
3311    impl CreateMulticloudDataTransferConfig {
3312        pub(crate) fn new(
3313            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3314        ) -> Self {
3315            Self(RequestBuilder::new(stub))
3316        }
3317
3318        /// Sets the full request, replacing any prior values.
3319        pub fn with_request<V: Into<crate::model::CreateMulticloudDataTransferConfigRequest>>(
3320            mut self,
3321            v: V,
3322        ) -> Self {
3323            self.0.request = v.into();
3324            self
3325        }
3326
3327        /// Sets all the options, replacing any prior values.
3328        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3329            self.0.options = v.into();
3330            self
3331        }
3332
3333        /// Sends the request.
3334        ///
3335        /// # Long running operations
3336        ///
3337        /// This starts, but does not poll, a longrunning operation. More information
3338        /// on [create_multicloud_data_transfer_config][crate::client::DataTransferService::create_multicloud_data_transfer_config].
3339        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3340            (*self.0.stub)
3341                .create_multicloud_data_transfer_config(self.0.request, self.0.options)
3342                .await
3343                .map(crate::Response::into_body)
3344        }
3345
3346        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_multicloud_data_transfer_config`.
3347        pub fn poller(
3348            self,
3349        ) -> impl google_cloud_lro::Poller<
3350            crate::model::MulticloudDataTransferConfig,
3351            crate::model::OperationMetadata,
3352        > {
3353            type Operation = google_cloud_lro::internal::Operation<
3354                crate::model::MulticloudDataTransferConfig,
3355                crate::model::OperationMetadata,
3356            >;
3357            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3358            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3359
3360            let stub = self.0.stub.clone();
3361            let mut options = self.0.options.clone();
3362            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3363            let query = move |name| {
3364                let stub = stub.clone();
3365                let options = options.clone();
3366                async {
3367                    let op = GetOperation::new(stub)
3368                        .set_name(name)
3369                        .with_options(options)
3370                        .send()
3371                        .await?;
3372                    Ok(Operation::new(op))
3373                }
3374            };
3375
3376            let start = move || async {
3377                let op = self.send().await?;
3378                Ok(Operation::new(op))
3379            };
3380
3381            google_cloud_lro::internal::new_poller(
3382                polling_error_policy,
3383                polling_backoff_policy,
3384                start,
3385                query,
3386            )
3387        }
3388
3389        /// Sets the value of [parent][crate::model::CreateMulticloudDataTransferConfigRequest::parent].
3390        ///
3391        /// This is a **required** field for requests.
3392        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3393            self.0.request.parent = v.into();
3394            self
3395        }
3396
3397        /// Sets the value of [multicloud_data_transfer_config_id][crate::model::CreateMulticloudDataTransferConfigRequest::multicloud_data_transfer_config_id].
3398        ///
3399        /// This is a **required** field for requests.
3400        pub fn set_multicloud_data_transfer_config_id<T: Into<std::string::String>>(
3401            mut self,
3402            v: T,
3403        ) -> Self {
3404            self.0.request.multicloud_data_transfer_config_id = v.into();
3405            self
3406        }
3407
3408        /// Sets the value of [multicloud_data_transfer_config][crate::model::CreateMulticloudDataTransferConfigRequest::multicloud_data_transfer_config].
3409        ///
3410        /// This is a **required** field for requests.
3411        pub fn set_multicloud_data_transfer_config<T>(mut self, v: T) -> Self
3412        where
3413            T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
3414        {
3415            self.0.request.multicloud_data_transfer_config = std::option::Option::Some(v.into());
3416            self
3417        }
3418
3419        /// Sets or clears the value of [multicloud_data_transfer_config][crate::model::CreateMulticloudDataTransferConfigRequest::multicloud_data_transfer_config].
3420        ///
3421        /// This is a **required** field for requests.
3422        pub fn set_or_clear_multicloud_data_transfer_config<T>(
3423            mut self,
3424            v: std::option::Option<T>,
3425        ) -> Self
3426        where
3427            T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
3428        {
3429            self.0.request.multicloud_data_transfer_config = v.map(|x| x.into());
3430            self
3431        }
3432
3433        /// Sets the value of [request_id][crate::model::CreateMulticloudDataTransferConfigRequest::request_id].
3434        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3435            self.0.request.request_id = v.into();
3436            self
3437        }
3438    }
3439
3440    #[doc(hidden)]
3441    impl crate::RequestBuilder for CreateMulticloudDataTransferConfig {
3442        fn request_options(&mut self) -> &mut crate::RequestOptions {
3443            &mut self.0.options
3444        }
3445    }
3446
3447    /// The request builder for [DataTransferService::update_multicloud_data_transfer_config][crate::client::DataTransferService::update_multicloud_data_transfer_config] calls.
3448    ///
3449    /// # Example
3450    /// ```
3451    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::UpdateMulticloudDataTransferConfig;
3452    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
3453    /// use google_cloud_lro::Poller;
3454    ///
3455    /// let builder = prepare_request_builder();
3456    /// let response = builder.poller().until_done().await?;
3457    /// # Ok(()) }
3458    ///
3459    /// fn prepare_request_builder() -> UpdateMulticloudDataTransferConfig {
3460    ///   # panic!();
3461    ///   // ... details omitted ...
3462    /// }
3463    /// ```
3464    #[derive(Clone, Debug)]
3465    pub struct UpdateMulticloudDataTransferConfig(
3466        RequestBuilder<crate::model::UpdateMulticloudDataTransferConfigRequest>,
3467    );
3468
3469    impl UpdateMulticloudDataTransferConfig {
3470        pub(crate) fn new(
3471            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3472        ) -> Self {
3473            Self(RequestBuilder::new(stub))
3474        }
3475
3476        /// Sets the full request, replacing any prior values.
3477        pub fn with_request<V: Into<crate::model::UpdateMulticloudDataTransferConfigRequest>>(
3478            mut self,
3479            v: V,
3480        ) -> Self {
3481            self.0.request = v.into();
3482            self
3483        }
3484
3485        /// Sets all the options, replacing any prior values.
3486        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3487            self.0.options = v.into();
3488            self
3489        }
3490
3491        /// Sends the request.
3492        ///
3493        /// # Long running operations
3494        ///
3495        /// This starts, but does not poll, a longrunning operation. More information
3496        /// on [update_multicloud_data_transfer_config][crate::client::DataTransferService::update_multicloud_data_transfer_config].
3497        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3498            (*self.0.stub)
3499                .update_multicloud_data_transfer_config(self.0.request, self.0.options)
3500                .await
3501                .map(crate::Response::into_body)
3502        }
3503
3504        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_multicloud_data_transfer_config`.
3505        pub fn poller(
3506            self,
3507        ) -> impl google_cloud_lro::Poller<
3508            crate::model::MulticloudDataTransferConfig,
3509            crate::model::OperationMetadata,
3510        > {
3511            type Operation = google_cloud_lro::internal::Operation<
3512                crate::model::MulticloudDataTransferConfig,
3513                crate::model::OperationMetadata,
3514            >;
3515            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3516            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3517
3518            let stub = self.0.stub.clone();
3519            let mut options = self.0.options.clone();
3520            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3521            let query = move |name| {
3522                let stub = stub.clone();
3523                let options = options.clone();
3524                async {
3525                    let op = GetOperation::new(stub)
3526                        .set_name(name)
3527                        .with_options(options)
3528                        .send()
3529                        .await?;
3530                    Ok(Operation::new(op))
3531                }
3532            };
3533
3534            let start = move || async {
3535                let op = self.send().await?;
3536                Ok(Operation::new(op))
3537            };
3538
3539            google_cloud_lro::internal::new_poller(
3540                polling_error_policy,
3541                polling_backoff_policy,
3542                start,
3543                query,
3544            )
3545        }
3546
3547        /// Sets the value of [update_mask][crate::model::UpdateMulticloudDataTransferConfigRequest::update_mask].
3548        pub fn set_update_mask<T>(mut self, v: T) -> Self
3549        where
3550            T: std::convert::Into<wkt::FieldMask>,
3551        {
3552            self.0.request.update_mask = std::option::Option::Some(v.into());
3553            self
3554        }
3555
3556        /// Sets or clears the value of [update_mask][crate::model::UpdateMulticloudDataTransferConfigRequest::update_mask].
3557        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3558        where
3559            T: std::convert::Into<wkt::FieldMask>,
3560        {
3561            self.0.request.update_mask = v.map(|x| x.into());
3562            self
3563        }
3564
3565        /// Sets the value of [multicloud_data_transfer_config][crate::model::UpdateMulticloudDataTransferConfigRequest::multicloud_data_transfer_config].
3566        ///
3567        /// This is a **required** field for requests.
3568        pub fn set_multicloud_data_transfer_config<T>(mut self, v: T) -> Self
3569        where
3570            T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
3571        {
3572            self.0.request.multicloud_data_transfer_config = std::option::Option::Some(v.into());
3573            self
3574        }
3575
3576        /// Sets or clears the value of [multicloud_data_transfer_config][crate::model::UpdateMulticloudDataTransferConfigRequest::multicloud_data_transfer_config].
3577        ///
3578        /// This is a **required** field for requests.
3579        pub fn set_or_clear_multicloud_data_transfer_config<T>(
3580            mut self,
3581            v: std::option::Option<T>,
3582        ) -> Self
3583        where
3584            T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
3585        {
3586            self.0.request.multicloud_data_transfer_config = v.map(|x| x.into());
3587            self
3588        }
3589
3590        /// Sets the value of [request_id][crate::model::UpdateMulticloudDataTransferConfigRequest::request_id].
3591        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3592            self.0.request.request_id = v.into();
3593            self
3594        }
3595    }
3596
3597    #[doc(hidden)]
3598    impl crate::RequestBuilder for UpdateMulticloudDataTransferConfig {
3599        fn request_options(&mut self) -> &mut crate::RequestOptions {
3600            &mut self.0.options
3601        }
3602    }
3603
3604    /// The request builder for [DataTransferService::delete_multicloud_data_transfer_config][crate::client::DataTransferService::delete_multicloud_data_transfer_config] calls.
3605    ///
3606    /// # Example
3607    /// ```
3608    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::DeleteMulticloudDataTransferConfig;
3609    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
3610    /// use google_cloud_lro::Poller;
3611    ///
3612    /// let builder = prepare_request_builder();
3613    /// let response = builder.poller().until_done().await?;
3614    /// # Ok(()) }
3615    ///
3616    /// fn prepare_request_builder() -> DeleteMulticloudDataTransferConfig {
3617    ///   # panic!();
3618    ///   // ... details omitted ...
3619    /// }
3620    /// ```
3621    #[derive(Clone, Debug)]
3622    pub struct DeleteMulticloudDataTransferConfig(
3623        RequestBuilder<crate::model::DeleteMulticloudDataTransferConfigRequest>,
3624    );
3625
3626    impl DeleteMulticloudDataTransferConfig {
3627        pub(crate) fn new(
3628            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3629        ) -> Self {
3630            Self(RequestBuilder::new(stub))
3631        }
3632
3633        /// Sets the full request, replacing any prior values.
3634        pub fn with_request<V: Into<crate::model::DeleteMulticloudDataTransferConfigRequest>>(
3635            mut self,
3636            v: V,
3637        ) -> Self {
3638            self.0.request = v.into();
3639            self
3640        }
3641
3642        /// Sets all the options, replacing any prior values.
3643        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3644            self.0.options = v.into();
3645            self
3646        }
3647
3648        /// Sends the request.
3649        ///
3650        /// # Long running operations
3651        ///
3652        /// This starts, but does not poll, a longrunning operation. More information
3653        /// on [delete_multicloud_data_transfer_config][crate::client::DataTransferService::delete_multicloud_data_transfer_config].
3654        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3655            (*self.0.stub)
3656                .delete_multicloud_data_transfer_config(self.0.request, self.0.options)
3657                .await
3658                .map(crate::Response::into_body)
3659        }
3660
3661        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_multicloud_data_transfer_config`.
3662        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
3663            type Operation =
3664                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
3665            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3666            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3667
3668            let stub = self.0.stub.clone();
3669            let mut options = self.0.options.clone();
3670            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3671            let query = move |name| {
3672                let stub = stub.clone();
3673                let options = options.clone();
3674                async {
3675                    let op = GetOperation::new(stub)
3676                        .set_name(name)
3677                        .with_options(options)
3678                        .send()
3679                        .await?;
3680                    Ok(Operation::new(op))
3681                }
3682            };
3683
3684            let start = move || async {
3685                let op = self.send().await?;
3686                Ok(Operation::new(op))
3687            };
3688
3689            google_cloud_lro::internal::new_unit_response_poller(
3690                polling_error_policy,
3691                polling_backoff_policy,
3692                start,
3693                query,
3694            )
3695        }
3696
3697        /// Sets the value of [name][crate::model::DeleteMulticloudDataTransferConfigRequest::name].
3698        ///
3699        /// This is a **required** field for requests.
3700        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3701            self.0.request.name = v.into();
3702            self
3703        }
3704
3705        /// Sets the value of [request_id][crate::model::DeleteMulticloudDataTransferConfigRequest::request_id].
3706        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3707            self.0.request.request_id = v.into();
3708            self
3709        }
3710
3711        /// Sets the value of [etag][crate::model::DeleteMulticloudDataTransferConfigRequest::etag].
3712        pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
3713            self.0.request.etag = v.into();
3714            self
3715        }
3716    }
3717
3718    #[doc(hidden)]
3719    impl crate::RequestBuilder for DeleteMulticloudDataTransferConfig {
3720        fn request_options(&mut self) -> &mut crate::RequestOptions {
3721            &mut self.0.options
3722        }
3723    }
3724
3725    /// The request builder for [DataTransferService::list_destinations][crate::client::DataTransferService::list_destinations] calls.
3726    ///
3727    /// # Example
3728    /// ```
3729    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::ListDestinations;
3730    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
3731    /// use google_cloud_gax::paginator::ItemPaginator;
3732    ///
3733    /// let builder = prepare_request_builder();
3734    /// let mut items = builder.by_item();
3735    /// while let Some(result) = items.next().await {
3736    ///   let item = result?;
3737    /// }
3738    /// # Ok(()) }
3739    ///
3740    /// fn prepare_request_builder() -> ListDestinations {
3741    ///   # panic!();
3742    ///   // ... details omitted ...
3743    /// }
3744    /// ```
3745    #[derive(Clone, Debug)]
3746    pub struct ListDestinations(RequestBuilder<crate::model::ListDestinationsRequest>);
3747
3748    impl ListDestinations {
3749        pub(crate) fn new(
3750            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3751        ) -> Self {
3752            Self(RequestBuilder::new(stub))
3753        }
3754
3755        /// Sets the full request, replacing any prior values.
3756        pub fn with_request<V: Into<crate::model::ListDestinationsRequest>>(
3757            mut self,
3758            v: V,
3759        ) -> Self {
3760            self.0.request = v.into();
3761            self
3762        }
3763
3764        /// Sets all the options, replacing any prior values.
3765        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3766            self.0.options = v.into();
3767            self
3768        }
3769
3770        /// Sends the request.
3771        pub async fn send(self) -> Result<crate::model::ListDestinationsResponse> {
3772            (*self.0.stub)
3773                .list_destinations(self.0.request, self.0.options)
3774                .await
3775                .map(crate::Response::into_body)
3776        }
3777
3778        /// Streams each page in the collection.
3779        pub fn by_page(
3780            self,
3781        ) -> impl google_cloud_gax::paginator::Paginator<
3782            crate::model::ListDestinationsResponse,
3783            crate::Error,
3784        > {
3785            use std::clone::Clone;
3786            let token = self.0.request.page_token.clone();
3787            let execute = move |token: String| {
3788                let mut builder = self.clone();
3789                builder.0.request = builder.0.request.set_page_token(token);
3790                builder.send()
3791            };
3792            google_cloud_gax::paginator::internal::new_paginator(token, execute)
3793        }
3794
3795        /// Streams each item in the collection.
3796        pub fn by_item(
3797            self,
3798        ) -> impl google_cloud_gax::paginator::ItemPaginator<
3799            crate::model::ListDestinationsResponse,
3800            crate::Error,
3801        > {
3802            use google_cloud_gax::paginator::Paginator;
3803            self.by_page().items()
3804        }
3805
3806        /// Sets the value of [parent][crate::model::ListDestinationsRequest::parent].
3807        ///
3808        /// This is a **required** field for requests.
3809        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3810            self.0.request.parent = v.into();
3811            self
3812        }
3813
3814        /// Sets the value of [page_size][crate::model::ListDestinationsRequest::page_size].
3815        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3816            self.0.request.page_size = v.into();
3817            self
3818        }
3819
3820        /// Sets the value of [page_token][crate::model::ListDestinationsRequest::page_token].
3821        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3822            self.0.request.page_token = v.into();
3823            self
3824        }
3825
3826        /// Sets the value of [filter][crate::model::ListDestinationsRequest::filter].
3827        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3828            self.0.request.filter = v.into();
3829            self
3830        }
3831
3832        /// Sets the value of [order_by][crate::model::ListDestinationsRequest::order_by].
3833        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3834            self.0.request.order_by = v.into();
3835            self
3836        }
3837
3838        /// Sets the value of [return_partial_success][crate::model::ListDestinationsRequest::return_partial_success].
3839        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
3840            self.0.request.return_partial_success = v.into();
3841            self
3842        }
3843    }
3844
3845    #[doc(hidden)]
3846    impl crate::RequestBuilder for ListDestinations {
3847        fn request_options(&mut self) -> &mut crate::RequestOptions {
3848            &mut self.0.options
3849        }
3850    }
3851
3852    /// The request builder for [DataTransferService::get_destination][crate::client::DataTransferService::get_destination] calls.
3853    ///
3854    /// # Example
3855    /// ```
3856    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::GetDestination;
3857    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
3858    ///
3859    /// let builder = prepare_request_builder();
3860    /// let response = builder.send().await?;
3861    /// # Ok(()) }
3862    ///
3863    /// fn prepare_request_builder() -> GetDestination {
3864    ///   # panic!();
3865    ///   // ... details omitted ...
3866    /// }
3867    /// ```
3868    #[derive(Clone, Debug)]
3869    pub struct GetDestination(RequestBuilder<crate::model::GetDestinationRequest>);
3870
3871    impl GetDestination {
3872        pub(crate) fn new(
3873            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3874        ) -> Self {
3875            Self(RequestBuilder::new(stub))
3876        }
3877
3878        /// Sets the full request, replacing any prior values.
3879        pub fn with_request<V: Into<crate::model::GetDestinationRequest>>(mut self, v: V) -> Self {
3880            self.0.request = v.into();
3881            self
3882        }
3883
3884        /// Sets all the options, replacing any prior values.
3885        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3886            self.0.options = v.into();
3887            self
3888        }
3889
3890        /// Sends the request.
3891        pub async fn send(self) -> Result<crate::model::Destination> {
3892            (*self.0.stub)
3893                .get_destination(self.0.request, self.0.options)
3894                .await
3895                .map(crate::Response::into_body)
3896        }
3897
3898        /// Sets the value of [name][crate::model::GetDestinationRequest::name].
3899        ///
3900        /// This is a **required** field for requests.
3901        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3902            self.0.request.name = v.into();
3903            self
3904        }
3905    }
3906
3907    #[doc(hidden)]
3908    impl crate::RequestBuilder for GetDestination {
3909        fn request_options(&mut self) -> &mut crate::RequestOptions {
3910            &mut self.0.options
3911        }
3912    }
3913
3914    /// The request builder for [DataTransferService::create_destination][crate::client::DataTransferService::create_destination] calls.
3915    ///
3916    /// # Example
3917    /// ```
3918    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::CreateDestination;
3919    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
3920    /// use google_cloud_lro::Poller;
3921    ///
3922    /// let builder = prepare_request_builder();
3923    /// let response = builder.poller().until_done().await?;
3924    /// # Ok(()) }
3925    ///
3926    /// fn prepare_request_builder() -> CreateDestination {
3927    ///   # panic!();
3928    ///   // ... details omitted ...
3929    /// }
3930    /// ```
3931    #[derive(Clone, Debug)]
3932    pub struct CreateDestination(RequestBuilder<crate::model::CreateDestinationRequest>);
3933
3934    impl CreateDestination {
3935        pub(crate) fn new(
3936            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3937        ) -> Self {
3938            Self(RequestBuilder::new(stub))
3939        }
3940
3941        /// Sets the full request, replacing any prior values.
3942        pub fn with_request<V: Into<crate::model::CreateDestinationRequest>>(
3943            mut self,
3944            v: V,
3945        ) -> Self {
3946            self.0.request = v.into();
3947            self
3948        }
3949
3950        /// Sets all the options, replacing any prior values.
3951        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3952            self.0.options = v.into();
3953            self
3954        }
3955
3956        /// Sends the request.
3957        ///
3958        /// # Long running operations
3959        ///
3960        /// This starts, but does not poll, a longrunning operation. More information
3961        /// on [create_destination][crate::client::DataTransferService::create_destination].
3962        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3963            (*self.0.stub)
3964                .create_destination(self.0.request, self.0.options)
3965                .await
3966                .map(crate::Response::into_body)
3967        }
3968
3969        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_destination`.
3970        pub fn poller(
3971            self,
3972        ) -> impl google_cloud_lro::Poller<crate::model::Destination, crate::model::OperationMetadata>
3973        {
3974            type Operation = google_cloud_lro::internal::Operation<
3975                crate::model::Destination,
3976                crate::model::OperationMetadata,
3977            >;
3978            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3979            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3980
3981            let stub = self.0.stub.clone();
3982            let mut options = self.0.options.clone();
3983            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3984            let query = move |name| {
3985                let stub = stub.clone();
3986                let options = options.clone();
3987                async {
3988                    let op = GetOperation::new(stub)
3989                        .set_name(name)
3990                        .with_options(options)
3991                        .send()
3992                        .await?;
3993                    Ok(Operation::new(op))
3994                }
3995            };
3996
3997            let start = move || async {
3998                let op = self.send().await?;
3999                Ok(Operation::new(op))
4000            };
4001
4002            google_cloud_lro::internal::new_poller(
4003                polling_error_policy,
4004                polling_backoff_policy,
4005                start,
4006                query,
4007            )
4008        }
4009
4010        /// Sets the value of [parent][crate::model::CreateDestinationRequest::parent].
4011        ///
4012        /// This is a **required** field for requests.
4013        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4014            self.0.request.parent = v.into();
4015            self
4016        }
4017
4018        /// Sets the value of [destination_id][crate::model::CreateDestinationRequest::destination_id].
4019        ///
4020        /// This is a **required** field for requests.
4021        pub fn set_destination_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4022            self.0.request.destination_id = v.into();
4023            self
4024        }
4025
4026        /// Sets the value of [destination][crate::model::CreateDestinationRequest::destination].
4027        ///
4028        /// This is a **required** field for requests.
4029        pub fn set_destination<T>(mut self, v: T) -> Self
4030        where
4031            T: std::convert::Into<crate::model::Destination>,
4032        {
4033            self.0.request.destination = std::option::Option::Some(v.into());
4034            self
4035        }
4036
4037        /// Sets or clears the value of [destination][crate::model::CreateDestinationRequest::destination].
4038        ///
4039        /// This is a **required** field for requests.
4040        pub fn set_or_clear_destination<T>(mut self, v: std::option::Option<T>) -> Self
4041        where
4042            T: std::convert::Into<crate::model::Destination>,
4043        {
4044            self.0.request.destination = v.map(|x| x.into());
4045            self
4046        }
4047
4048        /// Sets the value of [request_id][crate::model::CreateDestinationRequest::request_id].
4049        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4050            self.0.request.request_id = v.into();
4051            self
4052        }
4053    }
4054
4055    #[doc(hidden)]
4056    impl crate::RequestBuilder for CreateDestination {
4057        fn request_options(&mut self) -> &mut crate::RequestOptions {
4058            &mut self.0.options
4059        }
4060    }
4061
4062    /// The request builder for [DataTransferService::update_destination][crate::client::DataTransferService::update_destination] calls.
4063    ///
4064    /// # Example
4065    /// ```
4066    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::UpdateDestination;
4067    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
4068    /// use google_cloud_lro::Poller;
4069    ///
4070    /// let builder = prepare_request_builder();
4071    /// let response = builder.poller().until_done().await?;
4072    /// # Ok(()) }
4073    ///
4074    /// fn prepare_request_builder() -> UpdateDestination {
4075    ///   # panic!();
4076    ///   // ... details omitted ...
4077    /// }
4078    /// ```
4079    #[derive(Clone, Debug)]
4080    pub struct UpdateDestination(RequestBuilder<crate::model::UpdateDestinationRequest>);
4081
4082    impl UpdateDestination {
4083        pub(crate) fn new(
4084            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4085        ) -> Self {
4086            Self(RequestBuilder::new(stub))
4087        }
4088
4089        /// Sets the full request, replacing any prior values.
4090        pub fn with_request<V: Into<crate::model::UpdateDestinationRequest>>(
4091            mut self,
4092            v: V,
4093        ) -> Self {
4094            self.0.request = v.into();
4095            self
4096        }
4097
4098        /// Sets all the options, replacing any prior values.
4099        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4100            self.0.options = v.into();
4101            self
4102        }
4103
4104        /// Sends the request.
4105        ///
4106        /// # Long running operations
4107        ///
4108        /// This starts, but does not poll, a longrunning operation. More information
4109        /// on [update_destination][crate::client::DataTransferService::update_destination].
4110        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4111            (*self.0.stub)
4112                .update_destination(self.0.request, self.0.options)
4113                .await
4114                .map(crate::Response::into_body)
4115        }
4116
4117        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_destination`.
4118        pub fn poller(
4119            self,
4120        ) -> impl google_cloud_lro::Poller<crate::model::Destination, crate::model::OperationMetadata>
4121        {
4122            type Operation = google_cloud_lro::internal::Operation<
4123                crate::model::Destination,
4124                crate::model::OperationMetadata,
4125            >;
4126            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4127            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4128
4129            let stub = self.0.stub.clone();
4130            let mut options = self.0.options.clone();
4131            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4132            let query = move |name| {
4133                let stub = stub.clone();
4134                let options = options.clone();
4135                async {
4136                    let op = GetOperation::new(stub)
4137                        .set_name(name)
4138                        .with_options(options)
4139                        .send()
4140                        .await?;
4141                    Ok(Operation::new(op))
4142                }
4143            };
4144
4145            let start = move || async {
4146                let op = self.send().await?;
4147                Ok(Operation::new(op))
4148            };
4149
4150            google_cloud_lro::internal::new_poller(
4151                polling_error_policy,
4152                polling_backoff_policy,
4153                start,
4154                query,
4155            )
4156        }
4157
4158        /// Sets the value of [update_mask][crate::model::UpdateDestinationRequest::update_mask].
4159        pub fn set_update_mask<T>(mut self, v: T) -> Self
4160        where
4161            T: std::convert::Into<wkt::FieldMask>,
4162        {
4163            self.0.request.update_mask = std::option::Option::Some(v.into());
4164            self
4165        }
4166
4167        /// Sets or clears the value of [update_mask][crate::model::UpdateDestinationRequest::update_mask].
4168        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4169        where
4170            T: std::convert::Into<wkt::FieldMask>,
4171        {
4172            self.0.request.update_mask = v.map(|x| x.into());
4173            self
4174        }
4175
4176        /// Sets the value of [destination][crate::model::UpdateDestinationRequest::destination].
4177        ///
4178        /// This is a **required** field for requests.
4179        pub fn set_destination<T>(mut self, v: T) -> Self
4180        where
4181            T: std::convert::Into<crate::model::Destination>,
4182        {
4183            self.0.request.destination = std::option::Option::Some(v.into());
4184            self
4185        }
4186
4187        /// Sets or clears the value of [destination][crate::model::UpdateDestinationRequest::destination].
4188        ///
4189        /// This is a **required** field for requests.
4190        pub fn set_or_clear_destination<T>(mut self, v: std::option::Option<T>) -> Self
4191        where
4192            T: std::convert::Into<crate::model::Destination>,
4193        {
4194            self.0.request.destination = v.map(|x| x.into());
4195            self
4196        }
4197
4198        /// Sets the value of [request_id][crate::model::UpdateDestinationRequest::request_id].
4199        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4200            self.0.request.request_id = v.into();
4201            self
4202        }
4203    }
4204
4205    #[doc(hidden)]
4206    impl crate::RequestBuilder for UpdateDestination {
4207        fn request_options(&mut self) -> &mut crate::RequestOptions {
4208            &mut self.0.options
4209        }
4210    }
4211
4212    /// The request builder for [DataTransferService::delete_destination][crate::client::DataTransferService::delete_destination] calls.
4213    ///
4214    /// # Example
4215    /// ```
4216    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::DeleteDestination;
4217    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
4218    /// use google_cloud_lro::Poller;
4219    ///
4220    /// let builder = prepare_request_builder();
4221    /// let response = builder.poller().until_done().await?;
4222    /// # Ok(()) }
4223    ///
4224    /// fn prepare_request_builder() -> DeleteDestination {
4225    ///   # panic!();
4226    ///   // ... details omitted ...
4227    /// }
4228    /// ```
4229    #[derive(Clone, Debug)]
4230    pub struct DeleteDestination(RequestBuilder<crate::model::DeleteDestinationRequest>);
4231
4232    impl DeleteDestination {
4233        pub(crate) fn new(
4234            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4235        ) -> Self {
4236            Self(RequestBuilder::new(stub))
4237        }
4238
4239        /// Sets the full request, replacing any prior values.
4240        pub fn with_request<V: Into<crate::model::DeleteDestinationRequest>>(
4241            mut self,
4242            v: V,
4243        ) -> Self {
4244            self.0.request = v.into();
4245            self
4246        }
4247
4248        /// Sets all the options, replacing any prior values.
4249        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4250            self.0.options = v.into();
4251            self
4252        }
4253
4254        /// Sends the request.
4255        ///
4256        /// # Long running operations
4257        ///
4258        /// This starts, but does not poll, a longrunning operation. More information
4259        /// on [delete_destination][crate::client::DataTransferService::delete_destination].
4260        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4261            (*self.0.stub)
4262                .delete_destination(self.0.request, self.0.options)
4263                .await
4264                .map(crate::Response::into_body)
4265        }
4266
4267        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_destination`.
4268        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
4269            type Operation =
4270                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
4271            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4272            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4273
4274            let stub = self.0.stub.clone();
4275            let mut options = self.0.options.clone();
4276            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4277            let query = move |name| {
4278                let stub = stub.clone();
4279                let options = options.clone();
4280                async {
4281                    let op = GetOperation::new(stub)
4282                        .set_name(name)
4283                        .with_options(options)
4284                        .send()
4285                        .await?;
4286                    Ok(Operation::new(op))
4287                }
4288            };
4289
4290            let start = move || async {
4291                let op = self.send().await?;
4292                Ok(Operation::new(op))
4293            };
4294
4295            google_cloud_lro::internal::new_unit_response_poller(
4296                polling_error_policy,
4297                polling_backoff_policy,
4298                start,
4299                query,
4300            )
4301        }
4302
4303        /// Sets the value of [name][crate::model::DeleteDestinationRequest::name].
4304        ///
4305        /// This is a **required** field for requests.
4306        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4307            self.0.request.name = v.into();
4308            self
4309        }
4310
4311        /// Sets the value of [request_id][crate::model::DeleteDestinationRequest::request_id].
4312        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4313            self.0.request.request_id = v.into();
4314            self
4315        }
4316
4317        /// Sets the value of [etag][crate::model::DeleteDestinationRequest::etag].
4318        pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
4319            self.0.request.etag = v.into();
4320            self
4321        }
4322    }
4323
4324    #[doc(hidden)]
4325    impl crate::RequestBuilder for DeleteDestination {
4326        fn request_options(&mut self) -> &mut crate::RequestOptions {
4327            &mut self.0.options
4328        }
4329    }
4330
4331    /// The request builder for [DataTransferService::get_multicloud_data_transfer_supported_service][crate::client::DataTransferService::get_multicloud_data_transfer_supported_service] calls.
4332    ///
4333    /// # Example
4334    /// ```
4335    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::GetMulticloudDataTransferSupportedService;
4336    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
4337    ///
4338    /// let builder = prepare_request_builder();
4339    /// let response = builder.send().await?;
4340    /// # Ok(()) }
4341    ///
4342    /// fn prepare_request_builder() -> GetMulticloudDataTransferSupportedService {
4343    ///   # panic!();
4344    ///   // ... details omitted ...
4345    /// }
4346    /// ```
4347    #[derive(Clone, Debug)]
4348    pub struct GetMulticloudDataTransferSupportedService(
4349        RequestBuilder<crate::model::GetMulticloudDataTransferSupportedServiceRequest>,
4350    );
4351
4352    impl GetMulticloudDataTransferSupportedService {
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<
4361            V: Into<crate::model::GetMulticloudDataTransferSupportedServiceRequest>,
4362        >(
4363            mut self,
4364            v: V,
4365        ) -> Self {
4366            self.0.request = v.into();
4367            self
4368        }
4369
4370        /// Sets all the options, replacing any prior values.
4371        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4372            self.0.options = v.into();
4373            self
4374        }
4375
4376        /// Sends the request.
4377        pub async fn send(self) -> Result<crate::model::MulticloudDataTransferSupportedService> {
4378            (*self.0.stub)
4379                .get_multicloud_data_transfer_supported_service(self.0.request, self.0.options)
4380                .await
4381                .map(crate::Response::into_body)
4382        }
4383
4384        /// Sets the value of [name][crate::model::GetMulticloudDataTransferSupportedServiceRequest::name].
4385        ///
4386        /// This is a **required** field for requests.
4387        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4388            self.0.request.name = v.into();
4389            self
4390        }
4391    }
4392
4393    #[doc(hidden)]
4394    impl crate::RequestBuilder for GetMulticloudDataTransferSupportedService {
4395        fn request_options(&mut self) -> &mut crate::RequestOptions {
4396            &mut self.0.options
4397        }
4398    }
4399
4400    /// The request builder for [DataTransferService::list_multicloud_data_transfer_supported_services][crate::client::DataTransferService::list_multicloud_data_transfer_supported_services] calls.
4401    ///
4402    /// # Example
4403    /// ```
4404    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::ListMulticloudDataTransferSupportedServices;
4405    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
4406    /// use google_cloud_gax::paginator::ItemPaginator;
4407    ///
4408    /// let builder = prepare_request_builder();
4409    /// let mut items = builder.by_item();
4410    /// while let Some(result) = items.next().await {
4411    ///   let item = result?;
4412    /// }
4413    /// # Ok(()) }
4414    ///
4415    /// fn prepare_request_builder() -> ListMulticloudDataTransferSupportedServices {
4416    ///   # panic!();
4417    ///   // ... details omitted ...
4418    /// }
4419    /// ```
4420    #[derive(Clone, Debug)]
4421    pub struct ListMulticloudDataTransferSupportedServices(
4422        RequestBuilder<crate::model::ListMulticloudDataTransferSupportedServicesRequest>,
4423    );
4424
4425    impl ListMulticloudDataTransferSupportedServices {
4426        pub(crate) fn new(
4427            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4428        ) -> Self {
4429            Self(RequestBuilder::new(stub))
4430        }
4431
4432        /// Sets the full request, replacing any prior values.
4433        pub fn with_request<
4434            V: Into<crate::model::ListMulticloudDataTransferSupportedServicesRequest>,
4435        >(
4436            mut self,
4437            v: V,
4438        ) -> Self {
4439            self.0.request = v.into();
4440            self
4441        }
4442
4443        /// Sets all the options, replacing any prior values.
4444        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4445            self.0.options = v.into();
4446            self
4447        }
4448
4449        /// Sends the request.
4450        pub async fn send(
4451            self,
4452        ) -> Result<crate::model::ListMulticloudDataTransferSupportedServicesResponse> {
4453            (*self.0.stub)
4454                .list_multicloud_data_transfer_supported_services(self.0.request, self.0.options)
4455                .await
4456                .map(crate::Response::into_body)
4457        }
4458
4459        /// Streams each page in the collection.
4460        pub fn by_page(
4461            self,
4462        ) -> impl google_cloud_gax::paginator::Paginator<
4463            crate::model::ListMulticloudDataTransferSupportedServicesResponse,
4464            crate::Error,
4465        > {
4466            use std::clone::Clone;
4467            let token = self.0.request.page_token.clone();
4468            let execute = move |token: String| {
4469                let mut builder = self.clone();
4470                builder.0.request = builder.0.request.set_page_token(token);
4471                builder.send()
4472            };
4473            google_cloud_gax::paginator::internal::new_paginator(token, execute)
4474        }
4475
4476        /// Streams each item in the collection.
4477        pub fn by_item(
4478            self,
4479        ) -> impl google_cloud_gax::paginator::ItemPaginator<
4480            crate::model::ListMulticloudDataTransferSupportedServicesResponse,
4481            crate::Error,
4482        > {
4483            use google_cloud_gax::paginator::Paginator;
4484            self.by_page().items()
4485        }
4486
4487        /// Sets the value of [parent][crate::model::ListMulticloudDataTransferSupportedServicesRequest::parent].
4488        ///
4489        /// This is a **required** field for requests.
4490        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4491            self.0.request.parent = v.into();
4492            self
4493        }
4494
4495        /// Sets the value of [page_size][crate::model::ListMulticloudDataTransferSupportedServicesRequest::page_size].
4496        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4497            self.0.request.page_size = v.into();
4498            self
4499        }
4500
4501        /// Sets the value of [page_token][crate::model::ListMulticloudDataTransferSupportedServicesRequest::page_token].
4502        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4503            self.0.request.page_token = v.into();
4504            self
4505        }
4506    }
4507
4508    #[doc(hidden)]
4509    impl crate::RequestBuilder for ListMulticloudDataTransferSupportedServices {
4510        fn request_options(&mut self) -> &mut crate::RequestOptions {
4511            &mut self.0.options
4512        }
4513    }
4514
4515    /// The request builder for [DataTransferService::list_locations][crate::client::DataTransferService::list_locations] calls.
4516    ///
4517    /// # Example
4518    /// ```
4519    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::ListLocations;
4520    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
4521    /// use google_cloud_gax::paginator::ItemPaginator;
4522    ///
4523    /// let builder = prepare_request_builder();
4524    /// let mut items = builder.by_item();
4525    /// while let Some(result) = items.next().await {
4526    ///   let item = result?;
4527    /// }
4528    /// # Ok(()) }
4529    ///
4530    /// fn prepare_request_builder() -> ListLocations {
4531    ///   # panic!();
4532    ///   // ... details omitted ...
4533    /// }
4534    /// ```
4535    #[derive(Clone, Debug)]
4536    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
4537
4538    impl ListLocations {
4539        pub(crate) fn new(
4540            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4541        ) -> Self {
4542            Self(RequestBuilder::new(stub))
4543        }
4544
4545        /// Sets the full request, replacing any prior values.
4546        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
4547            mut self,
4548            v: V,
4549        ) -> Self {
4550            self.0.request = v.into();
4551            self
4552        }
4553
4554        /// Sets all the options, replacing any prior values.
4555        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4556            self.0.options = v.into();
4557            self
4558        }
4559
4560        /// Sends the request.
4561        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
4562            (*self.0.stub)
4563                .list_locations(self.0.request, self.0.options)
4564                .await
4565                .map(crate::Response::into_body)
4566        }
4567
4568        /// Streams each page in the collection.
4569        pub fn by_page(
4570            self,
4571        ) -> impl google_cloud_gax::paginator::Paginator<
4572            google_cloud_location::model::ListLocationsResponse,
4573            crate::Error,
4574        > {
4575            use std::clone::Clone;
4576            let token = self.0.request.page_token.clone();
4577            let execute = move |token: String| {
4578                let mut builder = self.clone();
4579                builder.0.request = builder.0.request.set_page_token(token);
4580                builder.send()
4581            };
4582            google_cloud_gax::paginator::internal::new_paginator(token, execute)
4583        }
4584
4585        /// Streams each item in the collection.
4586        pub fn by_item(
4587            self,
4588        ) -> impl google_cloud_gax::paginator::ItemPaginator<
4589            google_cloud_location::model::ListLocationsResponse,
4590            crate::Error,
4591        > {
4592            use google_cloud_gax::paginator::Paginator;
4593            self.by_page().items()
4594        }
4595
4596        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
4597        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4598            self.0.request.name = v.into();
4599            self
4600        }
4601
4602        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
4603        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4604            self.0.request.filter = v.into();
4605            self
4606        }
4607
4608        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
4609        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4610            self.0.request.page_size = v.into();
4611            self
4612        }
4613
4614        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
4615        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4616            self.0.request.page_token = v.into();
4617            self
4618        }
4619    }
4620
4621    #[doc(hidden)]
4622    impl crate::RequestBuilder for ListLocations {
4623        fn request_options(&mut self) -> &mut crate::RequestOptions {
4624            &mut self.0.options
4625        }
4626    }
4627
4628    /// The request builder for [DataTransferService::get_location][crate::client::DataTransferService::get_location] calls.
4629    ///
4630    /// # Example
4631    /// ```
4632    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::GetLocation;
4633    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
4634    ///
4635    /// let builder = prepare_request_builder();
4636    /// let response = builder.send().await?;
4637    /// # Ok(()) }
4638    ///
4639    /// fn prepare_request_builder() -> GetLocation {
4640    ///   # panic!();
4641    ///   // ... details omitted ...
4642    /// }
4643    /// ```
4644    #[derive(Clone, Debug)]
4645    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
4646
4647    impl GetLocation {
4648        pub(crate) fn new(
4649            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4650        ) -> Self {
4651            Self(RequestBuilder::new(stub))
4652        }
4653
4654        /// Sets the full request, replacing any prior values.
4655        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
4656            mut self,
4657            v: V,
4658        ) -> Self {
4659            self.0.request = v.into();
4660            self
4661        }
4662
4663        /// Sets all the options, replacing any prior values.
4664        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4665            self.0.options = v.into();
4666            self
4667        }
4668
4669        /// Sends the request.
4670        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
4671            (*self.0.stub)
4672                .get_location(self.0.request, self.0.options)
4673                .await
4674                .map(crate::Response::into_body)
4675        }
4676
4677        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
4678        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4679            self.0.request.name = v.into();
4680            self
4681        }
4682    }
4683
4684    #[doc(hidden)]
4685    impl crate::RequestBuilder for GetLocation {
4686        fn request_options(&mut self) -> &mut crate::RequestOptions {
4687            &mut self.0.options
4688        }
4689    }
4690
4691    /// The request builder for [DataTransferService::set_iam_policy][crate::client::DataTransferService::set_iam_policy] calls.
4692    ///
4693    /// # Example
4694    /// ```
4695    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::SetIamPolicy;
4696    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
4697    ///
4698    /// let builder = prepare_request_builder();
4699    /// let response = builder.send().await?;
4700    /// # Ok(()) }
4701    ///
4702    /// fn prepare_request_builder() -> SetIamPolicy {
4703    ///   # panic!();
4704    ///   // ... details omitted ...
4705    /// }
4706    /// ```
4707    #[derive(Clone, Debug)]
4708    pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
4709
4710    impl SetIamPolicy {
4711        pub(crate) fn new(
4712            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4713        ) -> Self {
4714            Self(RequestBuilder::new(stub))
4715        }
4716
4717        /// Sets the full request, replacing any prior values.
4718        pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
4719            mut self,
4720            v: V,
4721        ) -> Self {
4722            self.0.request = v.into();
4723            self
4724        }
4725
4726        /// Sets all the options, replacing any prior values.
4727        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4728            self.0.options = v.into();
4729            self
4730        }
4731
4732        /// Sends the request.
4733        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
4734            (*self.0.stub)
4735                .set_iam_policy(self.0.request, self.0.options)
4736                .await
4737                .map(crate::Response::into_body)
4738        }
4739
4740        /// Sets the value of [resource][google_cloud_iam_v1::model::SetIamPolicyRequest::resource].
4741        ///
4742        /// This is a **required** field for requests.
4743        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4744            self.0.request.resource = v.into();
4745            self
4746        }
4747
4748        /// Sets the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
4749        ///
4750        /// This is a **required** field for requests.
4751        pub fn set_policy<T>(mut self, v: T) -> Self
4752        where
4753            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
4754        {
4755            self.0.request.policy = std::option::Option::Some(v.into());
4756            self
4757        }
4758
4759        /// Sets or clears the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
4760        ///
4761        /// This is a **required** field for requests.
4762        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
4763        where
4764            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
4765        {
4766            self.0.request.policy = v.map(|x| x.into());
4767            self
4768        }
4769
4770        /// Sets the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
4771        pub fn set_update_mask<T>(mut self, v: T) -> Self
4772        where
4773            T: std::convert::Into<wkt::FieldMask>,
4774        {
4775            self.0.request.update_mask = std::option::Option::Some(v.into());
4776            self
4777        }
4778
4779        /// Sets or clears the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
4780        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4781        where
4782            T: std::convert::Into<wkt::FieldMask>,
4783        {
4784            self.0.request.update_mask = v.map(|x| x.into());
4785            self
4786        }
4787    }
4788
4789    #[doc(hidden)]
4790    impl crate::RequestBuilder for SetIamPolicy {
4791        fn request_options(&mut self) -> &mut crate::RequestOptions {
4792            &mut self.0.options
4793        }
4794    }
4795
4796    /// The request builder for [DataTransferService::get_iam_policy][crate::client::DataTransferService::get_iam_policy] calls.
4797    ///
4798    /// # Example
4799    /// ```
4800    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::GetIamPolicy;
4801    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
4802    ///
4803    /// let builder = prepare_request_builder();
4804    /// let response = builder.send().await?;
4805    /// # Ok(()) }
4806    ///
4807    /// fn prepare_request_builder() -> GetIamPolicy {
4808    ///   # panic!();
4809    ///   // ... details omitted ...
4810    /// }
4811    /// ```
4812    #[derive(Clone, Debug)]
4813    pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
4814
4815    impl GetIamPolicy {
4816        pub(crate) fn new(
4817            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4818        ) -> Self {
4819            Self(RequestBuilder::new(stub))
4820        }
4821
4822        /// Sets the full request, replacing any prior values.
4823        pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
4824            mut self,
4825            v: V,
4826        ) -> Self {
4827            self.0.request = v.into();
4828            self
4829        }
4830
4831        /// Sets all the options, replacing any prior values.
4832        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4833            self.0.options = v.into();
4834            self
4835        }
4836
4837        /// Sends the request.
4838        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
4839            (*self.0.stub)
4840                .get_iam_policy(self.0.request, self.0.options)
4841                .await
4842                .map(crate::Response::into_body)
4843        }
4844
4845        /// Sets the value of [resource][google_cloud_iam_v1::model::GetIamPolicyRequest::resource].
4846        ///
4847        /// This is a **required** field for requests.
4848        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4849            self.0.request.resource = v.into();
4850            self
4851        }
4852
4853        /// Sets the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
4854        pub fn set_options<T>(mut self, v: T) -> Self
4855        where
4856            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
4857        {
4858            self.0.request.options = std::option::Option::Some(v.into());
4859            self
4860        }
4861
4862        /// Sets or clears the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
4863        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
4864        where
4865            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
4866        {
4867            self.0.request.options = v.map(|x| x.into());
4868            self
4869        }
4870    }
4871
4872    #[doc(hidden)]
4873    impl crate::RequestBuilder for GetIamPolicy {
4874        fn request_options(&mut self) -> &mut crate::RequestOptions {
4875            &mut self.0.options
4876        }
4877    }
4878
4879    /// The request builder for [DataTransferService::test_iam_permissions][crate::client::DataTransferService::test_iam_permissions] calls.
4880    ///
4881    /// # Example
4882    /// ```
4883    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::TestIamPermissions;
4884    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
4885    ///
4886    /// let builder = prepare_request_builder();
4887    /// let response = builder.send().await?;
4888    /// # Ok(()) }
4889    ///
4890    /// fn prepare_request_builder() -> TestIamPermissions {
4891    ///   # panic!();
4892    ///   // ... details omitted ...
4893    /// }
4894    /// ```
4895    #[derive(Clone, Debug)]
4896    pub struct TestIamPermissions(
4897        RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
4898    );
4899
4900    impl TestIamPermissions {
4901        pub(crate) fn new(
4902            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4903        ) -> Self {
4904            Self(RequestBuilder::new(stub))
4905        }
4906
4907        /// Sets the full request, replacing any prior values.
4908        pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
4909            mut self,
4910            v: V,
4911        ) -> Self {
4912            self.0.request = v.into();
4913            self
4914        }
4915
4916        /// Sets all the options, replacing any prior values.
4917        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4918            self.0.options = v.into();
4919            self
4920        }
4921
4922        /// Sends the request.
4923        pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
4924            (*self.0.stub)
4925                .test_iam_permissions(self.0.request, self.0.options)
4926                .await
4927                .map(crate::Response::into_body)
4928        }
4929
4930        /// Sets the value of [resource][google_cloud_iam_v1::model::TestIamPermissionsRequest::resource].
4931        ///
4932        /// This is a **required** field for requests.
4933        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4934            self.0.request.resource = v.into();
4935            self
4936        }
4937
4938        /// Sets the value of [permissions][google_cloud_iam_v1::model::TestIamPermissionsRequest::permissions].
4939        ///
4940        /// This is a **required** field for requests.
4941        pub fn set_permissions<T, V>(mut self, v: T) -> Self
4942        where
4943            T: std::iter::IntoIterator<Item = V>,
4944            V: std::convert::Into<std::string::String>,
4945        {
4946            use std::iter::Iterator;
4947            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
4948            self
4949        }
4950    }
4951
4952    #[doc(hidden)]
4953    impl crate::RequestBuilder for TestIamPermissions {
4954        fn request_options(&mut self) -> &mut crate::RequestOptions {
4955            &mut self.0.options
4956        }
4957    }
4958
4959    /// The request builder for [DataTransferService::list_operations][crate::client::DataTransferService::list_operations] calls.
4960    ///
4961    /// # Example
4962    /// ```
4963    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::ListOperations;
4964    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
4965    /// use google_cloud_gax::paginator::ItemPaginator;
4966    ///
4967    /// let builder = prepare_request_builder();
4968    /// let mut items = builder.by_item();
4969    /// while let Some(result) = items.next().await {
4970    ///   let item = result?;
4971    /// }
4972    /// # Ok(()) }
4973    ///
4974    /// fn prepare_request_builder() -> ListOperations {
4975    ///   # panic!();
4976    ///   // ... details omitted ...
4977    /// }
4978    /// ```
4979    #[derive(Clone, Debug)]
4980    pub struct ListOperations(
4981        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
4982    );
4983
4984    impl ListOperations {
4985        pub(crate) fn new(
4986            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4987        ) -> Self {
4988            Self(RequestBuilder::new(stub))
4989        }
4990
4991        /// Sets the full request, replacing any prior values.
4992        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
4993            mut self,
4994            v: V,
4995        ) -> Self {
4996            self.0.request = v.into();
4997            self
4998        }
4999
5000        /// Sets all the options, replacing any prior values.
5001        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5002            self.0.options = v.into();
5003            self
5004        }
5005
5006        /// Sends the request.
5007        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
5008            (*self.0.stub)
5009                .list_operations(self.0.request, self.0.options)
5010                .await
5011                .map(crate::Response::into_body)
5012        }
5013
5014        /// Streams each page in the collection.
5015        pub fn by_page(
5016            self,
5017        ) -> impl google_cloud_gax::paginator::Paginator<
5018            google_cloud_longrunning::model::ListOperationsResponse,
5019            crate::Error,
5020        > {
5021            use std::clone::Clone;
5022            let token = self.0.request.page_token.clone();
5023            let execute = move |token: String| {
5024                let mut builder = self.clone();
5025                builder.0.request = builder.0.request.set_page_token(token);
5026                builder.send()
5027            };
5028            google_cloud_gax::paginator::internal::new_paginator(token, execute)
5029        }
5030
5031        /// Streams each item in the collection.
5032        pub fn by_item(
5033            self,
5034        ) -> impl google_cloud_gax::paginator::ItemPaginator<
5035            google_cloud_longrunning::model::ListOperationsResponse,
5036            crate::Error,
5037        > {
5038            use google_cloud_gax::paginator::Paginator;
5039            self.by_page().items()
5040        }
5041
5042        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
5043        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5044            self.0.request.name = v.into();
5045            self
5046        }
5047
5048        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
5049        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5050            self.0.request.filter = v.into();
5051            self
5052        }
5053
5054        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
5055        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5056            self.0.request.page_size = v.into();
5057            self
5058        }
5059
5060        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
5061        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5062            self.0.request.page_token = v.into();
5063            self
5064        }
5065
5066        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
5067        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
5068            self.0.request.return_partial_success = v.into();
5069            self
5070        }
5071    }
5072
5073    #[doc(hidden)]
5074    impl crate::RequestBuilder for ListOperations {
5075        fn request_options(&mut self) -> &mut crate::RequestOptions {
5076            &mut self.0.options
5077        }
5078    }
5079
5080    /// The request builder for [DataTransferService::get_operation][crate::client::DataTransferService::get_operation] calls.
5081    ///
5082    /// # Example
5083    /// ```
5084    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::GetOperation;
5085    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
5086    ///
5087    /// let builder = prepare_request_builder();
5088    /// let response = builder.send().await?;
5089    /// # Ok(()) }
5090    ///
5091    /// fn prepare_request_builder() -> GetOperation {
5092    ///   # panic!();
5093    ///   // ... details omitted ...
5094    /// }
5095    /// ```
5096    #[derive(Clone, Debug)]
5097    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
5098
5099    impl GetOperation {
5100        pub(crate) fn new(
5101            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
5102        ) -> Self {
5103            Self(RequestBuilder::new(stub))
5104        }
5105
5106        /// Sets the full request, replacing any prior values.
5107        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
5108            mut self,
5109            v: V,
5110        ) -> Self {
5111            self.0.request = v.into();
5112            self
5113        }
5114
5115        /// Sets all the options, replacing any prior values.
5116        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5117            self.0.options = v.into();
5118            self
5119        }
5120
5121        /// Sends the request.
5122        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5123            (*self.0.stub)
5124                .get_operation(self.0.request, self.0.options)
5125                .await
5126                .map(crate::Response::into_body)
5127        }
5128
5129        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
5130        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5131            self.0.request.name = v.into();
5132            self
5133        }
5134    }
5135
5136    #[doc(hidden)]
5137    impl crate::RequestBuilder for GetOperation {
5138        fn request_options(&mut self) -> &mut crate::RequestOptions {
5139            &mut self.0.options
5140        }
5141    }
5142
5143    /// The request builder for [DataTransferService::delete_operation][crate::client::DataTransferService::delete_operation] calls.
5144    ///
5145    /// # Example
5146    /// ```
5147    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::DeleteOperation;
5148    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
5149    ///
5150    /// let builder = prepare_request_builder();
5151    /// let response = builder.send().await?;
5152    /// # Ok(()) }
5153    ///
5154    /// fn prepare_request_builder() -> DeleteOperation {
5155    ///   # panic!();
5156    ///   // ... details omitted ...
5157    /// }
5158    /// ```
5159    #[derive(Clone, Debug)]
5160    pub struct DeleteOperation(
5161        RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
5162    );
5163
5164    impl DeleteOperation {
5165        pub(crate) fn new(
5166            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
5167        ) -> Self {
5168            Self(RequestBuilder::new(stub))
5169        }
5170
5171        /// Sets the full request, replacing any prior values.
5172        pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
5173            mut self,
5174            v: V,
5175        ) -> Self {
5176            self.0.request = v.into();
5177            self
5178        }
5179
5180        /// Sets all the options, replacing any prior values.
5181        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5182            self.0.options = v.into();
5183            self
5184        }
5185
5186        /// Sends the request.
5187        pub async fn send(self) -> Result<()> {
5188            (*self.0.stub)
5189                .delete_operation(self.0.request, self.0.options)
5190                .await
5191                .map(crate::Response::into_body)
5192        }
5193
5194        /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
5195        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5196            self.0.request.name = v.into();
5197            self
5198        }
5199    }
5200
5201    #[doc(hidden)]
5202    impl crate::RequestBuilder for DeleteOperation {
5203        fn request_options(&mut self) -> &mut crate::RequestOptions {
5204            &mut self.0.options
5205        }
5206    }
5207
5208    /// The request builder for [DataTransferService::cancel_operation][crate::client::DataTransferService::cancel_operation] calls.
5209    ///
5210    /// # Example
5211    /// ```
5212    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::CancelOperation;
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() -> CancelOperation {
5220    ///   # panic!();
5221    ///   // ... details omitted ...
5222    /// }
5223    /// ```
5224    #[derive(Clone, Debug)]
5225    pub struct CancelOperation(
5226        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
5227    );
5228
5229    impl CancelOperation {
5230        pub(crate) fn new(
5231            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
5232        ) -> Self {
5233            Self(RequestBuilder::new(stub))
5234        }
5235
5236        /// Sets the full request, replacing any prior values.
5237        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
5238            mut self,
5239            v: V,
5240        ) -> Self {
5241            self.0.request = v.into();
5242            self
5243        }
5244
5245        /// Sets all the options, replacing any prior values.
5246        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5247            self.0.options = v.into();
5248            self
5249        }
5250
5251        /// Sends the request.
5252        pub async fn send(self) -> Result<()> {
5253            (*self.0.stub)
5254                .cancel_operation(self.0.request, self.0.options)
5255                .await
5256                .map(crate::Response::into_body)
5257        }
5258
5259        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
5260        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5261            self.0.request.name = v.into();
5262            self
5263        }
5264    }
5265
5266    #[doc(hidden)]
5267    impl crate::RequestBuilder for CancelOperation {
5268        fn request_options(&mut self) -> &mut crate::RequestOptions {
5269            &mut self.0.options
5270        }
5271    }
5272}
5273
5274/// Request and client builders for [HubService][crate::client::HubService].
5275pub mod hub_service {
5276    use crate::Result;
5277
5278    /// A builder for [HubService][crate::client::HubService].
5279    ///
5280    /// ```
5281    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
5282    /// # use google_cloud_networkconnectivity_v1::*;
5283    /// # use builder::hub_service::ClientBuilder;
5284    /// # use client::HubService;
5285    /// let builder : ClientBuilder = HubService::builder();
5286    /// let client = builder
5287    ///     .with_endpoint("https://networkconnectivity.googleapis.com")
5288    ///     .build().await?;
5289    /// # Ok(()) }
5290    /// ```
5291    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
5292
5293    pub(crate) mod client {
5294        use super::super::super::client::HubService;
5295        pub struct Factory;
5296        impl crate::ClientFactory for Factory {
5297            type Client = HubService;
5298            type Credentials = gaxi::options::Credentials;
5299            async fn build(
5300                self,
5301                config: gaxi::options::ClientConfig,
5302            ) -> crate::ClientBuilderResult<Self::Client> {
5303                Self::Client::new(config).await
5304            }
5305        }
5306    }
5307
5308    /// Common implementation for [crate::client::HubService] request builders.
5309    #[derive(Clone, Debug)]
5310    pub(crate) struct RequestBuilder<R: std::default::Default> {
5311        stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5312        request: R,
5313        options: crate::RequestOptions,
5314    }
5315
5316    impl<R> RequestBuilder<R>
5317    where
5318        R: std::default::Default,
5319    {
5320        pub(crate) fn new(
5321            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5322        ) -> Self {
5323            Self {
5324                stub,
5325                request: R::default(),
5326                options: crate::RequestOptions::default(),
5327            }
5328        }
5329    }
5330
5331    /// The request builder for [HubService::list_hubs][crate::client::HubService::list_hubs] calls.
5332    ///
5333    /// # Example
5334    /// ```
5335    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::ListHubs;
5336    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
5337    /// use google_cloud_gax::paginator::ItemPaginator;
5338    ///
5339    /// let builder = prepare_request_builder();
5340    /// let mut items = builder.by_item();
5341    /// while let Some(result) = items.next().await {
5342    ///   let item = result?;
5343    /// }
5344    /// # Ok(()) }
5345    ///
5346    /// fn prepare_request_builder() -> ListHubs {
5347    ///   # panic!();
5348    ///   // ... details omitted ...
5349    /// }
5350    /// ```
5351    #[derive(Clone, Debug)]
5352    pub struct ListHubs(RequestBuilder<crate::model::ListHubsRequest>);
5353
5354    impl ListHubs {
5355        pub(crate) fn new(
5356            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5357        ) -> Self {
5358            Self(RequestBuilder::new(stub))
5359        }
5360
5361        /// Sets the full request, replacing any prior values.
5362        pub fn with_request<V: Into<crate::model::ListHubsRequest>>(mut self, v: V) -> Self {
5363            self.0.request = v.into();
5364            self
5365        }
5366
5367        /// Sets all the options, replacing any prior values.
5368        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5369            self.0.options = v.into();
5370            self
5371        }
5372
5373        /// Sends the request.
5374        pub async fn send(self) -> Result<crate::model::ListHubsResponse> {
5375            (*self.0.stub)
5376                .list_hubs(self.0.request, self.0.options)
5377                .await
5378                .map(crate::Response::into_body)
5379        }
5380
5381        /// Streams each page in the collection.
5382        pub fn by_page(
5383            self,
5384        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListHubsResponse, crate::Error>
5385        {
5386            use std::clone::Clone;
5387            let token = self.0.request.page_token.clone();
5388            let execute = move |token: String| {
5389                let mut builder = self.clone();
5390                builder.0.request = builder.0.request.set_page_token(token);
5391                builder.send()
5392            };
5393            google_cloud_gax::paginator::internal::new_paginator(token, execute)
5394        }
5395
5396        /// Streams each item in the collection.
5397        pub fn by_item(
5398            self,
5399        ) -> impl google_cloud_gax::paginator::ItemPaginator<crate::model::ListHubsResponse, crate::Error>
5400        {
5401            use google_cloud_gax::paginator::Paginator;
5402            self.by_page().items()
5403        }
5404
5405        /// Sets the value of [parent][crate::model::ListHubsRequest::parent].
5406        ///
5407        /// This is a **required** field for requests.
5408        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5409            self.0.request.parent = v.into();
5410            self
5411        }
5412
5413        /// Sets the value of [page_size][crate::model::ListHubsRequest::page_size].
5414        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5415            self.0.request.page_size = v.into();
5416            self
5417        }
5418
5419        /// Sets the value of [page_token][crate::model::ListHubsRequest::page_token].
5420        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5421            self.0.request.page_token = v.into();
5422            self
5423        }
5424
5425        /// Sets the value of [filter][crate::model::ListHubsRequest::filter].
5426        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5427            self.0.request.filter = v.into();
5428            self
5429        }
5430
5431        /// Sets the value of [order_by][crate::model::ListHubsRequest::order_by].
5432        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
5433            self.0.request.order_by = v.into();
5434            self
5435        }
5436    }
5437
5438    #[doc(hidden)]
5439    impl crate::RequestBuilder for ListHubs {
5440        fn request_options(&mut self) -> &mut crate::RequestOptions {
5441            &mut self.0.options
5442        }
5443    }
5444
5445    /// The request builder for [HubService::get_hub][crate::client::HubService::get_hub] calls.
5446    ///
5447    /// # Example
5448    /// ```
5449    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::GetHub;
5450    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
5451    ///
5452    /// let builder = prepare_request_builder();
5453    /// let response = builder.send().await?;
5454    /// # Ok(()) }
5455    ///
5456    /// fn prepare_request_builder() -> GetHub {
5457    ///   # panic!();
5458    ///   // ... details omitted ...
5459    /// }
5460    /// ```
5461    #[derive(Clone, Debug)]
5462    pub struct GetHub(RequestBuilder<crate::model::GetHubRequest>);
5463
5464    impl GetHub {
5465        pub(crate) fn new(
5466            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5467        ) -> Self {
5468            Self(RequestBuilder::new(stub))
5469        }
5470
5471        /// Sets the full request, replacing any prior values.
5472        pub fn with_request<V: Into<crate::model::GetHubRequest>>(mut self, v: V) -> Self {
5473            self.0.request = v.into();
5474            self
5475        }
5476
5477        /// Sets all the options, replacing any prior values.
5478        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5479            self.0.options = v.into();
5480            self
5481        }
5482
5483        /// Sends the request.
5484        pub async fn send(self) -> Result<crate::model::Hub> {
5485            (*self.0.stub)
5486                .get_hub(self.0.request, self.0.options)
5487                .await
5488                .map(crate::Response::into_body)
5489        }
5490
5491        /// Sets the value of [name][crate::model::GetHubRequest::name].
5492        ///
5493        /// This is a **required** field for requests.
5494        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5495            self.0.request.name = v.into();
5496            self
5497        }
5498    }
5499
5500    #[doc(hidden)]
5501    impl crate::RequestBuilder for GetHub {
5502        fn request_options(&mut self) -> &mut crate::RequestOptions {
5503            &mut self.0.options
5504        }
5505    }
5506
5507    /// The request builder for [HubService::create_hub][crate::client::HubService::create_hub] calls.
5508    ///
5509    /// # Example
5510    /// ```
5511    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::CreateHub;
5512    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
5513    /// use google_cloud_lro::Poller;
5514    ///
5515    /// let builder = prepare_request_builder();
5516    /// let response = builder.poller().until_done().await?;
5517    /// # Ok(()) }
5518    ///
5519    /// fn prepare_request_builder() -> CreateHub {
5520    ///   # panic!();
5521    ///   // ... details omitted ...
5522    /// }
5523    /// ```
5524    #[derive(Clone, Debug)]
5525    pub struct CreateHub(RequestBuilder<crate::model::CreateHubRequest>);
5526
5527    impl CreateHub {
5528        pub(crate) fn new(
5529            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5530        ) -> Self {
5531            Self(RequestBuilder::new(stub))
5532        }
5533
5534        /// Sets the full request, replacing any prior values.
5535        pub fn with_request<V: Into<crate::model::CreateHubRequest>>(mut self, v: V) -> Self {
5536            self.0.request = v.into();
5537            self
5538        }
5539
5540        /// Sets all the options, replacing any prior values.
5541        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5542            self.0.options = v.into();
5543            self
5544        }
5545
5546        /// Sends the request.
5547        ///
5548        /// # Long running operations
5549        ///
5550        /// This starts, but does not poll, a longrunning operation. More information
5551        /// on [create_hub][crate::client::HubService::create_hub].
5552        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5553            (*self.0.stub)
5554                .create_hub(self.0.request, self.0.options)
5555                .await
5556                .map(crate::Response::into_body)
5557        }
5558
5559        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_hub`.
5560        pub fn poller(
5561            self,
5562        ) -> impl google_cloud_lro::Poller<crate::model::Hub, crate::model::OperationMetadata>
5563        {
5564            type Operation = google_cloud_lro::internal::Operation<
5565                crate::model::Hub,
5566                crate::model::OperationMetadata,
5567            >;
5568            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5569            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5570
5571            let stub = self.0.stub.clone();
5572            let mut options = self.0.options.clone();
5573            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5574            let query = move |name| {
5575                let stub = stub.clone();
5576                let options = options.clone();
5577                async {
5578                    let op = GetOperation::new(stub)
5579                        .set_name(name)
5580                        .with_options(options)
5581                        .send()
5582                        .await?;
5583                    Ok(Operation::new(op))
5584                }
5585            };
5586
5587            let start = move || async {
5588                let op = self.send().await?;
5589                Ok(Operation::new(op))
5590            };
5591
5592            google_cloud_lro::internal::new_poller(
5593                polling_error_policy,
5594                polling_backoff_policy,
5595                start,
5596                query,
5597            )
5598        }
5599
5600        /// Sets the value of [parent][crate::model::CreateHubRequest::parent].
5601        ///
5602        /// This is a **required** field for requests.
5603        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5604            self.0.request.parent = v.into();
5605            self
5606        }
5607
5608        /// Sets the value of [hub_id][crate::model::CreateHubRequest::hub_id].
5609        ///
5610        /// This is a **required** field for requests.
5611        pub fn set_hub_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5612            self.0.request.hub_id = v.into();
5613            self
5614        }
5615
5616        /// Sets the value of [hub][crate::model::CreateHubRequest::hub].
5617        ///
5618        /// This is a **required** field for requests.
5619        pub fn set_hub<T>(mut self, v: T) -> Self
5620        where
5621            T: std::convert::Into<crate::model::Hub>,
5622        {
5623            self.0.request.hub = std::option::Option::Some(v.into());
5624            self
5625        }
5626
5627        /// Sets or clears the value of [hub][crate::model::CreateHubRequest::hub].
5628        ///
5629        /// This is a **required** field for requests.
5630        pub fn set_or_clear_hub<T>(mut self, v: std::option::Option<T>) -> Self
5631        where
5632            T: std::convert::Into<crate::model::Hub>,
5633        {
5634            self.0.request.hub = v.map(|x| x.into());
5635            self
5636        }
5637
5638        /// Sets the value of [request_id][crate::model::CreateHubRequest::request_id].
5639        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5640            self.0.request.request_id = v.into();
5641            self
5642        }
5643    }
5644
5645    #[doc(hidden)]
5646    impl crate::RequestBuilder for CreateHub {
5647        fn request_options(&mut self) -> &mut crate::RequestOptions {
5648            &mut self.0.options
5649        }
5650    }
5651
5652    /// The request builder for [HubService::update_hub][crate::client::HubService::update_hub] calls.
5653    ///
5654    /// # Example
5655    /// ```
5656    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::UpdateHub;
5657    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
5658    /// use google_cloud_lro::Poller;
5659    ///
5660    /// let builder = prepare_request_builder();
5661    /// let response = builder.poller().until_done().await?;
5662    /// # Ok(()) }
5663    ///
5664    /// fn prepare_request_builder() -> UpdateHub {
5665    ///   # panic!();
5666    ///   // ... details omitted ...
5667    /// }
5668    /// ```
5669    #[derive(Clone, Debug)]
5670    pub struct UpdateHub(RequestBuilder<crate::model::UpdateHubRequest>);
5671
5672    impl UpdateHub {
5673        pub(crate) fn new(
5674            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5675        ) -> Self {
5676            Self(RequestBuilder::new(stub))
5677        }
5678
5679        /// Sets the full request, replacing any prior values.
5680        pub fn with_request<V: Into<crate::model::UpdateHubRequest>>(mut self, v: V) -> Self {
5681            self.0.request = v.into();
5682            self
5683        }
5684
5685        /// Sets all the options, replacing any prior values.
5686        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5687            self.0.options = v.into();
5688            self
5689        }
5690
5691        /// Sends the request.
5692        ///
5693        /// # Long running operations
5694        ///
5695        /// This starts, but does not poll, a longrunning operation. More information
5696        /// on [update_hub][crate::client::HubService::update_hub].
5697        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5698            (*self.0.stub)
5699                .update_hub(self.0.request, self.0.options)
5700                .await
5701                .map(crate::Response::into_body)
5702        }
5703
5704        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_hub`.
5705        pub fn poller(
5706            self,
5707        ) -> impl google_cloud_lro::Poller<crate::model::Hub, crate::model::OperationMetadata>
5708        {
5709            type Operation = google_cloud_lro::internal::Operation<
5710                crate::model::Hub,
5711                crate::model::OperationMetadata,
5712            >;
5713            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5714            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5715
5716            let stub = self.0.stub.clone();
5717            let mut options = self.0.options.clone();
5718            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5719            let query = move |name| {
5720                let stub = stub.clone();
5721                let options = options.clone();
5722                async {
5723                    let op = GetOperation::new(stub)
5724                        .set_name(name)
5725                        .with_options(options)
5726                        .send()
5727                        .await?;
5728                    Ok(Operation::new(op))
5729                }
5730            };
5731
5732            let start = move || async {
5733                let op = self.send().await?;
5734                Ok(Operation::new(op))
5735            };
5736
5737            google_cloud_lro::internal::new_poller(
5738                polling_error_policy,
5739                polling_backoff_policy,
5740                start,
5741                query,
5742            )
5743        }
5744
5745        /// Sets the value of [update_mask][crate::model::UpdateHubRequest::update_mask].
5746        pub fn set_update_mask<T>(mut self, v: T) -> Self
5747        where
5748            T: std::convert::Into<wkt::FieldMask>,
5749        {
5750            self.0.request.update_mask = std::option::Option::Some(v.into());
5751            self
5752        }
5753
5754        /// Sets or clears the value of [update_mask][crate::model::UpdateHubRequest::update_mask].
5755        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5756        where
5757            T: std::convert::Into<wkt::FieldMask>,
5758        {
5759            self.0.request.update_mask = v.map(|x| x.into());
5760            self
5761        }
5762
5763        /// Sets the value of [hub][crate::model::UpdateHubRequest::hub].
5764        ///
5765        /// This is a **required** field for requests.
5766        pub fn set_hub<T>(mut self, v: T) -> Self
5767        where
5768            T: std::convert::Into<crate::model::Hub>,
5769        {
5770            self.0.request.hub = std::option::Option::Some(v.into());
5771            self
5772        }
5773
5774        /// Sets or clears the value of [hub][crate::model::UpdateHubRequest::hub].
5775        ///
5776        /// This is a **required** field for requests.
5777        pub fn set_or_clear_hub<T>(mut self, v: std::option::Option<T>) -> Self
5778        where
5779            T: std::convert::Into<crate::model::Hub>,
5780        {
5781            self.0.request.hub = v.map(|x| x.into());
5782            self
5783        }
5784
5785        /// Sets the value of [request_id][crate::model::UpdateHubRequest::request_id].
5786        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5787            self.0.request.request_id = v.into();
5788            self
5789        }
5790    }
5791
5792    #[doc(hidden)]
5793    impl crate::RequestBuilder for UpdateHub {
5794        fn request_options(&mut self) -> &mut crate::RequestOptions {
5795            &mut self.0.options
5796        }
5797    }
5798
5799    /// The request builder for [HubService::delete_hub][crate::client::HubService::delete_hub] calls.
5800    ///
5801    /// # Example
5802    /// ```
5803    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::DeleteHub;
5804    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
5805    /// use google_cloud_lro::Poller;
5806    ///
5807    /// let builder = prepare_request_builder();
5808    /// let response = builder.poller().until_done().await?;
5809    /// # Ok(()) }
5810    ///
5811    /// fn prepare_request_builder() -> DeleteHub {
5812    ///   # panic!();
5813    ///   // ... details omitted ...
5814    /// }
5815    /// ```
5816    #[derive(Clone, Debug)]
5817    pub struct DeleteHub(RequestBuilder<crate::model::DeleteHubRequest>);
5818
5819    impl DeleteHub {
5820        pub(crate) fn new(
5821            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5822        ) -> Self {
5823            Self(RequestBuilder::new(stub))
5824        }
5825
5826        /// Sets the full request, replacing any prior values.
5827        pub fn with_request<V: Into<crate::model::DeleteHubRequest>>(mut self, v: V) -> Self {
5828            self.0.request = v.into();
5829            self
5830        }
5831
5832        /// Sets all the options, replacing any prior values.
5833        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5834            self.0.options = v.into();
5835            self
5836        }
5837
5838        /// Sends the request.
5839        ///
5840        /// # Long running operations
5841        ///
5842        /// This starts, but does not poll, a longrunning operation. More information
5843        /// on [delete_hub][crate::client::HubService::delete_hub].
5844        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5845            (*self.0.stub)
5846                .delete_hub(self.0.request, self.0.options)
5847                .await
5848                .map(crate::Response::into_body)
5849        }
5850
5851        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_hub`.
5852        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
5853            type Operation =
5854                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
5855            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5856            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5857
5858            let stub = self.0.stub.clone();
5859            let mut options = self.0.options.clone();
5860            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5861            let query = move |name| {
5862                let stub = stub.clone();
5863                let options = options.clone();
5864                async {
5865                    let op = GetOperation::new(stub)
5866                        .set_name(name)
5867                        .with_options(options)
5868                        .send()
5869                        .await?;
5870                    Ok(Operation::new(op))
5871                }
5872            };
5873
5874            let start = move || async {
5875                let op = self.send().await?;
5876                Ok(Operation::new(op))
5877            };
5878
5879            google_cloud_lro::internal::new_unit_response_poller(
5880                polling_error_policy,
5881                polling_backoff_policy,
5882                start,
5883                query,
5884            )
5885        }
5886
5887        /// Sets the value of [name][crate::model::DeleteHubRequest::name].
5888        ///
5889        /// This is a **required** field for requests.
5890        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5891            self.0.request.name = v.into();
5892            self
5893        }
5894
5895        /// Sets the value of [request_id][crate::model::DeleteHubRequest::request_id].
5896        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5897            self.0.request.request_id = v.into();
5898            self
5899        }
5900    }
5901
5902    #[doc(hidden)]
5903    impl crate::RequestBuilder for DeleteHub {
5904        fn request_options(&mut self) -> &mut crate::RequestOptions {
5905            &mut self.0.options
5906        }
5907    }
5908
5909    /// The request builder for [HubService::list_hub_spokes][crate::client::HubService::list_hub_spokes] calls.
5910    ///
5911    /// # Example
5912    /// ```
5913    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::ListHubSpokes;
5914    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
5915    /// use google_cloud_gax::paginator::ItemPaginator;
5916    ///
5917    /// let builder = prepare_request_builder();
5918    /// let mut items = builder.by_item();
5919    /// while let Some(result) = items.next().await {
5920    ///   let item = result?;
5921    /// }
5922    /// # Ok(()) }
5923    ///
5924    /// fn prepare_request_builder() -> ListHubSpokes {
5925    ///   # panic!();
5926    ///   // ... details omitted ...
5927    /// }
5928    /// ```
5929    #[derive(Clone, Debug)]
5930    pub struct ListHubSpokes(RequestBuilder<crate::model::ListHubSpokesRequest>);
5931
5932    impl ListHubSpokes {
5933        pub(crate) fn new(
5934            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5935        ) -> Self {
5936            Self(RequestBuilder::new(stub))
5937        }
5938
5939        /// Sets the full request, replacing any prior values.
5940        pub fn with_request<V: Into<crate::model::ListHubSpokesRequest>>(mut self, v: V) -> Self {
5941            self.0.request = v.into();
5942            self
5943        }
5944
5945        /// Sets all the options, replacing any prior values.
5946        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5947            self.0.options = v.into();
5948            self
5949        }
5950
5951        /// Sends the request.
5952        pub async fn send(self) -> Result<crate::model::ListHubSpokesResponse> {
5953            (*self.0.stub)
5954                .list_hub_spokes(self.0.request, self.0.options)
5955                .await
5956                .map(crate::Response::into_body)
5957        }
5958
5959        /// Streams each page in the collection.
5960        pub fn by_page(
5961            self,
5962        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListHubSpokesResponse, crate::Error>
5963        {
5964            use std::clone::Clone;
5965            let token = self.0.request.page_token.clone();
5966            let execute = move |token: String| {
5967                let mut builder = self.clone();
5968                builder.0.request = builder.0.request.set_page_token(token);
5969                builder.send()
5970            };
5971            google_cloud_gax::paginator::internal::new_paginator(token, execute)
5972        }
5973
5974        /// Streams each item in the collection.
5975        pub fn by_item(
5976            self,
5977        ) -> impl google_cloud_gax::paginator::ItemPaginator<
5978            crate::model::ListHubSpokesResponse,
5979            crate::Error,
5980        > {
5981            use google_cloud_gax::paginator::Paginator;
5982            self.by_page().items()
5983        }
5984
5985        /// Sets the value of [name][crate::model::ListHubSpokesRequest::name].
5986        ///
5987        /// This is a **required** field for requests.
5988        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5989            self.0.request.name = v.into();
5990            self
5991        }
5992
5993        /// Sets the value of [spoke_locations][crate::model::ListHubSpokesRequest::spoke_locations].
5994        pub fn set_spoke_locations<T, V>(mut self, v: T) -> Self
5995        where
5996            T: std::iter::IntoIterator<Item = V>,
5997            V: std::convert::Into<std::string::String>,
5998        {
5999            use std::iter::Iterator;
6000            self.0.request.spoke_locations = v.into_iter().map(|i| i.into()).collect();
6001            self
6002        }
6003
6004        /// Sets the value of [page_size][crate::model::ListHubSpokesRequest::page_size].
6005        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6006            self.0.request.page_size = v.into();
6007            self
6008        }
6009
6010        /// Sets the value of [page_token][crate::model::ListHubSpokesRequest::page_token].
6011        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6012            self.0.request.page_token = v.into();
6013            self
6014        }
6015
6016        /// Sets the value of [filter][crate::model::ListHubSpokesRequest::filter].
6017        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6018            self.0.request.filter = v.into();
6019            self
6020        }
6021
6022        /// Sets the value of [order_by][crate::model::ListHubSpokesRequest::order_by].
6023        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
6024            self.0.request.order_by = v.into();
6025            self
6026        }
6027
6028        /// Sets the value of [view][crate::model::ListHubSpokesRequest::view].
6029        pub fn set_view<T: Into<crate::model::list_hub_spokes_request::SpokeView>>(
6030            mut self,
6031            v: T,
6032        ) -> Self {
6033            self.0.request.view = v.into();
6034            self
6035        }
6036    }
6037
6038    #[doc(hidden)]
6039    impl crate::RequestBuilder for ListHubSpokes {
6040        fn request_options(&mut self) -> &mut crate::RequestOptions {
6041            &mut self.0.options
6042        }
6043    }
6044
6045    /// The request builder for [HubService::query_hub_status][crate::client::HubService::query_hub_status] calls.
6046    ///
6047    /// # Example
6048    /// ```
6049    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::QueryHubStatus;
6050    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
6051    /// use google_cloud_gax::paginator::ItemPaginator;
6052    ///
6053    /// let builder = prepare_request_builder();
6054    /// let mut items = builder.by_item();
6055    /// while let Some(result) = items.next().await {
6056    ///   let item = result?;
6057    /// }
6058    /// # Ok(()) }
6059    ///
6060    /// fn prepare_request_builder() -> QueryHubStatus {
6061    ///   # panic!();
6062    ///   // ... details omitted ...
6063    /// }
6064    /// ```
6065    #[derive(Clone, Debug)]
6066    pub struct QueryHubStatus(RequestBuilder<crate::model::QueryHubStatusRequest>);
6067
6068    impl QueryHubStatus {
6069        pub(crate) fn new(
6070            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6071        ) -> Self {
6072            Self(RequestBuilder::new(stub))
6073        }
6074
6075        /// Sets the full request, replacing any prior values.
6076        pub fn with_request<V: Into<crate::model::QueryHubStatusRequest>>(mut self, v: V) -> Self {
6077            self.0.request = v.into();
6078            self
6079        }
6080
6081        /// Sets all the options, replacing any prior values.
6082        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6083            self.0.options = v.into();
6084            self
6085        }
6086
6087        /// Sends the request.
6088        pub async fn send(self) -> Result<crate::model::QueryHubStatusResponse> {
6089            (*self.0.stub)
6090                .query_hub_status(self.0.request, self.0.options)
6091                .await
6092                .map(crate::Response::into_body)
6093        }
6094
6095        /// Streams each page in the collection.
6096        pub fn by_page(
6097            self,
6098        ) -> impl google_cloud_gax::paginator::Paginator<
6099            crate::model::QueryHubStatusResponse,
6100            crate::Error,
6101        > {
6102            use std::clone::Clone;
6103            let token = self.0.request.page_token.clone();
6104            let execute = move |token: String| {
6105                let mut builder = self.clone();
6106                builder.0.request = builder.0.request.set_page_token(token);
6107                builder.send()
6108            };
6109            google_cloud_gax::paginator::internal::new_paginator(token, execute)
6110        }
6111
6112        /// Streams each item in the collection.
6113        pub fn by_item(
6114            self,
6115        ) -> impl google_cloud_gax::paginator::ItemPaginator<
6116            crate::model::QueryHubStatusResponse,
6117            crate::Error,
6118        > {
6119            use google_cloud_gax::paginator::Paginator;
6120            self.by_page().items()
6121        }
6122
6123        /// Sets the value of [name][crate::model::QueryHubStatusRequest::name].
6124        ///
6125        /// This is a **required** field for requests.
6126        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6127            self.0.request.name = v.into();
6128            self
6129        }
6130
6131        /// Sets the value of [page_size][crate::model::QueryHubStatusRequest::page_size].
6132        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6133            self.0.request.page_size = v.into();
6134            self
6135        }
6136
6137        /// Sets the value of [page_token][crate::model::QueryHubStatusRequest::page_token].
6138        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6139            self.0.request.page_token = v.into();
6140            self
6141        }
6142
6143        /// Sets the value of [filter][crate::model::QueryHubStatusRequest::filter].
6144        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6145            self.0.request.filter = v.into();
6146            self
6147        }
6148
6149        /// Sets the value of [order_by][crate::model::QueryHubStatusRequest::order_by].
6150        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
6151            self.0.request.order_by = v.into();
6152            self
6153        }
6154
6155        /// Sets the value of [group_by][crate::model::QueryHubStatusRequest::group_by].
6156        pub fn set_group_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
6157            self.0.request.group_by = v.into();
6158            self
6159        }
6160    }
6161
6162    #[doc(hidden)]
6163    impl crate::RequestBuilder for QueryHubStatus {
6164        fn request_options(&mut self) -> &mut crate::RequestOptions {
6165            &mut self.0.options
6166        }
6167    }
6168
6169    /// The request builder for [HubService::list_spokes][crate::client::HubService::list_spokes] calls.
6170    ///
6171    /// # Example
6172    /// ```
6173    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::ListSpokes;
6174    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
6175    /// use google_cloud_gax::paginator::ItemPaginator;
6176    ///
6177    /// let builder = prepare_request_builder();
6178    /// let mut items = builder.by_item();
6179    /// while let Some(result) = items.next().await {
6180    ///   let item = result?;
6181    /// }
6182    /// # Ok(()) }
6183    ///
6184    /// fn prepare_request_builder() -> ListSpokes {
6185    ///   # panic!();
6186    ///   // ... details omitted ...
6187    /// }
6188    /// ```
6189    #[derive(Clone, Debug)]
6190    pub struct ListSpokes(RequestBuilder<crate::model::ListSpokesRequest>);
6191
6192    impl ListSpokes {
6193        pub(crate) fn new(
6194            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6195        ) -> Self {
6196            Self(RequestBuilder::new(stub))
6197        }
6198
6199        /// Sets the full request, replacing any prior values.
6200        pub fn with_request<V: Into<crate::model::ListSpokesRequest>>(mut self, v: V) -> Self {
6201            self.0.request = v.into();
6202            self
6203        }
6204
6205        /// Sets all the options, replacing any prior values.
6206        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6207            self.0.options = v.into();
6208            self
6209        }
6210
6211        /// Sends the request.
6212        pub async fn send(self) -> Result<crate::model::ListSpokesResponse> {
6213            (*self.0.stub)
6214                .list_spokes(self.0.request, self.0.options)
6215                .await
6216                .map(crate::Response::into_body)
6217        }
6218
6219        /// Streams each page in the collection.
6220        pub fn by_page(
6221            self,
6222        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListSpokesResponse, crate::Error>
6223        {
6224            use std::clone::Clone;
6225            let token = self.0.request.page_token.clone();
6226            let execute = move |token: String| {
6227                let mut builder = self.clone();
6228                builder.0.request = builder.0.request.set_page_token(token);
6229                builder.send()
6230            };
6231            google_cloud_gax::paginator::internal::new_paginator(token, execute)
6232        }
6233
6234        /// Streams each item in the collection.
6235        pub fn by_item(
6236            self,
6237        ) -> impl google_cloud_gax::paginator::ItemPaginator<
6238            crate::model::ListSpokesResponse,
6239            crate::Error,
6240        > {
6241            use google_cloud_gax::paginator::Paginator;
6242            self.by_page().items()
6243        }
6244
6245        /// Sets the value of [parent][crate::model::ListSpokesRequest::parent].
6246        ///
6247        /// This is a **required** field for requests.
6248        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6249            self.0.request.parent = v.into();
6250            self
6251        }
6252
6253        /// Sets the value of [page_size][crate::model::ListSpokesRequest::page_size].
6254        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6255            self.0.request.page_size = v.into();
6256            self
6257        }
6258
6259        /// Sets the value of [page_token][crate::model::ListSpokesRequest::page_token].
6260        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6261            self.0.request.page_token = v.into();
6262            self
6263        }
6264
6265        /// Sets the value of [filter][crate::model::ListSpokesRequest::filter].
6266        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6267            self.0.request.filter = v.into();
6268            self
6269        }
6270
6271        /// Sets the value of [order_by][crate::model::ListSpokesRequest::order_by].
6272        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
6273            self.0.request.order_by = v.into();
6274            self
6275        }
6276    }
6277
6278    #[doc(hidden)]
6279    impl crate::RequestBuilder for ListSpokes {
6280        fn request_options(&mut self) -> &mut crate::RequestOptions {
6281            &mut self.0.options
6282        }
6283    }
6284
6285    /// The request builder for [HubService::get_spoke][crate::client::HubService::get_spoke] calls.
6286    ///
6287    /// # Example
6288    /// ```
6289    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::GetSpoke;
6290    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
6291    ///
6292    /// let builder = prepare_request_builder();
6293    /// let response = builder.send().await?;
6294    /// # Ok(()) }
6295    ///
6296    /// fn prepare_request_builder() -> GetSpoke {
6297    ///   # panic!();
6298    ///   // ... details omitted ...
6299    /// }
6300    /// ```
6301    #[derive(Clone, Debug)]
6302    pub struct GetSpoke(RequestBuilder<crate::model::GetSpokeRequest>);
6303
6304    impl GetSpoke {
6305        pub(crate) fn new(
6306            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6307        ) -> Self {
6308            Self(RequestBuilder::new(stub))
6309        }
6310
6311        /// Sets the full request, replacing any prior values.
6312        pub fn with_request<V: Into<crate::model::GetSpokeRequest>>(mut self, v: V) -> Self {
6313            self.0.request = v.into();
6314            self
6315        }
6316
6317        /// Sets all the options, replacing any prior values.
6318        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6319            self.0.options = v.into();
6320            self
6321        }
6322
6323        /// Sends the request.
6324        pub async fn send(self) -> Result<crate::model::Spoke> {
6325            (*self.0.stub)
6326                .get_spoke(self.0.request, self.0.options)
6327                .await
6328                .map(crate::Response::into_body)
6329        }
6330
6331        /// Sets the value of [name][crate::model::GetSpokeRequest::name].
6332        ///
6333        /// This is a **required** field for requests.
6334        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6335            self.0.request.name = v.into();
6336            self
6337        }
6338    }
6339
6340    #[doc(hidden)]
6341    impl crate::RequestBuilder for GetSpoke {
6342        fn request_options(&mut self) -> &mut crate::RequestOptions {
6343            &mut self.0.options
6344        }
6345    }
6346
6347    /// The request builder for [HubService::create_spoke][crate::client::HubService::create_spoke] calls.
6348    ///
6349    /// # Example
6350    /// ```
6351    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::CreateSpoke;
6352    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
6353    /// use google_cloud_lro::Poller;
6354    ///
6355    /// let builder = prepare_request_builder();
6356    /// let response = builder.poller().until_done().await?;
6357    /// # Ok(()) }
6358    ///
6359    /// fn prepare_request_builder() -> CreateSpoke {
6360    ///   # panic!();
6361    ///   // ... details omitted ...
6362    /// }
6363    /// ```
6364    #[derive(Clone, Debug)]
6365    pub struct CreateSpoke(RequestBuilder<crate::model::CreateSpokeRequest>);
6366
6367    impl CreateSpoke {
6368        pub(crate) fn new(
6369            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6370        ) -> Self {
6371            Self(RequestBuilder::new(stub))
6372        }
6373
6374        /// Sets the full request, replacing any prior values.
6375        pub fn with_request<V: Into<crate::model::CreateSpokeRequest>>(mut self, v: V) -> Self {
6376            self.0.request = v.into();
6377            self
6378        }
6379
6380        /// Sets all the options, replacing any prior values.
6381        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6382            self.0.options = v.into();
6383            self
6384        }
6385
6386        /// Sends the request.
6387        ///
6388        /// # Long running operations
6389        ///
6390        /// This starts, but does not poll, a longrunning operation. More information
6391        /// on [create_spoke][crate::client::HubService::create_spoke].
6392        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6393            (*self.0.stub)
6394                .create_spoke(self.0.request, self.0.options)
6395                .await
6396                .map(crate::Response::into_body)
6397        }
6398
6399        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_spoke`.
6400        pub fn poller(
6401            self,
6402        ) -> impl google_cloud_lro::Poller<crate::model::Spoke, crate::model::OperationMetadata>
6403        {
6404            type Operation = google_cloud_lro::internal::Operation<
6405                crate::model::Spoke,
6406                crate::model::OperationMetadata,
6407            >;
6408            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6409            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6410
6411            let stub = self.0.stub.clone();
6412            let mut options = self.0.options.clone();
6413            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6414            let query = move |name| {
6415                let stub = stub.clone();
6416                let options = options.clone();
6417                async {
6418                    let op = GetOperation::new(stub)
6419                        .set_name(name)
6420                        .with_options(options)
6421                        .send()
6422                        .await?;
6423                    Ok(Operation::new(op))
6424                }
6425            };
6426
6427            let start = move || async {
6428                let op = self.send().await?;
6429                Ok(Operation::new(op))
6430            };
6431
6432            google_cloud_lro::internal::new_poller(
6433                polling_error_policy,
6434                polling_backoff_policy,
6435                start,
6436                query,
6437            )
6438        }
6439
6440        /// Sets the value of [parent][crate::model::CreateSpokeRequest::parent].
6441        ///
6442        /// This is a **required** field for requests.
6443        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6444            self.0.request.parent = v.into();
6445            self
6446        }
6447
6448        /// Sets the value of [spoke_id][crate::model::CreateSpokeRequest::spoke_id].
6449        ///
6450        /// This is a **required** field for requests.
6451        pub fn set_spoke_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6452            self.0.request.spoke_id = v.into();
6453            self
6454        }
6455
6456        /// Sets the value of [spoke][crate::model::CreateSpokeRequest::spoke].
6457        ///
6458        /// This is a **required** field for requests.
6459        pub fn set_spoke<T>(mut self, v: T) -> Self
6460        where
6461            T: std::convert::Into<crate::model::Spoke>,
6462        {
6463            self.0.request.spoke = std::option::Option::Some(v.into());
6464            self
6465        }
6466
6467        /// Sets or clears the value of [spoke][crate::model::CreateSpokeRequest::spoke].
6468        ///
6469        /// This is a **required** field for requests.
6470        pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
6471        where
6472            T: std::convert::Into<crate::model::Spoke>,
6473        {
6474            self.0.request.spoke = v.map(|x| x.into());
6475            self
6476        }
6477
6478        /// Sets the value of [request_id][crate::model::CreateSpokeRequest::request_id].
6479        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6480            self.0.request.request_id = v.into();
6481            self
6482        }
6483    }
6484
6485    #[doc(hidden)]
6486    impl crate::RequestBuilder for CreateSpoke {
6487        fn request_options(&mut self) -> &mut crate::RequestOptions {
6488            &mut self.0.options
6489        }
6490    }
6491
6492    /// The request builder for [HubService::update_spoke][crate::client::HubService::update_spoke] calls.
6493    ///
6494    /// # Example
6495    /// ```
6496    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::UpdateSpoke;
6497    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
6498    /// use google_cloud_lro::Poller;
6499    ///
6500    /// let builder = prepare_request_builder();
6501    /// let response = builder.poller().until_done().await?;
6502    /// # Ok(()) }
6503    ///
6504    /// fn prepare_request_builder() -> UpdateSpoke {
6505    ///   # panic!();
6506    ///   // ... details omitted ...
6507    /// }
6508    /// ```
6509    #[derive(Clone, Debug)]
6510    pub struct UpdateSpoke(RequestBuilder<crate::model::UpdateSpokeRequest>);
6511
6512    impl UpdateSpoke {
6513        pub(crate) fn new(
6514            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6515        ) -> Self {
6516            Self(RequestBuilder::new(stub))
6517        }
6518
6519        /// Sets the full request, replacing any prior values.
6520        pub fn with_request<V: Into<crate::model::UpdateSpokeRequest>>(mut self, v: V) -> Self {
6521            self.0.request = v.into();
6522            self
6523        }
6524
6525        /// Sets all the options, replacing any prior values.
6526        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6527            self.0.options = v.into();
6528            self
6529        }
6530
6531        /// Sends the request.
6532        ///
6533        /// # Long running operations
6534        ///
6535        /// This starts, but does not poll, a longrunning operation. More information
6536        /// on [update_spoke][crate::client::HubService::update_spoke].
6537        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6538            (*self.0.stub)
6539                .update_spoke(self.0.request, self.0.options)
6540                .await
6541                .map(crate::Response::into_body)
6542        }
6543
6544        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_spoke`.
6545        pub fn poller(
6546            self,
6547        ) -> impl google_cloud_lro::Poller<crate::model::Spoke, crate::model::OperationMetadata>
6548        {
6549            type Operation = google_cloud_lro::internal::Operation<
6550                crate::model::Spoke,
6551                crate::model::OperationMetadata,
6552            >;
6553            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6554            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6555
6556            let stub = self.0.stub.clone();
6557            let mut options = self.0.options.clone();
6558            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6559            let query = move |name| {
6560                let stub = stub.clone();
6561                let options = options.clone();
6562                async {
6563                    let op = GetOperation::new(stub)
6564                        .set_name(name)
6565                        .with_options(options)
6566                        .send()
6567                        .await?;
6568                    Ok(Operation::new(op))
6569                }
6570            };
6571
6572            let start = move || async {
6573                let op = self.send().await?;
6574                Ok(Operation::new(op))
6575            };
6576
6577            google_cloud_lro::internal::new_poller(
6578                polling_error_policy,
6579                polling_backoff_policy,
6580                start,
6581                query,
6582            )
6583        }
6584
6585        /// Sets the value of [update_mask][crate::model::UpdateSpokeRequest::update_mask].
6586        pub fn set_update_mask<T>(mut self, v: T) -> Self
6587        where
6588            T: std::convert::Into<wkt::FieldMask>,
6589        {
6590            self.0.request.update_mask = std::option::Option::Some(v.into());
6591            self
6592        }
6593
6594        /// Sets or clears the value of [update_mask][crate::model::UpdateSpokeRequest::update_mask].
6595        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6596        where
6597            T: std::convert::Into<wkt::FieldMask>,
6598        {
6599            self.0.request.update_mask = v.map(|x| x.into());
6600            self
6601        }
6602
6603        /// Sets the value of [spoke][crate::model::UpdateSpokeRequest::spoke].
6604        ///
6605        /// This is a **required** field for requests.
6606        pub fn set_spoke<T>(mut self, v: T) -> Self
6607        where
6608            T: std::convert::Into<crate::model::Spoke>,
6609        {
6610            self.0.request.spoke = std::option::Option::Some(v.into());
6611            self
6612        }
6613
6614        /// Sets or clears the value of [spoke][crate::model::UpdateSpokeRequest::spoke].
6615        ///
6616        /// This is a **required** field for requests.
6617        pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
6618        where
6619            T: std::convert::Into<crate::model::Spoke>,
6620        {
6621            self.0.request.spoke = v.map(|x| x.into());
6622            self
6623        }
6624
6625        /// Sets the value of [request_id][crate::model::UpdateSpokeRequest::request_id].
6626        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6627            self.0.request.request_id = v.into();
6628            self
6629        }
6630    }
6631
6632    #[doc(hidden)]
6633    impl crate::RequestBuilder for UpdateSpoke {
6634        fn request_options(&mut self) -> &mut crate::RequestOptions {
6635            &mut self.0.options
6636        }
6637    }
6638
6639    /// The request builder for [HubService::reject_hub_spoke][crate::client::HubService::reject_hub_spoke] calls.
6640    ///
6641    /// # Example
6642    /// ```
6643    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::RejectHubSpoke;
6644    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
6645    /// use google_cloud_lro::Poller;
6646    ///
6647    /// let builder = prepare_request_builder();
6648    /// let response = builder.poller().until_done().await?;
6649    /// # Ok(()) }
6650    ///
6651    /// fn prepare_request_builder() -> RejectHubSpoke {
6652    ///   # panic!();
6653    ///   // ... details omitted ...
6654    /// }
6655    /// ```
6656    #[derive(Clone, Debug)]
6657    pub struct RejectHubSpoke(RequestBuilder<crate::model::RejectHubSpokeRequest>);
6658
6659    impl RejectHubSpoke {
6660        pub(crate) fn new(
6661            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6662        ) -> Self {
6663            Self(RequestBuilder::new(stub))
6664        }
6665
6666        /// Sets the full request, replacing any prior values.
6667        pub fn with_request<V: Into<crate::model::RejectHubSpokeRequest>>(mut self, v: V) -> Self {
6668            self.0.request = v.into();
6669            self
6670        }
6671
6672        /// Sets all the options, replacing any prior values.
6673        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6674            self.0.options = v.into();
6675            self
6676        }
6677
6678        /// Sends the request.
6679        ///
6680        /// # Long running operations
6681        ///
6682        /// This starts, but does not poll, a longrunning operation. More information
6683        /// on [reject_hub_spoke][crate::client::HubService::reject_hub_spoke].
6684        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6685            (*self.0.stub)
6686                .reject_hub_spoke(self.0.request, self.0.options)
6687                .await
6688                .map(crate::Response::into_body)
6689        }
6690
6691        /// Creates a [Poller][google_cloud_lro::Poller] to work with `reject_hub_spoke`.
6692        pub fn poller(
6693            self,
6694        ) -> impl google_cloud_lro::Poller<
6695            crate::model::RejectHubSpokeResponse,
6696            crate::model::OperationMetadata,
6697        > {
6698            type Operation = google_cloud_lro::internal::Operation<
6699                crate::model::RejectHubSpokeResponse,
6700                crate::model::OperationMetadata,
6701            >;
6702            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6703            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6704
6705            let stub = self.0.stub.clone();
6706            let mut options = self.0.options.clone();
6707            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6708            let query = move |name| {
6709                let stub = stub.clone();
6710                let options = options.clone();
6711                async {
6712                    let op = GetOperation::new(stub)
6713                        .set_name(name)
6714                        .with_options(options)
6715                        .send()
6716                        .await?;
6717                    Ok(Operation::new(op))
6718                }
6719            };
6720
6721            let start = move || async {
6722                let op = self.send().await?;
6723                Ok(Operation::new(op))
6724            };
6725
6726            google_cloud_lro::internal::new_poller(
6727                polling_error_policy,
6728                polling_backoff_policy,
6729                start,
6730                query,
6731            )
6732        }
6733
6734        /// Sets the value of [name][crate::model::RejectHubSpokeRequest::name].
6735        ///
6736        /// This is a **required** field for requests.
6737        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6738            self.0.request.name = v.into();
6739            self
6740        }
6741
6742        /// Sets the value of [spoke_uri][crate::model::RejectHubSpokeRequest::spoke_uri].
6743        ///
6744        /// This is a **required** field for requests.
6745        pub fn set_spoke_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
6746            self.0.request.spoke_uri = v.into();
6747            self
6748        }
6749
6750        /// Sets the value of [request_id][crate::model::RejectHubSpokeRequest::request_id].
6751        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6752            self.0.request.request_id = v.into();
6753            self
6754        }
6755
6756        /// Sets the value of [details][crate::model::RejectHubSpokeRequest::details].
6757        pub fn set_details<T: Into<std::string::String>>(mut self, v: T) -> Self {
6758            self.0.request.details = v.into();
6759            self
6760        }
6761    }
6762
6763    #[doc(hidden)]
6764    impl crate::RequestBuilder for RejectHubSpoke {
6765        fn request_options(&mut self) -> &mut crate::RequestOptions {
6766            &mut self.0.options
6767        }
6768    }
6769
6770    /// The request builder for [HubService::accept_hub_spoke][crate::client::HubService::accept_hub_spoke] calls.
6771    ///
6772    /// # Example
6773    /// ```
6774    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::AcceptHubSpoke;
6775    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
6776    /// use google_cloud_lro::Poller;
6777    ///
6778    /// let builder = prepare_request_builder();
6779    /// let response = builder.poller().until_done().await?;
6780    /// # Ok(()) }
6781    ///
6782    /// fn prepare_request_builder() -> AcceptHubSpoke {
6783    ///   # panic!();
6784    ///   // ... details omitted ...
6785    /// }
6786    /// ```
6787    #[derive(Clone, Debug)]
6788    pub struct AcceptHubSpoke(RequestBuilder<crate::model::AcceptHubSpokeRequest>);
6789
6790    impl AcceptHubSpoke {
6791        pub(crate) fn new(
6792            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6793        ) -> Self {
6794            Self(RequestBuilder::new(stub))
6795        }
6796
6797        /// Sets the full request, replacing any prior values.
6798        pub fn with_request<V: Into<crate::model::AcceptHubSpokeRequest>>(mut self, v: V) -> Self {
6799            self.0.request = v.into();
6800            self
6801        }
6802
6803        /// Sets all the options, replacing any prior values.
6804        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6805            self.0.options = v.into();
6806            self
6807        }
6808
6809        /// Sends the request.
6810        ///
6811        /// # Long running operations
6812        ///
6813        /// This starts, but does not poll, a longrunning operation. More information
6814        /// on [accept_hub_spoke][crate::client::HubService::accept_hub_spoke].
6815        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6816            (*self.0.stub)
6817                .accept_hub_spoke(self.0.request, self.0.options)
6818                .await
6819                .map(crate::Response::into_body)
6820        }
6821
6822        /// Creates a [Poller][google_cloud_lro::Poller] to work with `accept_hub_spoke`.
6823        pub fn poller(
6824            self,
6825        ) -> impl google_cloud_lro::Poller<
6826            crate::model::AcceptHubSpokeResponse,
6827            crate::model::OperationMetadata,
6828        > {
6829            type Operation = google_cloud_lro::internal::Operation<
6830                crate::model::AcceptHubSpokeResponse,
6831                crate::model::OperationMetadata,
6832            >;
6833            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6834            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6835
6836            let stub = self.0.stub.clone();
6837            let mut options = self.0.options.clone();
6838            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6839            let query = move |name| {
6840                let stub = stub.clone();
6841                let options = options.clone();
6842                async {
6843                    let op = GetOperation::new(stub)
6844                        .set_name(name)
6845                        .with_options(options)
6846                        .send()
6847                        .await?;
6848                    Ok(Operation::new(op))
6849                }
6850            };
6851
6852            let start = move || async {
6853                let op = self.send().await?;
6854                Ok(Operation::new(op))
6855            };
6856
6857            google_cloud_lro::internal::new_poller(
6858                polling_error_policy,
6859                polling_backoff_policy,
6860                start,
6861                query,
6862            )
6863        }
6864
6865        /// Sets the value of [name][crate::model::AcceptHubSpokeRequest::name].
6866        ///
6867        /// This is a **required** field for requests.
6868        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6869            self.0.request.name = v.into();
6870            self
6871        }
6872
6873        /// Sets the value of [spoke_uri][crate::model::AcceptHubSpokeRequest::spoke_uri].
6874        ///
6875        /// This is a **required** field for requests.
6876        pub fn set_spoke_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
6877            self.0.request.spoke_uri = v.into();
6878            self
6879        }
6880
6881        /// Sets the value of [request_id][crate::model::AcceptHubSpokeRequest::request_id].
6882        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6883            self.0.request.request_id = v.into();
6884            self
6885        }
6886    }
6887
6888    #[doc(hidden)]
6889    impl crate::RequestBuilder for AcceptHubSpoke {
6890        fn request_options(&mut self) -> &mut crate::RequestOptions {
6891            &mut self.0.options
6892        }
6893    }
6894
6895    /// The request builder for [HubService::accept_spoke_update][crate::client::HubService::accept_spoke_update] calls.
6896    ///
6897    /// # Example
6898    /// ```
6899    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::AcceptSpokeUpdate;
6900    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
6901    /// use google_cloud_lro::Poller;
6902    ///
6903    /// let builder = prepare_request_builder();
6904    /// let response = builder.poller().until_done().await?;
6905    /// # Ok(()) }
6906    ///
6907    /// fn prepare_request_builder() -> AcceptSpokeUpdate {
6908    ///   # panic!();
6909    ///   // ... details omitted ...
6910    /// }
6911    /// ```
6912    #[derive(Clone, Debug)]
6913    pub struct AcceptSpokeUpdate(RequestBuilder<crate::model::AcceptSpokeUpdateRequest>);
6914
6915    impl AcceptSpokeUpdate {
6916        pub(crate) fn new(
6917            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6918        ) -> Self {
6919            Self(RequestBuilder::new(stub))
6920        }
6921
6922        /// Sets the full request, replacing any prior values.
6923        pub fn with_request<V: Into<crate::model::AcceptSpokeUpdateRequest>>(
6924            mut self,
6925            v: V,
6926        ) -> Self {
6927            self.0.request = v.into();
6928            self
6929        }
6930
6931        /// Sets all the options, replacing any prior values.
6932        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6933            self.0.options = v.into();
6934            self
6935        }
6936
6937        /// Sends the request.
6938        ///
6939        /// # Long running operations
6940        ///
6941        /// This starts, but does not poll, a longrunning operation. More information
6942        /// on [accept_spoke_update][crate::client::HubService::accept_spoke_update].
6943        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6944            (*self.0.stub)
6945                .accept_spoke_update(self.0.request, self.0.options)
6946                .await
6947                .map(crate::Response::into_body)
6948        }
6949
6950        /// Creates a [Poller][google_cloud_lro::Poller] to work with `accept_spoke_update`.
6951        pub fn poller(
6952            self,
6953        ) -> impl google_cloud_lro::Poller<
6954            crate::model::AcceptSpokeUpdateResponse,
6955            crate::model::OperationMetadata,
6956        > {
6957            type Operation = google_cloud_lro::internal::Operation<
6958                crate::model::AcceptSpokeUpdateResponse,
6959                crate::model::OperationMetadata,
6960            >;
6961            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6962            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6963
6964            let stub = self.0.stub.clone();
6965            let mut options = self.0.options.clone();
6966            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6967            let query = move |name| {
6968                let stub = stub.clone();
6969                let options = options.clone();
6970                async {
6971                    let op = GetOperation::new(stub)
6972                        .set_name(name)
6973                        .with_options(options)
6974                        .send()
6975                        .await?;
6976                    Ok(Operation::new(op))
6977                }
6978            };
6979
6980            let start = move || async {
6981                let op = self.send().await?;
6982                Ok(Operation::new(op))
6983            };
6984
6985            google_cloud_lro::internal::new_poller(
6986                polling_error_policy,
6987                polling_backoff_policy,
6988                start,
6989                query,
6990            )
6991        }
6992
6993        /// Sets the value of [name][crate::model::AcceptSpokeUpdateRequest::name].
6994        ///
6995        /// This is a **required** field for requests.
6996        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6997            self.0.request.name = v.into();
6998            self
6999        }
7000
7001        /// Sets the value of [spoke_uri][crate::model::AcceptSpokeUpdateRequest::spoke_uri].
7002        ///
7003        /// This is a **required** field for requests.
7004        pub fn set_spoke_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
7005            self.0.request.spoke_uri = v.into();
7006            self
7007        }
7008
7009        /// Sets the value of [spoke_etag][crate::model::AcceptSpokeUpdateRequest::spoke_etag].
7010        ///
7011        /// This is a **required** field for requests.
7012        pub fn set_spoke_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
7013            self.0.request.spoke_etag = v.into();
7014            self
7015        }
7016
7017        /// Sets the value of [request_id][crate::model::AcceptSpokeUpdateRequest::request_id].
7018        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
7019            self.0.request.request_id = v.into();
7020            self
7021        }
7022    }
7023
7024    #[doc(hidden)]
7025    impl crate::RequestBuilder for AcceptSpokeUpdate {
7026        fn request_options(&mut self) -> &mut crate::RequestOptions {
7027            &mut self.0.options
7028        }
7029    }
7030
7031    /// The request builder for [HubService::reject_spoke_update][crate::client::HubService::reject_spoke_update] calls.
7032    ///
7033    /// # Example
7034    /// ```
7035    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::RejectSpokeUpdate;
7036    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
7037    /// use google_cloud_lro::Poller;
7038    ///
7039    /// let builder = prepare_request_builder();
7040    /// let response = builder.poller().until_done().await?;
7041    /// # Ok(()) }
7042    ///
7043    /// fn prepare_request_builder() -> RejectSpokeUpdate {
7044    ///   # panic!();
7045    ///   // ... details omitted ...
7046    /// }
7047    /// ```
7048    #[derive(Clone, Debug)]
7049    pub struct RejectSpokeUpdate(RequestBuilder<crate::model::RejectSpokeUpdateRequest>);
7050
7051    impl RejectSpokeUpdate {
7052        pub(crate) fn new(
7053            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7054        ) -> Self {
7055            Self(RequestBuilder::new(stub))
7056        }
7057
7058        /// Sets the full request, replacing any prior values.
7059        pub fn with_request<V: Into<crate::model::RejectSpokeUpdateRequest>>(
7060            mut self,
7061            v: V,
7062        ) -> Self {
7063            self.0.request = v.into();
7064            self
7065        }
7066
7067        /// Sets all the options, replacing any prior values.
7068        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7069            self.0.options = v.into();
7070            self
7071        }
7072
7073        /// Sends the request.
7074        ///
7075        /// # Long running operations
7076        ///
7077        /// This starts, but does not poll, a longrunning operation. More information
7078        /// on [reject_spoke_update][crate::client::HubService::reject_spoke_update].
7079        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7080            (*self.0.stub)
7081                .reject_spoke_update(self.0.request, self.0.options)
7082                .await
7083                .map(crate::Response::into_body)
7084        }
7085
7086        /// Creates a [Poller][google_cloud_lro::Poller] to work with `reject_spoke_update`.
7087        pub fn poller(
7088            self,
7089        ) -> impl google_cloud_lro::Poller<
7090            crate::model::RejectSpokeUpdateResponse,
7091            crate::model::OperationMetadata,
7092        > {
7093            type Operation = google_cloud_lro::internal::Operation<
7094                crate::model::RejectSpokeUpdateResponse,
7095                crate::model::OperationMetadata,
7096            >;
7097            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7098            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7099
7100            let stub = self.0.stub.clone();
7101            let mut options = self.0.options.clone();
7102            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
7103            let query = move |name| {
7104                let stub = stub.clone();
7105                let options = options.clone();
7106                async {
7107                    let op = GetOperation::new(stub)
7108                        .set_name(name)
7109                        .with_options(options)
7110                        .send()
7111                        .await?;
7112                    Ok(Operation::new(op))
7113                }
7114            };
7115
7116            let start = move || async {
7117                let op = self.send().await?;
7118                Ok(Operation::new(op))
7119            };
7120
7121            google_cloud_lro::internal::new_poller(
7122                polling_error_policy,
7123                polling_backoff_policy,
7124                start,
7125                query,
7126            )
7127        }
7128
7129        /// Sets the value of [name][crate::model::RejectSpokeUpdateRequest::name].
7130        ///
7131        /// This is a **required** field for requests.
7132        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7133            self.0.request.name = v.into();
7134            self
7135        }
7136
7137        /// Sets the value of [spoke_uri][crate::model::RejectSpokeUpdateRequest::spoke_uri].
7138        ///
7139        /// This is a **required** field for requests.
7140        pub fn set_spoke_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
7141            self.0.request.spoke_uri = v.into();
7142            self
7143        }
7144
7145        /// Sets the value of [spoke_etag][crate::model::RejectSpokeUpdateRequest::spoke_etag].
7146        ///
7147        /// This is a **required** field for requests.
7148        pub fn set_spoke_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
7149            self.0.request.spoke_etag = v.into();
7150            self
7151        }
7152
7153        /// Sets the value of [details][crate::model::RejectSpokeUpdateRequest::details].
7154        pub fn set_details<T: Into<std::string::String>>(mut self, v: T) -> Self {
7155            self.0.request.details = v.into();
7156            self
7157        }
7158
7159        /// Sets the value of [request_id][crate::model::RejectSpokeUpdateRequest::request_id].
7160        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
7161            self.0.request.request_id = v.into();
7162            self
7163        }
7164    }
7165
7166    #[doc(hidden)]
7167    impl crate::RequestBuilder for RejectSpokeUpdate {
7168        fn request_options(&mut self) -> &mut crate::RequestOptions {
7169            &mut self.0.options
7170        }
7171    }
7172
7173    /// The request builder for [HubService::delete_spoke][crate::client::HubService::delete_spoke] calls.
7174    ///
7175    /// # Example
7176    /// ```
7177    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::DeleteSpoke;
7178    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
7179    /// use google_cloud_lro::Poller;
7180    ///
7181    /// let builder = prepare_request_builder();
7182    /// let response = builder.poller().until_done().await?;
7183    /// # Ok(()) }
7184    ///
7185    /// fn prepare_request_builder() -> DeleteSpoke {
7186    ///   # panic!();
7187    ///   // ... details omitted ...
7188    /// }
7189    /// ```
7190    #[derive(Clone, Debug)]
7191    pub struct DeleteSpoke(RequestBuilder<crate::model::DeleteSpokeRequest>);
7192
7193    impl DeleteSpoke {
7194        pub(crate) fn new(
7195            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7196        ) -> Self {
7197            Self(RequestBuilder::new(stub))
7198        }
7199
7200        /// Sets the full request, replacing any prior values.
7201        pub fn with_request<V: Into<crate::model::DeleteSpokeRequest>>(mut self, v: V) -> Self {
7202            self.0.request = v.into();
7203            self
7204        }
7205
7206        /// Sets all the options, replacing any prior values.
7207        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7208            self.0.options = v.into();
7209            self
7210        }
7211
7212        /// Sends the request.
7213        ///
7214        /// # Long running operations
7215        ///
7216        /// This starts, but does not poll, a longrunning operation. More information
7217        /// on [delete_spoke][crate::client::HubService::delete_spoke].
7218        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7219            (*self.0.stub)
7220                .delete_spoke(self.0.request, self.0.options)
7221                .await
7222                .map(crate::Response::into_body)
7223        }
7224
7225        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_spoke`.
7226        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
7227            type Operation =
7228                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
7229            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7230            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7231
7232            let stub = self.0.stub.clone();
7233            let mut options = self.0.options.clone();
7234            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
7235            let query = move |name| {
7236                let stub = stub.clone();
7237                let options = options.clone();
7238                async {
7239                    let op = GetOperation::new(stub)
7240                        .set_name(name)
7241                        .with_options(options)
7242                        .send()
7243                        .await?;
7244                    Ok(Operation::new(op))
7245                }
7246            };
7247
7248            let start = move || async {
7249                let op = self.send().await?;
7250                Ok(Operation::new(op))
7251            };
7252
7253            google_cloud_lro::internal::new_unit_response_poller(
7254                polling_error_policy,
7255                polling_backoff_policy,
7256                start,
7257                query,
7258            )
7259        }
7260
7261        /// Sets the value of [name][crate::model::DeleteSpokeRequest::name].
7262        ///
7263        /// This is a **required** field for requests.
7264        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7265            self.0.request.name = v.into();
7266            self
7267        }
7268
7269        /// Sets the value of [request_id][crate::model::DeleteSpokeRequest::request_id].
7270        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
7271            self.0.request.request_id = v.into();
7272            self
7273        }
7274    }
7275
7276    #[doc(hidden)]
7277    impl crate::RequestBuilder for DeleteSpoke {
7278        fn request_options(&mut self) -> &mut crate::RequestOptions {
7279            &mut self.0.options
7280        }
7281    }
7282
7283    /// The request builder for [HubService::get_route_table][crate::client::HubService::get_route_table] calls.
7284    ///
7285    /// # Example
7286    /// ```
7287    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::GetRouteTable;
7288    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
7289    ///
7290    /// let builder = prepare_request_builder();
7291    /// let response = builder.send().await?;
7292    /// # Ok(()) }
7293    ///
7294    /// fn prepare_request_builder() -> GetRouteTable {
7295    ///   # panic!();
7296    ///   // ... details omitted ...
7297    /// }
7298    /// ```
7299    #[derive(Clone, Debug)]
7300    pub struct GetRouteTable(RequestBuilder<crate::model::GetRouteTableRequest>);
7301
7302    impl GetRouteTable {
7303        pub(crate) fn new(
7304            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7305        ) -> Self {
7306            Self(RequestBuilder::new(stub))
7307        }
7308
7309        /// Sets the full request, replacing any prior values.
7310        pub fn with_request<V: Into<crate::model::GetRouteTableRequest>>(mut self, v: V) -> Self {
7311            self.0.request = v.into();
7312            self
7313        }
7314
7315        /// Sets all the options, replacing any prior values.
7316        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7317            self.0.options = v.into();
7318            self
7319        }
7320
7321        /// Sends the request.
7322        pub async fn send(self) -> Result<crate::model::RouteTable> {
7323            (*self.0.stub)
7324                .get_route_table(self.0.request, self.0.options)
7325                .await
7326                .map(crate::Response::into_body)
7327        }
7328
7329        /// Sets the value of [name][crate::model::GetRouteTableRequest::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
7338    #[doc(hidden)]
7339    impl crate::RequestBuilder for GetRouteTable {
7340        fn request_options(&mut self) -> &mut crate::RequestOptions {
7341            &mut self.0.options
7342        }
7343    }
7344
7345    /// The request builder for [HubService::get_route][crate::client::HubService::get_route] calls.
7346    ///
7347    /// # Example
7348    /// ```
7349    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::GetRoute;
7350    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
7351    ///
7352    /// let builder = prepare_request_builder();
7353    /// let response = builder.send().await?;
7354    /// # Ok(()) }
7355    ///
7356    /// fn prepare_request_builder() -> GetRoute {
7357    ///   # panic!();
7358    ///   // ... details omitted ...
7359    /// }
7360    /// ```
7361    #[derive(Clone, Debug)]
7362    pub struct GetRoute(RequestBuilder<crate::model::GetRouteRequest>);
7363
7364    impl GetRoute {
7365        pub(crate) fn new(
7366            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7367        ) -> Self {
7368            Self(RequestBuilder::new(stub))
7369        }
7370
7371        /// Sets the full request, replacing any prior values.
7372        pub fn with_request<V: Into<crate::model::GetRouteRequest>>(mut self, v: V) -> Self {
7373            self.0.request = v.into();
7374            self
7375        }
7376
7377        /// Sets all the options, replacing any prior values.
7378        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7379            self.0.options = v.into();
7380            self
7381        }
7382
7383        /// Sends the request.
7384        pub async fn send(self) -> Result<crate::model::Route> {
7385            (*self.0.stub)
7386                .get_route(self.0.request, self.0.options)
7387                .await
7388                .map(crate::Response::into_body)
7389        }
7390
7391        /// Sets the value of [name][crate::model::GetRouteRequest::name].
7392        ///
7393        /// This is a **required** field for requests.
7394        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7395            self.0.request.name = v.into();
7396            self
7397        }
7398    }
7399
7400    #[doc(hidden)]
7401    impl crate::RequestBuilder for GetRoute {
7402        fn request_options(&mut self) -> &mut crate::RequestOptions {
7403            &mut self.0.options
7404        }
7405    }
7406
7407    /// The request builder for [HubService::list_routes][crate::client::HubService::list_routes] calls.
7408    ///
7409    /// # Example
7410    /// ```
7411    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::ListRoutes;
7412    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
7413    /// use google_cloud_gax::paginator::ItemPaginator;
7414    ///
7415    /// let builder = prepare_request_builder();
7416    /// let mut items = builder.by_item();
7417    /// while let Some(result) = items.next().await {
7418    ///   let item = result?;
7419    /// }
7420    /// # Ok(()) }
7421    ///
7422    /// fn prepare_request_builder() -> ListRoutes {
7423    ///   # panic!();
7424    ///   // ... details omitted ...
7425    /// }
7426    /// ```
7427    #[derive(Clone, Debug)]
7428    pub struct ListRoutes(RequestBuilder<crate::model::ListRoutesRequest>);
7429
7430    impl ListRoutes {
7431        pub(crate) fn new(
7432            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7433        ) -> Self {
7434            Self(RequestBuilder::new(stub))
7435        }
7436
7437        /// Sets the full request, replacing any prior values.
7438        pub fn with_request<V: Into<crate::model::ListRoutesRequest>>(mut self, v: V) -> Self {
7439            self.0.request = v.into();
7440            self
7441        }
7442
7443        /// Sets all the options, replacing any prior values.
7444        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7445            self.0.options = v.into();
7446            self
7447        }
7448
7449        /// Sends the request.
7450        pub async fn send(self) -> Result<crate::model::ListRoutesResponse> {
7451            (*self.0.stub)
7452                .list_routes(self.0.request, self.0.options)
7453                .await
7454                .map(crate::Response::into_body)
7455        }
7456
7457        /// Streams each page in the collection.
7458        pub fn by_page(
7459            self,
7460        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListRoutesResponse, crate::Error>
7461        {
7462            use std::clone::Clone;
7463            let token = self.0.request.page_token.clone();
7464            let execute = move |token: String| {
7465                let mut builder = self.clone();
7466                builder.0.request = builder.0.request.set_page_token(token);
7467                builder.send()
7468            };
7469            google_cloud_gax::paginator::internal::new_paginator(token, execute)
7470        }
7471
7472        /// Streams each item in the collection.
7473        pub fn by_item(
7474            self,
7475        ) -> impl google_cloud_gax::paginator::ItemPaginator<
7476            crate::model::ListRoutesResponse,
7477            crate::Error,
7478        > {
7479            use google_cloud_gax::paginator::Paginator;
7480            self.by_page().items()
7481        }
7482
7483        /// Sets the value of [parent][crate::model::ListRoutesRequest::parent].
7484        ///
7485        /// This is a **required** field for requests.
7486        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7487            self.0.request.parent = v.into();
7488            self
7489        }
7490
7491        /// Sets the value of [page_size][crate::model::ListRoutesRequest::page_size].
7492        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7493            self.0.request.page_size = v.into();
7494            self
7495        }
7496
7497        /// Sets the value of [page_token][crate::model::ListRoutesRequest::page_token].
7498        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7499            self.0.request.page_token = v.into();
7500            self
7501        }
7502
7503        /// Sets the value of [filter][crate::model::ListRoutesRequest::filter].
7504        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7505            self.0.request.filter = v.into();
7506            self
7507        }
7508
7509        /// Sets the value of [order_by][crate::model::ListRoutesRequest::order_by].
7510        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
7511            self.0.request.order_by = v.into();
7512            self
7513        }
7514    }
7515
7516    #[doc(hidden)]
7517    impl crate::RequestBuilder for ListRoutes {
7518        fn request_options(&mut self) -> &mut crate::RequestOptions {
7519            &mut self.0.options
7520        }
7521    }
7522
7523    /// The request builder for [HubService::list_route_tables][crate::client::HubService::list_route_tables] calls.
7524    ///
7525    /// # Example
7526    /// ```
7527    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::ListRouteTables;
7528    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
7529    /// use google_cloud_gax::paginator::ItemPaginator;
7530    ///
7531    /// let builder = prepare_request_builder();
7532    /// let mut items = builder.by_item();
7533    /// while let Some(result) = items.next().await {
7534    ///   let item = result?;
7535    /// }
7536    /// # Ok(()) }
7537    ///
7538    /// fn prepare_request_builder() -> ListRouteTables {
7539    ///   # panic!();
7540    ///   // ... details omitted ...
7541    /// }
7542    /// ```
7543    #[derive(Clone, Debug)]
7544    pub struct ListRouteTables(RequestBuilder<crate::model::ListRouteTablesRequest>);
7545
7546    impl ListRouteTables {
7547        pub(crate) fn new(
7548            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7549        ) -> Self {
7550            Self(RequestBuilder::new(stub))
7551        }
7552
7553        /// Sets the full request, replacing any prior values.
7554        pub fn with_request<V: Into<crate::model::ListRouteTablesRequest>>(mut self, v: V) -> Self {
7555            self.0.request = v.into();
7556            self
7557        }
7558
7559        /// Sets all the options, replacing any prior values.
7560        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7561            self.0.options = v.into();
7562            self
7563        }
7564
7565        /// Sends the request.
7566        pub async fn send(self) -> Result<crate::model::ListRouteTablesResponse> {
7567            (*self.0.stub)
7568                .list_route_tables(self.0.request, self.0.options)
7569                .await
7570                .map(crate::Response::into_body)
7571        }
7572
7573        /// Streams each page in the collection.
7574        pub fn by_page(
7575            self,
7576        ) -> impl google_cloud_gax::paginator::Paginator<
7577            crate::model::ListRouteTablesResponse,
7578            crate::Error,
7579        > {
7580            use std::clone::Clone;
7581            let token = self.0.request.page_token.clone();
7582            let execute = move |token: String| {
7583                let mut builder = self.clone();
7584                builder.0.request = builder.0.request.set_page_token(token);
7585                builder.send()
7586            };
7587            google_cloud_gax::paginator::internal::new_paginator(token, execute)
7588        }
7589
7590        /// Streams each item in the collection.
7591        pub fn by_item(
7592            self,
7593        ) -> impl google_cloud_gax::paginator::ItemPaginator<
7594            crate::model::ListRouteTablesResponse,
7595            crate::Error,
7596        > {
7597            use google_cloud_gax::paginator::Paginator;
7598            self.by_page().items()
7599        }
7600
7601        /// Sets the value of [parent][crate::model::ListRouteTablesRequest::parent].
7602        ///
7603        /// This is a **required** field for requests.
7604        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7605            self.0.request.parent = v.into();
7606            self
7607        }
7608
7609        /// Sets the value of [page_size][crate::model::ListRouteTablesRequest::page_size].
7610        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7611            self.0.request.page_size = v.into();
7612            self
7613        }
7614
7615        /// Sets the value of [page_token][crate::model::ListRouteTablesRequest::page_token].
7616        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7617            self.0.request.page_token = v.into();
7618            self
7619        }
7620
7621        /// Sets the value of [filter][crate::model::ListRouteTablesRequest::filter].
7622        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7623            self.0.request.filter = v.into();
7624            self
7625        }
7626
7627        /// Sets the value of [order_by][crate::model::ListRouteTablesRequest::order_by].
7628        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
7629            self.0.request.order_by = v.into();
7630            self
7631        }
7632    }
7633
7634    #[doc(hidden)]
7635    impl crate::RequestBuilder for ListRouteTables {
7636        fn request_options(&mut self) -> &mut crate::RequestOptions {
7637            &mut self.0.options
7638        }
7639    }
7640
7641    /// The request builder for [HubService::get_group][crate::client::HubService::get_group] calls.
7642    ///
7643    /// # Example
7644    /// ```
7645    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::GetGroup;
7646    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
7647    ///
7648    /// let builder = prepare_request_builder();
7649    /// let response = builder.send().await?;
7650    /// # Ok(()) }
7651    ///
7652    /// fn prepare_request_builder() -> GetGroup {
7653    ///   # panic!();
7654    ///   // ... details omitted ...
7655    /// }
7656    /// ```
7657    #[derive(Clone, Debug)]
7658    pub struct GetGroup(RequestBuilder<crate::model::GetGroupRequest>);
7659
7660    impl GetGroup {
7661        pub(crate) fn new(
7662            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7663        ) -> Self {
7664            Self(RequestBuilder::new(stub))
7665        }
7666
7667        /// Sets the full request, replacing any prior values.
7668        pub fn with_request<V: Into<crate::model::GetGroupRequest>>(mut self, v: V) -> Self {
7669            self.0.request = v.into();
7670            self
7671        }
7672
7673        /// Sets all the options, replacing any prior values.
7674        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7675            self.0.options = v.into();
7676            self
7677        }
7678
7679        /// Sends the request.
7680        pub async fn send(self) -> Result<crate::model::Group> {
7681            (*self.0.stub)
7682                .get_group(self.0.request, self.0.options)
7683                .await
7684                .map(crate::Response::into_body)
7685        }
7686
7687        /// Sets the value of [name][crate::model::GetGroupRequest::name].
7688        ///
7689        /// This is a **required** field for requests.
7690        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7691            self.0.request.name = v.into();
7692            self
7693        }
7694    }
7695
7696    #[doc(hidden)]
7697    impl crate::RequestBuilder for GetGroup {
7698        fn request_options(&mut self) -> &mut crate::RequestOptions {
7699            &mut self.0.options
7700        }
7701    }
7702
7703    /// The request builder for [HubService::list_groups][crate::client::HubService::list_groups] calls.
7704    ///
7705    /// # Example
7706    /// ```
7707    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::ListGroups;
7708    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
7709    /// use google_cloud_gax::paginator::ItemPaginator;
7710    ///
7711    /// let builder = prepare_request_builder();
7712    /// let mut items = builder.by_item();
7713    /// while let Some(result) = items.next().await {
7714    ///   let item = result?;
7715    /// }
7716    /// # Ok(()) }
7717    ///
7718    /// fn prepare_request_builder() -> ListGroups {
7719    ///   # panic!();
7720    ///   // ... details omitted ...
7721    /// }
7722    /// ```
7723    #[derive(Clone, Debug)]
7724    pub struct ListGroups(RequestBuilder<crate::model::ListGroupsRequest>);
7725
7726    impl ListGroups {
7727        pub(crate) fn new(
7728            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7729        ) -> Self {
7730            Self(RequestBuilder::new(stub))
7731        }
7732
7733        /// Sets the full request, replacing any prior values.
7734        pub fn with_request<V: Into<crate::model::ListGroupsRequest>>(mut self, v: V) -> Self {
7735            self.0.request = v.into();
7736            self
7737        }
7738
7739        /// Sets all the options, replacing any prior values.
7740        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7741            self.0.options = v.into();
7742            self
7743        }
7744
7745        /// Sends the request.
7746        pub async fn send(self) -> Result<crate::model::ListGroupsResponse> {
7747            (*self.0.stub)
7748                .list_groups(self.0.request, self.0.options)
7749                .await
7750                .map(crate::Response::into_body)
7751        }
7752
7753        /// Streams each page in the collection.
7754        pub fn by_page(
7755            self,
7756        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListGroupsResponse, crate::Error>
7757        {
7758            use std::clone::Clone;
7759            let token = self.0.request.page_token.clone();
7760            let execute = move |token: String| {
7761                let mut builder = self.clone();
7762                builder.0.request = builder.0.request.set_page_token(token);
7763                builder.send()
7764            };
7765            google_cloud_gax::paginator::internal::new_paginator(token, execute)
7766        }
7767
7768        /// Streams each item in the collection.
7769        pub fn by_item(
7770            self,
7771        ) -> impl google_cloud_gax::paginator::ItemPaginator<
7772            crate::model::ListGroupsResponse,
7773            crate::Error,
7774        > {
7775            use google_cloud_gax::paginator::Paginator;
7776            self.by_page().items()
7777        }
7778
7779        /// Sets the value of [parent][crate::model::ListGroupsRequest::parent].
7780        ///
7781        /// This is a **required** field for requests.
7782        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7783            self.0.request.parent = v.into();
7784            self
7785        }
7786
7787        /// Sets the value of [page_size][crate::model::ListGroupsRequest::page_size].
7788        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7789            self.0.request.page_size = v.into();
7790            self
7791        }
7792
7793        /// Sets the value of [page_token][crate::model::ListGroupsRequest::page_token].
7794        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7795            self.0.request.page_token = v.into();
7796            self
7797        }
7798
7799        /// Sets the value of [filter][crate::model::ListGroupsRequest::filter].
7800        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7801            self.0.request.filter = v.into();
7802            self
7803        }
7804
7805        /// Sets the value of [order_by][crate::model::ListGroupsRequest::order_by].
7806        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
7807            self.0.request.order_by = v.into();
7808            self
7809        }
7810    }
7811
7812    #[doc(hidden)]
7813    impl crate::RequestBuilder for ListGroups {
7814        fn request_options(&mut self) -> &mut crate::RequestOptions {
7815            &mut self.0.options
7816        }
7817    }
7818
7819    /// The request builder for [HubService::update_group][crate::client::HubService::update_group] calls.
7820    ///
7821    /// # Example
7822    /// ```
7823    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::UpdateGroup;
7824    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
7825    /// use google_cloud_lro::Poller;
7826    ///
7827    /// let builder = prepare_request_builder();
7828    /// let response = builder.poller().until_done().await?;
7829    /// # Ok(()) }
7830    ///
7831    /// fn prepare_request_builder() -> UpdateGroup {
7832    ///   # panic!();
7833    ///   // ... details omitted ...
7834    /// }
7835    /// ```
7836    #[derive(Clone, Debug)]
7837    pub struct UpdateGroup(RequestBuilder<crate::model::UpdateGroupRequest>);
7838
7839    impl UpdateGroup {
7840        pub(crate) fn new(
7841            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7842        ) -> Self {
7843            Self(RequestBuilder::new(stub))
7844        }
7845
7846        /// Sets the full request, replacing any prior values.
7847        pub fn with_request<V: Into<crate::model::UpdateGroupRequest>>(mut self, v: V) -> Self {
7848            self.0.request = v.into();
7849            self
7850        }
7851
7852        /// Sets all the options, replacing any prior values.
7853        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7854            self.0.options = v.into();
7855            self
7856        }
7857
7858        /// Sends the request.
7859        ///
7860        /// # Long running operations
7861        ///
7862        /// This starts, but does not poll, a longrunning operation. More information
7863        /// on [update_group][crate::client::HubService::update_group].
7864        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7865            (*self.0.stub)
7866                .update_group(self.0.request, self.0.options)
7867                .await
7868                .map(crate::Response::into_body)
7869        }
7870
7871        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_group`.
7872        pub fn poller(
7873            self,
7874        ) -> impl google_cloud_lro::Poller<crate::model::Group, crate::model::OperationMetadata>
7875        {
7876            type Operation = google_cloud_lro::internal::Operation<
7877                crate::model::Group,
7878                crate::model::OperationMetadata,
7879            >;
7880            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7881            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7882
7883            let stub = self.0.stub.clone();
7884            let mut options = self.0.options.clone();
7885            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
7886            let query = move |name| {
7887                let stub = stub.clone();
7888                let options = options.clone();
7889                async {
7890                    let op = GetOperation::new(stub)
7891                        .set_name(name)
7892                        .with_options(options)
7893                        .send()
7894                        .await?;
7895                    Ok(Operation::new(op))
7896                }
7897            };
7898
7899            let start = move || async {
7900                let op = self.send().await?;
7901                Ok(Operation::new(op))
7902            };
7903
7904            google_cloud_lro::internal::new_poller(
7905                polling_error_policy,
7906                polling_backoff_policy,
7907                start,
7908                query,
7909            )
7910        }
7911
7912        /// Sets the value of [update_mask][crate::model::UpdateGroupRequest::update_mask].
7913        pub fn set_update_mask<T>(mut self, v: T) -> Self
7914        where
7915            T: std::convert::Into<wkt::FieldMask>,
7916        {
7917            self.0.request.update_mask = std::option::Option::Some(v.into());
7918            self
7919        }
7920
7921        /// Sets or clears the value of [update_mask][crate::model::UpdateGroupRequest::update_mask].
7922        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7923        where
7924            T: std::convert::Into<wkt::FieldMask>,
7925        {
7926            self.0.request.update_mask = v.map(|x| x.into());
7927            self
7928        }
7929
7930        /// Sets the value of [group][crate::model::UpdateGroupRequest::group].
7931        ///
7932        /// This is a **required** field for requests.
7933        pub fn set_group<T>(mut self, v: T) -> Self
7934        where
7935            T: std::convert::Into<crate::model::Group>,
7936        {
7937            self.0.request.group = std::option::Option::Some(v.into());
7938            self
7939        }
7940
7941        /// Sets or clears the value of [group][crate::model::UpdateGroupRequest::group].
7942        ///
7943        /// This is a **required** field for requests.
7944        pub fn set_or_clear_group<T>(mut self, v: std::option::Option<T>) -> Self
7945        where
7946            T: std::convert::Into<crate::model::Group>,
7947        {
7948            self.0.request.group = v.map(|x| x.into());
7949            self
7950        }
7951
7952        /// Sets the value of [request_id][crate::model::UpdateGroupRequest::request_id].
7953        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
7954            self.0.request.request_id = v.into();
7955            self
7956        }
7957    }
7958
7959    #[doc(hidden)]
7960    impl crate::RequestBuilder for UpdateGroup {
7961        fn request_options(&mut self) -> &mut crate::RequestOptions {
7962            &mut self.0.options
7963        }
7964    }
7965
7966    /// The request builder for [HubService::list_locations][crate::client::HubService::list_locations] calls.
7967    ///
7968    /// # Example
7969    /// ```
7970    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::ListLocations;
7971    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
7972    /// use google_cloud_gax::paginator::ItemPaginator;
7973    ///
7974    /// let builder = prepare_request_builder();
7975    /// let mut items = builder.by_item();
7976    /// while let Some(result) = items.next().await {
7977    ///   let item = result?;
7978    /// }
7979    /// # Ok(()) }
7980    ///
7981    /// fn prepare_request_builder() -> ListLocations {
7982    ///   # panic!();
7983    ///   // ... details omitted ...
7984    /// }
7985    /// ```
7986    #[derive(Clone, Debug)]
7987    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
7988
7989    impl ListLocations {
7990        pub(crate) fn new(
7991            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7992        ) -> Self {
7993            Self(RequestBuilder::new(stub))
7994        }
7995
7996        /// Sets the full request, replacing any prior values.
7997        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
7998            mut self,
7999            v: V,
8000        ) -> Self {
8001            self.0.request = v.into();
8002            self
8003        }
8004
8005        /// Sets all the options, replacing any prior values.
8006        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8007            self.0.options = v.into();
8008            self
8009        }
8010
8011        /// Sends the request.
8012        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
8013            (*self.0.stub)
8014                .list_locations(self.0.request, self.0.options)
8015                .await
8016                .map(crate::Response::into_body)
8017        }
8018
8019        /// Streams each page in the collection.
8020        pub fn by_page(
8021            self,
8022        ) -> impl google_cloud_gax::paginator::Paginator<
8023            google_cloud_location::model::ListLocationsResponse,
8024            crate::Error,
8025        > {
8026            use std::clone::Clone;
8027            let token = self.0.request.page_token.clone();
8028            let execute = move |token: String| {
8029                let mut builder = self.clone();
8030                builder.0.request = builder.0.request.set_page_token(token);
8031                builder.send()
8032            };
8033            google_cloud_gax::paginator::internal::new_paginator(token, execute)
8034        }
8035
8036        /// Streams each item in the collection.
8037        pub fn by_item(
8038            self,
8039        ) -> impl google_cloud_gax::paginator::ItemPaginator<
8040            google_cloud_location::model::ListLocationsResponse,
8041            crate::Error,
8042        > {
8043            use google_cloud_gax::paginator::Paginator;
8044            self.by_page().items()
8045        }
8046
8047        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
8048        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8049            self.0.request.name = v.into();
8050            self
8051        }
8052
8053        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
8054        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8055            self.0.request.filter = v.into();
8056            self
8057        }
8058
8059        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
8060        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8061            self.0.request.page_size = v.into();
8062            self
8063        }
8064
8065        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
8066        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8067            self.0.request.page_token = v.into();
8068            self
8069        }
8070    }
8071
8072    #[doc(hidden)]
8073    impl crate::RequestBuilder for ListLocations {
8074        fn request_options(&mut self) -> &mut crate::RequestOptions {
8075            &mut self.0.options
8076        }
8077    }
8078
8079    /// The request builder for [HubService::get_location][crate::client::HubService::get_location] calls.
8080    ///
8081    /// # Example
8082    /// ```
8083    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::GetLocation;
8084    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
8085    ///
8086    /// let builder = prepare_request_builder();
8087    /// let response = builder.send().await?;
8088    /// # Ok(()) }
8089    ///
8090    /// fn prepare_request_builder() -> GetLocation {
8091    ///   # panic!();
8092    ///   // ... details omitted ...
8093    /// }
8094    /// ```
8095    #[derive(Clone, Debug)]
8096    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
8097
8098    impl GetLocation {
8099        pub(crate) fn new(
8100            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8101        ) -> Self {
8102            Self(RequestBuilder::new(stub))
8103        }
8104
8105        /// Sets the full request, replacing any prior values.
8106        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
8107            mut self,
8108            v: V,
8109        ) -> Self {
8110            self.0.request = v.into();
8111            self
8112        }
8113
8114        /// Sets all the options, replacing any prior values.
8115        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8116            self.0.options = v.into();
8117            self
8118        }
8119
8120        /// Sends the request.
8121        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
8122            (*self.0.stub)
8123                .get_location(self.0.request, self.0.options)
8124                .await
8125                .map(crate::Response::into_body)
8126        }
8127
8128        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
8129        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8130            self.0.request.name = v.into();
8131            self
8132        }
8133    }
8134
8135    #[doc(hidden)]
8136    impl crate::RequestBuilder for GetLocation {
8137        fn request_options(&mut self) -> &mut crate::RequestOptions {
8138            &mut self.0.options
8139        }
8140    }
8141
8142    /// The request builder for [HubService::set_iam_policy][crate::client::HubService::set_iam_policy] calls.
8143    ///
8144    /// # Example
8145    /// ```
8146    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::SetIamPolicy;
8147    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
8148    ///
8149    /// let builder = prepare_request_builder();
8150    /// let response = builder.send().await?;
8151    /// # Ok(()) }
8152    ///
8153    /// fn prepare_request_builder() -> SetIamPolicy {
8154    ///   # panic!();
8155    ///   // ... details omitted ...
8156    /// }
8157    /// ```
8158    #[derive(Clone, Debug)]
8159    pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
8160
8161    impl SetIamPolicy {
8162        pub(crate) fn new(
8163            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8164        ) -> Self {
8165            Self(RequestBuilder::new(stub))
8166        }
8167
8168        /// Sets the full request, replacing any prior values.
8169        pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
8170            mut self,
8171            v: V,
8172        ) -> Self {
8173            self.0.request = v.into();
8174            self
8175        }
8176
8177        /// Sets all the options, replacing any prior values.
8178        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8179            self.0.options = v.into();
8180            self
8181        }
8182
8183        /// Sends the request.
8184        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
8185            (*self.0.stub)
8186                .set_iam_policy(self.0.request, self.0.options)
8187                .await
8188                .map(crate::Response::into_body)
8189        }
8190
8191        /// Sets the value of [resource][google_cloud_iam_v1::model::SetIamPolicyRequest::resource].
8192        ///
8193        /// This is a **required** field for requests.
8194        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
8195            self.0.request.resource = v.into();
8196            self
8197        }
8198
8199        /// Sets the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
8200        ///
8201        /// This is a **required** field for requests.
8202        pub fn set_policy<T>(mut self, v: T) -> Self
8203        where
8204            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
8205        {
8206            self.0.request.policy = std::option::Option::Some(v.into());
8207            self
8208        }
8209
8210        /// Sets or clears the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
8211        ///
8212        /// This is a **required** field for requests.
8213        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
8214        where
8215            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
8216        {
8217            self.0.request.policy = v.map(|x| x.into());
8218            self
8219        }
8220
8221        /// Sets the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
8222        pub fn set_update_mask<T>(mut self, v: T) -> Self
8223        where
8224            T: std::convert::Into<wkt::FieldMask>,
8225        {
8226            self.0.request.update_mask = std::option::Option::Some(v.into());
8227            self
8228        }
8229
8230        /// Sets or clears the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
8231        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
8232        where
8233            T: std::convert::Into<wkt::FieldMask>,
8234        {
8235            self.0.request.update_mask = v.map(|x| x.into());
8236            self
8237        }
8238    }
8239
8240    #[doc(hidden)]
8241    impl crate::RequestBuilder for SetIamPolicy {
8242        fn request_options(&mut self) -> &mut crate::RequestOptions {
8243            &mut self.0.options
8244        }
8245    }
8246
8247    /// The request builder for [HubService::get_iam_policy][crate::client::HubService::get_iam_policy] calls.
8248    ///
8249    /// # Example
8250    /// ```
8251    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::GetIamPolicy;
8252    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
8253    ///
8254    /// let builder = prepare_request_builder();
8255    /// let response = builder.send().await?;
8256    /// # Ok(()) }
8257    ///
8258    /// fn prepare_request_builder() -> GetIamPolicy {
8259    ///   # panic!();
8260    ///   // ... details omitted ...
8261    /// }
8262    /// ```
8263    #[derive(Clone, Debug)]
8264    pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
8265
8266    impl GetIamPolicy {
8267        pub(crate) fn new(
8268            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8269        ) -> Self {
8270            Self(RequestBuilder::new(stub))
8271        }
8272
8273        /// Sets the full request, replacing any prior values.
8274        pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
8275            mut self,
8276            v: V,
8277        ) -> Self {
8278            self.0.request = v.into();
8279            self
8280        }
8281
8282        /// Sets all the options, replacing any prior values.
8283        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8284            self.0.options = v.into();
8285            self
8286        }
8287
8288        /// Sends the request.
8289        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
8290            (*self.0.stub)
8291                .get_iam_policy(self.0.request, self.0.options)
8292                .await
8293                .map(crate::Response::into_body)
8294        }
8295
8296        /// Sets the value of [resource][google_cloud_iam_v1::model::GetIamPolicyRequest::resource].
8297        ///
8298        /// This is a **required** field for requests.
8299        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
8300            self.0.request.resource = v.into();
8301            self
8302        }
8303
8304        /// Sets the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
8305        pub fn set_options<T>(mut self, v: T) -> Self
8306        where
8307            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
8308        {
8309            self.0.request.options = std::option::Option::Some(v.into());
8310            self
8311        }
8312
8313        /// Sets or clears the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
8314        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
8315        where
8316            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
8317        {
8318            self.0.request.options = v.map(|x| x.into());
8319            self
8320        }
8321    }
8322
8323    #[doc(hidden)]
8324    impl crate::RequestBuilder for GetIamPolicy {
8325        fn request_options(&mut self) -> &mut crate::RequestOptions {
8326            &mut self.0.options
8327        }
8328    }
8329
8330    /// The request builder for [HubService::test_iam_permissions][crate::client::HubService::test_iam_permissions] calls.
8331    ///
8332    /// # Example
8333    /// ```
8334    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::TestIamPermissions;
8335    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
8336    ///
8337    /// let builder = prepare_request_builder();
8338    /// let response = builder.send().await?;
8339    /// # Ok(()) }
8340    ///
8341    /// fn prepare_request_builder() -> TestIamPermissions {
8342    ///   # panic!();
8343    ///   // ... details omitted ...
8344    /// }
8345    /// ```
8346    #[derive(Clone, Debug)]
8347    pub struct TestIamPermissions(
8348        RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
8349    );
8350
8351    impl TestIamPermissions {
8352        pub(crate) fn new(
8353            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8354        ) -> Self {
8355            Self(RequestBuilder::new(stub))
8356        }
8357
8358        /// Sets the full request, replacing any prior values.
8359        pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
8360            mut self,
8361            v: V,
8362        ) -> Self {
8363            self.0.request = v.into();
8364            self
8365        }
8366
8367        /// Sets all the options, replacing any prior values.
8368        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8369            self.0.options = v.into();
8370            self
8371        }
8372
8373        /// Sends the request.
8374        pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
8375            (*self.0.stub)
8376                .test_iam_permissions(self.0.request, self.0.options)
8377                .await
8378                .map(crate::Response::into_body)
8379        }
8380
8381        /// Sets the value of [resource][google_cloud_iam_v1::model::TestIamPermissionsRequest::resource].
8382        ///
8383        /// This is a **required** field for requests.
8384        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
8385            self.0.request.resource = v.into();
8386            self
8387        }
8388
8389        /// Sets the value of [permissions][google_cloud_iam_v1::model::TestIamPermissionsRequest::permissions].
8390        ///
8391        /// This is a **required** field for requests.
8392        pub fn set_permissions<T, V>(mut self, v: T) -> Self
8393        where
8394            T: std::iter::IntoIterator<Item = V>,
8395            V: std::convert::Into<std::string::String>,
8396        {
8397            use std::iter::Iterator;
8398            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
8399            self
8400        }
8401    }
8402
8403    #[doc(hidden)]
8404    impl crate::RequestBuilder for TestIamPermissions {
8405        fn request_options(&mut self) -> &mut crate::RequestOptions {
8406            &mut self.0.options
8407        }
8408    }
8409
8410    /// The request builder for [HubService::list_operations][crate::client::HubService::list_operations] calls.
8411    ///
8412    /// # Example
8413    /// ```
8414    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::ListOperations;
8415    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
8416    /// use google_cloud_gax::paginator::ItemPaginator;
8417    ///
8418    /// let builder = prepare_request_builder();
8419    /// let mut items = builder.by_item();
8420    /// while let Some(result) = items.next().await {
8421    ///   let item = result?;
8422    /// }
8423    /// # Ok(()) }
8424    ///
8425    /// fn prepare_request_builder() -> ListOperations {
8426    ///   # panic!();
8427    ///   // ... details omitted ...
8428    /// }
8429    /// ```
8430    #[derive(Clone, Debug)]
8431    pub struct ListOperations(
8432        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
8433    );
8434
8435    impl ListOperations {
8436        pub(crate) fn new(
8437            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8438        ) -> Self {
8439            Self(RequestBuilder::new(stub))
8440        }
8441
8442        /// Sets the full request, replacing any prior values.
8443        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
8444            mut self,
8445            v: V,
8446        ) -> Self {
8447            self.0.request = v.into();
8448            self
8449        }
8450
8451        /// Sets all the options, replacing any prior values.
8452        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8453            self.0.options = v.into();
8454            self
8455        }
8456
8457        /// Sends the request.
8458        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
8459            (*self.0.stub)
8460                .list_operations(self.0.request, self.0.options)
8461                .await
8462                .map(crate::Response::into_body)
8463        }
8464
8465        /// Streams each page in the collection.
8466        pub fn by_page(
8467            self,
8468        ) -> impl google_cloud_gax::paginator::Paginator<
8469            google_cloud_longrunning::model::ListOperationsResponse,
8470            crate::Error,
8471        > {
8472            use std::clone::Clone;
8473            let token = self.0.request.page_token.clone();
8474            let execute = move |token: String| {
8475                let mut builder = self.clone();
8476                builder.0.request = builder.0.request.set_page_token(token);
8477                builder.send()
8478            };
8479            google_cloud_gax::paginator::internal::new_paginator(token, execute)
8480        }
8481
8482        /// Streams each item in the collection.
8483        pub fn by_item(
8484            self,
8485        ) -> impl google_cloud_gax::paginator::ItemPaginator<
8486            google_cloud_longrunning::model::ListOperationsResponse,
8487            crate::Error,
8488        > {
8489            use google_cloud_gax::paginator::Paginator;
8490            self.by_page().items()
8491        }
8492
8493        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
8494        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8495            self.0.request.name = v.into();
8496            self
8497        }
8498
8499        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
8500        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8501            self.0.request.filter = v.into();
8502            self
8503        }
8504
8505        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
8506        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8507            self.0.request.page_size = v.into();
8508            self
8509        }
8510
8511        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
8512        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8513            self.0.request.page_token = v.into();
8514            self
8515        }
8516
8517        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
8518        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
8519            self.0.request.return_partial_success = v.into();
8520            self
8521        }
8522    }
8523
8524    #[doc(hidden)]
8525    impl crate::RequestBuilder for ListOperations {
8526        fn request_options(&mut self) -> &mut crate::RequestOptions {
8527            &mut self.0.options
8528        }
8529    }
8530
8531    /// The request builder for [HubService::get_operation][crate::client::HubService::get_operation] calls.
8532    ///
8533    /// # Example
8534    /// ```
8535    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::GetOperation;
8536    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
8537    ///
8538    /// let builder = prepare_request_builder();
8539    /// let response = builder.send().await?;
8540    /// # Ok(()) }
8541    ///
8542    /// fn prepare_request_builder() -> GetOperation {
8543    ///   # panic!();
8544    ///   // ... details omitted ...
8545    /// }
8546    /// ```
8547    #[derive(Clone, Debug)]
8548    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
8549
8550    impl GetOperation {
8551        pub(crate) fn new(
8552            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8553        ) -> Self {
8554            Self(RequestBuilder::new(stub))
8555        }
8556
8557        /// Sets the full request, replacing any prior values.
8558        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
8559            mut self,
8560            v: V,
8561        ) -> Self {
8562            self.0.request = v.into();
8563            self
8564        }
8565
8566        /// Sets all the options, replacing any prior values.
8567        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8568            self.0.options = v.into();
8569            self
8570        }
8571
8572        /// Sends the request.
8573        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8574            (*self.0.stub)
8575                .get_operation(self.0.request, self.0.options)
8576                .await
8577                .map(crate::Response::into_body)
8578        }
8579
8580        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
8581        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8582            self.0.request.name = v.into();
8583            self
8584        }
8585    }
8586
8587    #[doc(hidden)]
8588    impl crate::RequestBuilder for GetOperation {
8589        fn request_options(&mut self) -> &mut crate::RequestOptions {
8590            &mut self.0.options
8591        }
8592    }
8593
8594    /// The request builder for [HubService::delete_operation][crate::client::HubService::delete_operation] calls.
8595    ///
8596    /// # Example
8597    /// ```
8598    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::DeleteOperation;
8599    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
8600    ///
8601    /// let builder = prepare_request_builder();
8602    /// let response = builder.send().await?;
8603    /// # Ok(()) }
8604    ///
8605    /// fn prepare_request_builder() -> DeleteOperation {
8606    ///   # panic!();
8607    ///   // ... details omitted ...
8608    /// }
8609    /// ```
8610    #[derive(Clone, Debug)]
8611    pub struct DeleteOperation(
8612        RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
8613    );
8614
8615    impl DeleteOperation {
8616        pub(crate) fn new(
8617            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8618        ) -> Self {
8619            Self(RequestBuilder::new(stub))
8620        }
8621
8622        /// Sets the full request, replacing any prior values.
8623        pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
8624            mut self,
8625            v: V,
8626        ) -> Self {
8627            self.0.request = v.into();
8628            self
8629        }
8630
8631        /// Sets all the options, replacing any prior values.
8632        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8633            self.0.options = v.into();
8634            self
8635        }
8636
8637        /// Sends the request.
8638        pub async fn send(self) -> Result<()> {
8639            (*self.0.stub)
8640                .delete_operation(self.0.request, self.0.options)
8641                .await
8642                .map(crate::Response::into_body)
8643        }
8644
8645        /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
8646        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8647            self.0.request.name = v.into();
8648            self
8649        }
8650    }
8651
8652    #[doc(hidden)]
8653    impl crate::RequestBuilder for DeleteOperation {
8654        fn request_options(&mut self) -> &mut crate::RequestOptions {
8655            &mut self.0.options
8656        }
8657    }
8658
8659    /// The request builder for [HubService::cancel_operation][crate::client::HubService::cancel_operation] calls.
8660    ///
8661    /// # Example
8662    /// ```
8663    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::CancelOperation;
8664    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
8665    ///
8666    /// let builder = prepare_request_builder();
8667    /// let response = builder.send().await?;
8668    /// # Ok(()) }
8669    ///
8670    /// fn prepare_request_builder() -> CancelOperation {
8671    ///   # panic!();
8672    ///   // ... details omitted ...
8673    /// }
8674    /// ```
8675    #[derive(Clone, Debug)]
8676    pub struct CancelOperation(
8677        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
8678    );
8679
8680    impl CancelOperation {
8681        pub(crate) fn new(
8682            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8683        ) -> Self {
8684            Self(RequestBuilder::new(stub))
8685        }
8686
8687        /// Sets the full request, replacing any prior values.
8688        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
8689            mut self,
8690            v: V,
8691        ) -> Self {
8692            self.0.request = v.into();
8693            self
8694        }
8695
8696        /// Sets all the options, replacing any prior values.
8697        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8698            self.0.options = v.into();
8699            self
8700        }
8701
8702        /// Sends the request.
8703        pub async fn send(self) -> Result<()> {
8704            (*self.0.stub)
8705                .cancel_operation(self.0.request, self.0.options)
8706                .await
8707                .map(crate::Response::into_body)
8708        }
8709
8710        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
8711        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8712            self.0.request.name = v.into();
8713            self
8714        }
8715    }
8716
8717    #[doc(hidden)]
8718    impl crate::RequestBuilder for CancelOperation {
8719        fn request_options(&mut self) -> &mut crate::RequestOptions {
8720            &mut self.0.options
8721        }
8722    }
8723}
8724
8725/// Request and client builders for [InternalRangeService][crate::client::InternalRangeService].
8726pub mod internal_range_service {
8727    use crate::Result;
8728
8729    /// A builder for [InternalRangeService][crate::client::InternalRangeService].
8730    ///
8731    /// ```
8732    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
8733    /// # use google_cloud_networkconnectivity_v1::*;
8734    /// # use builder::internal_range_service::ClientBuilder;
8735    /// # use client::InternalRangeService;
8736    /// let builder : ClientBuilder = InternalRangeService::builder();
8737    /// let client = builder
8738    ///     .with_endpoint("https://networkconnectivity.googleapis.com")
8739    ///     .build().await?;
8740    /// # Ok(()) }
8741    /// ```
8742    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
8743
8744    pub(crate) mod client {
8745        use super::super::super::client::InternalRangeService;
8746        pub struct Factory;
8747        impl crate::ClientFactory for Factory {
8748            type Client = InternalRangeService;
8749            type Credentials = gaxi::options::Credentials;
8750            async fn build(
8751                self,
8752                config: gaxi::options::ClientConfig,
8753            ) -> crate::ClientBuilderResult<Self::Client> {
8754                Self::Client::new(config).await
8755            }
8756        }
8757    }
8758
8759    /// Common implementation for [crate::client::InternalRangeService] request builders.
8760    #[derive(Clone, Debug)]
8761    pub(crate) struct RequestBuilder<R: std::default::Default> {
8762        stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
8763        request: R,
8764        options: crate::RequestOptions,
8765    }
8766
8767    impl<R> RequestBuilder<R>
8768    where
8769        R: std::default::Default,
8770    {
8771        pub(crate) fn new(
8772            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
8773        ) -> Self {
8774            Self {
8775                stub,
8776                request: R::default(),
8777                options: crate::RequestOptions::default(),
8778            }
8779        }
8780    }
8781
8782    /// The request builder for [InternalRangeService::list_internal_ranges][crate::client::InternalRangeService::list_internal_ranges] calls.
8783    ///
8784    /// # Example
8785    /// ```
8786    /// # use google_cloud_networkconnectivity_v1::builder::internal_range_service::ListInternalRanges;
8787    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
8788    /// use google_cloud_gax::paginator::ItemPaginator;
8789    ///
8790    /// let builder = prepare_request_builder();
8791    /// let mut items = builder.by_item();
8792    /// while let Some(result) = items.next().await {
8793    ///   let item = result?;
8794    /// }
8795    /// # Ok(()) }
8796    ///
8797    /// fn prepare_request_builder() -> ListInternalRanges {
8798    ///   # panic!();
8799    ///   // ... details omitted ...
8800    /// }
8801    /// ```
8802    #[derive(Clone, Debug)]
8803    pub struct ListInternalRanges(RequestBuilder<crate::model::ListInternalRangesRequest>);
8804
8805    impl ListInternalRanges {
8806        pub(crate) fn new(
8807            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
8808        ) -> Self {
8809            Self(RequestBuilder::new(stub))
8810        }
8811
8812        /// Sets the full request, replacing any prior values.
8813        pub fn with_request<V: Into<crate::model::ListInternalRangesRequest>>(
8814            mut self,
8815            v: V,
8816        ) -> Self {
8817            self.0.request = v.into();
8818            self
8819        }
8820
8821        /// Sets all the options, replacing any prior values.
8822        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8823            self.0.options = v.into();
8824            self
8825        }
8826
8827        /// Sends the request.
8828        pub async fn send(self) -> Result<crate::model::ListInternalRangesResponse> {
8829            (*self.0.stub)
8830                .list_internal_ranges(self.0.request, self.0.options)
8831                .await
8832                .map(crate::Response::into_body)
8833        }
8834
8835        /// Streams each page in the collection.
8836        pub fn by_page(
8837            self,
8838        ) -> impl google_cloud_gax::paginator::Paginator<
8839            crate::model::ListInternalRangesResponse,
8840            crate::Error,
8841        > {
8842            use std::clone::Clone;
8843            let token = self.0.request.page_token.clone();
8844            let execute = move |token: String| {
8845                let mut builder = self.clone();
8846                builder.0.request = builder.0.request.set_page_token(token);
8847                builder.send()
8848            };
8849            google_cloud_gax::paginator::internal::new_paginator(token, execute)
8850        }
8851
8852        /// Streams each item in the collection.
8853        pub fn by_item(
8854            self,
8855        ) -> impl google_cloud_gax::paginator::ItemPaginator<
8856            crate::model::ListInternalRangesResponse,
8857            crate::Error,
8858        > {
8859            use google_cloud_gax::paginator::Paginator;
8860            self.by_page().items()
8861        }
8862
8863        /// Sets the value of [parent][crate::model::ListInternalRangesRequest::parent].
8864        ///
8865        /// This is a **required** field for requests.
8866        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
8867            self.0.request.parent = v.into();
8868            self
8869        }
8870
8871        /// Sets the value of [page_size][crate::model::ListInternalRangesRequest::page_size].
8872        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8873            self.0.request.page_size = v.into();
8874            self
8875        }
8876
8877        /// Sets the value of [page_token][crate::model::ListInternalRangesRequest::page_token].
8878        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8879            self.0.request.page_token = v.into();
8880            self
8881        }
8882
8883        /// Sets the value of [filter][crate::model::ListInternalRangesRequest::filter].
8884        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8885            self.0.request.filter = v.into();
8886            self
8887        }
8888
8889        /// Sets the value of [order_by][crate::model::ListInternalRangesRequest::order_by].
8890        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
8891            self.0.request.order_by = v.into();
8892            self
8893        }
8894    }
8895
8896    #[doc(hidden)]
8897    impl crate::RequestBuilder for ListInternalRanges {
8898        fn request_options(&mut self) -> &mut crate::RequestOptions {
8899            &mut self.0.options
8900        }
8901    }
8902
8903    /// The request builder for [InternalRangeService::get_internal_range][crate::client::InternalRangeService::get_internal_range] calls.
8904    ///
8905    /// # Example
8906    /// ```
8907    /// # use google_cloud_networkconnectivity_v1::builder::internal_range_service::GetInternalRange;
8908    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
8909    ///
8910    /// let builder = prepare_request_builder();
8911    /// let response = builder.send().await?;
8912    /// # Ok(()) }
8913    ///
8914    /// fn prepare_request_builder() -> GetInternalRange {
8915    ///   # panic!();
8916    ///   // ... details omitted ...
8917    /// }
8918    /// ```
8919    #[derive(Clone, Debug)]
8920    pub struct GetInternalRange(RequestBuilder<crate::model::GetInternalRangeRequest>);
8921
8922    impl GetInternalRange {
8923        pub(crate) fn new(
8924            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
8925        ) -> Self {
8926            Self(RequestBuilder::new(stub))
8927        }
8928
8929        /// Sets the full request, replacing any prior values.
8930        pub fn with_request<V: Into<crate::model::GetInternalRangeRequest>>(
8931            mut self,
8932            v: V,
8933        ) -> Self {
8934            self.0.request = v.into();
8935            self
8936        }
8937
8938        /// Sets all the options, replacing any prior values.
8939        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8940            self.0.options = v.into();
8941            self
8942        }
8943
8944        /// Sends the request.
8945        pub async fn send(self) -> Result<crate::model::InternalRange> {
8946            (*self.0.stub)
8947                .get_internal_range(self.0.request, self.0.options)
8948                .await
8949                .map(crate::Response::into_body)
8950        }
8951
8952        /// Sets the value of [name][crate::model::GetInternalRangeRequest::name].
8953        ///
8954        /// This is a **required** field for requests.
8955        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8956            self.0.request.name = v.into();
8957            self
8958        }
8959    }
8960
8961    #[doc(hidden)]
8962    impl crate::RequestBuilder for GetInternalRange {
8963        fn request_options(&mut self) -> &mut crate::RequestOptions {
8964            &mut self.0.options
8965        }
8966    }
8967
8968    /// The request builder for [InternalRangeService::create_internal_range][crate::client::InternalRangeService::create_internal_range] calls.
8969    ///
8970    /// # Example
8971    /// ```
8972    /// # use google_cloud_networkconnectivity_v1::builder::internal_range_service::CreateInternalRange;
8973    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
8974    /// use google_cloud_lro::Poller;
8975    ///
8976    /// let builder = prepare_request_builder();
8977    /// let response = builder.poller().until_done().await?;
8978    /// # Ok(()) }
8979    ///
8980    /// fn prepare_request_builder() -> CreateInternalRange {
8981    ///   # panic!();
8982    ///   // ... details omitted ...
8983    /// }
8984    /// ```
8985    #[derive(Clone, Debug)]
8986    pub struct CreateInternalRange(RequestBuilder<crate::model::CreateInternalRangeRequest>);
8987
8988    impl CreateInternalRange {
8989        pub(crate) fn new(
8990            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
8991        ) -> Self {
8992            Self(RequestBuilder::new(stub))
8993        }
8994
8995        /// Sets the full request, replacing any prior values.
8996        pub fn with_request<V: Into<crate::model::CreateInternalRangeRequest>>(
8997            mut self,
8998            v: V,
8999        ) -> Self {
9000            self.0.request = v.into();
9001            self
9002        }
9003
9004        /// Sets all the options, replacing any prior values.
9005        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9006            self.0.options = v.into();
9007            self
9008        }
9009
9010        /// Sends the request.
9011        ///
9012        /// # Long running operations
9013        ///
9014        /// This starts, but does not poll, a longrunning operation. More information
9015        /// on [create_internal_range][crate::client::InternalRangeService::create_internal_range].
9016        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9017            (*self.0.stub)
9018                .create_internal_range(self.0.request, self.0.options)
9019                .await
9020                .map(crate::Response::into_body)
9021        }
9022
9023        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_internal_range`.
9024        pub fn poller(
9025            self,
9026        ) -> impl google_cloud_lro::Poller<crate::model::InternalRange, crate::model::OperationMetadata>
9027        {
9028            type Operation = google_cloud_lro::internal::Operation<
9029                crate::model::InternalRange,
9030                crate::model::OperationMetadata,
9031            >;
9032            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9033            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9034
9035            let stub = self.0.stub.clone();
9036            let mut options = self.0.options.clone();
9037            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
9038            let query = move |name| {
9039                let stub = stub.clone();
9040                let options = options.clone();
9041                async {
9042                    let op = GetOperation::new(stub)
9043                        .set_name(name)
9044                        .with_options(options)
9045                        .send()
9046                        .await?;
9047                    Ok(Operation::new(op))
9048                }
9049            };
9050
9051            let start = move || async {
9052                let op = self.send().await?;
9053                Ok(Operation::new(op))
9054            };
9055
9056            google_cloud_lro::internal::new_poller(
9057                polling_error_policy,
9058                polling_backoff_policy,
9059                start,
9060                query,
9061            )
9062        }
9063
9064        /// Sets the value of [parent][crate::model::CreateInternalRangeRequest::parent].
9065        ///
9066        /// This is a **required** field for requests.
9067        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
9068            self.0.request.parent = v.into();
9069            self
9070        }
9071
9072        /// Sets the value of [internal_range_id][crate::model::CreateInternalRangeRequest::internal_range_id].
9073        pub fn set_internal_range_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9074            self.0.request.internal_range_id = v.into();
9075            self
9076        }
9077
9078        /// Sets the value of [internal_range][crate::model::CreateInternalRangeRequest::internal_range].
9079        ///
9080        /// This is a **required** field for requests.
9081        pub fn set_internal_range<T>(mut self, v: T) -> Self
9082        where
9083            T: std::convert::Into<crate::model::InternalRange>,
9084        {
9085            self.0.request.internal_range = std::option::Option::Some(v.into());
9086            self
9087        }
9088
9089        /// Sets or clears the value of [internal_range][crate::model::CreateInternalRangeRequest::internal_range].
9090        ///
9091        /// This is a **required** field for requests.
9092        pub fn set_or_clear_internal_range<T>(mut self, v: std::option::Option<T>) -> Self
9093        where
9094            T: std::convert::Into<crate::model::InternalRange>,
9095        {
9096            self.0.request.internal_range = v.map(|x| x.into());
9097            self
9098        }
9099
9100        /// Sets the value of [request_id][crate::model::CreateInternalRangeRequest::request_id].
9101        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9102            self.0.request.request_id = v.into();
9103            self
9104        }
9105    }
9106
9107    #[doc(hidden)]
9108    impl crate::RequestBuilder for CreateInternalRange {
9109        fn request_options(&mut self) -> &mut crate::RequestOptions {
9110            &mut self.0.options
9111        }
9112    }
9113
9114    /// The request builder for [InternalRangeService::update_internal_range][crate::client::InternalRangeService::update_internal_range] calls.
9115    ///
9116    /// # Example
9117    /// ```
9118    /// # use google_cloud_networkconnectivity_v1::builder::internal_range_service::UpdateInternalRange;
9119    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
9120    /// use google_cloud_lro::Poller;
9121    ///
9122    /// let builder = prepare_request_builder();
9123    /// let response = builder.poller().until_done().await?;
9124    /// # Ok(()) }
9125    ///
9126    /// fn prepare_request_builder() -> UpdateInternalRange {
9127    ///   # panic!();
9128    ///   // ... details omitted ...
9129    /// }
9130    /// ```
9131    #[derive(Clone, Debug)]
9132    pub struct UpdateInternalRange(RequestBuilder<crate::model::UpdateInternalRangeRequest>);
9133
9134    impl UpdateInternalRange {
9135        pub(crate) fn new(
9136            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9137        ) -> Self {
9138            Self(RequestBuilder::new(stub))
9139        }
9140
9141        /// Sets the full request, replacing any prior values.
9142        pub fn with_request<V: Into<crate::model::UpdateInternalRangeRequest>>(
9143            mut self,
9144            v: V,
9145        ) -> Self {
9146            self.0.request = v.into();
9147            self
9148        }
9149
9150        /// Sets all the options, replacing any prior values.
9151        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9152            self.0.options = v.into();
9153            self
9154        }
9155
9156        /// Sends the request.
9157        ///
9158        /// # Long running operations
9159        ///
9160        /// This starts, but does not poll, a longrunning operation. More information
9161        /// on [update_internal_range][crate::client::InternalRangeService::update_internal_range].
9162        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9163            (*self.0.stub)
9164                .update_internal_range(self.0.request, self.0.options)
9165                .await
9166                .map(crate::Response::into_body)
9167        }
9168
9169        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_internal_range`.
9170        pub fn poller(
9171            self,
9172        ) -> impl google_cloud_lro::Poller<crate::model::InternalRange, crate::model::OperationMetadata>
9173        {
9174            type Operation = google_cloud_lro::internal::Operation<
9175                crate::model::InternalRange,
9176                crate::model::OperationMetadata,
9177            >;
9178            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9179            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9180
9181            let stub = self.0.stub.clone();
9182            let mut options = self.0.options.clone();
9183            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
9184            let query = move |name| {
9185                let stub = stub.clone();
9186                let options = options.clone();
9187                async {
9188                    let op = GetOperation::new(stub)
9189                        .set_name(name)
9190                        .with_options(options)
9191                        .send()
9192                        .await?;
9193                    Ok(Operation::new(op))
9194                }
9195            };
9196
9197            let start = move || async {
9198                let op = self.send().await?;
9199                Ok(Operation::new(op))
9200            };
9201
9202            google_cloud_lro::internal::new_poller(
9203                polling_error_policy,
9204                polling_backoff_policy,
9205                start,
9206                query,
9207            )
9208        }
9209
9210        /// Sets the value of [update_mask][crate::model::UpdateInternalRangeRequest::update_mask].
9211        pub fn set_update_mask<T>(mut self, v: T) -> Self
9212        where
9213            T: std::convert::Into<wkt::FieldMask>,
9214        {
9215            self.0.request.update_mask = std::option::Option::Some(v.into());
9216            self
9217        }
9218
9219        /// Sets or clears the value of [update_mask][crate::model::UpdateInternalRangeRequest::update_mask].
9220        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
9221        where
9222            T: std::convert::Into<wkt::FieldMask>,
9223        {
9224            self.0.request.update_mask = v.map(|x| x.into());
9225            self
9226        }
9227
9228        /// Sets the value of [internal_range][crate::model::UpdateInternalRangeRequest::internal_range].
9229        ///
9230        /// This is a **required** field for requests.
9231        pub fn set_internal_range<T>(mut self, v: T) -> Self
9232        where
9233            T: std::convert::Into<crate::model::InternalRange>,
9234        {
9235            self.0.request.internal_range = std::option::Option::Some(v.into());
9236            self
9237        }
9238
9239        /// Sets or clears the value of [internal_range][crate::model::UpdateInternalRangeRequest::internal_range].
9240        ///
9241        /// This is a **required** field for requests.
9242        pub fn set_or_clear_internal_range<T>(mut self, v: std::option::Option<T>) -> Self
9243        where
9244            T: std::convert::Into<crate::model::InternalRange>,
9245        {
9246            self.0.request.internal_range = v.map(|x| x.into());
9247            self
9248        }
9249
9250        /// Sets the value of [request_id][crate::model::UpdateInternalRangeRequest::request_id].
9251        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9252            self.0.request.request_id = v.into();
9253            self
9254        }
9255    }
9256
9257    #[doc(hidden)]
9258    impl crate::RequestBuilder for UpdateInternalRange {
9259        fn request_options(&mut self) -> &mut crate::RequestOptions {
9260            &mut self.0.options
9261        }
9262    }
9263
9264    /// The request builder for [InternalRangeService::delete_internal_range][crate::client::InternalRangeService::delete_internal_range] calls.
9265    ///
9266    /// # Example
9267    /// ```
9268    /// # use google_cloud_networkconnectivity_v1::builder::internal_range_service::DeleteInternalRange;
9269    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
9270    /// use google_cloud_lro::Poller;
9271    ///
9272    /// let builder = prepare_request_builder();
9273    /// let response = builder.poller().until_done().await?;
9274    /// # Ok(()) }
9275    ///
9276    /// fn prepare_request_builder() -> DeleteInternalRange {
9277    ///   # panic!();
9278    ///   // ... details omitted ...
9279    /// }
9280    /// ```
9281    #[derive(Clone, Debug)]
9282    pub struct DeleteInternalRange(RequestBuilder<crate::model::DeleteInternalRangeRequest>);
9283
9284    impl DeleteInternalRange {
9285        pub(crate) fn new(
9286            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9287        ) -> Self {
9288            Self(RequestBuilder::new(stub))
9289        }
9290
9291        /// Sets the full request, replacing any prior values.
9292        pub fn with_request<V: Into<crate::model::DeleteInternalRangeRequest>>(
9293            mut self,
9294            v: V,
9295        ) -> Self {
9296            self.0.request = v.into();
9297            self
9298        }
9299
9300        /// Sets all the options, replacing any prior values.
9301        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9302            self.0.options = v.into();
9303            self
9304        }
9305
9306        /// Sends the request.
9307        ///
9308        /// # Long running operations
9309        ///
9310        /// This starts, but does not poll, a longrunning operation. More information
9311        /// on [delete_internal_range][crate::client::InternalRangeService::delete_internal_range].
9312        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9313            (*self.0.stub)
9314                .delete_internal_range(self.0.request, self.0.options)
9315                .await
9316                .map(crate::Response::into_body)
9317        }
9318
9319        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_internal_range`.
9320        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
9321            type Operation =
9322                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
9323            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9324            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9325
9326            let stub = self.0.stub.clone();
9327            let mut options = self.0.options.clone();
9328            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
9329            let query = move |name| {
9330                let stub = stub.clone();
9331                let options = options.clone();
9332                async {
9333                    let op = GetOperation::new(stub)
9334                        .set_name(name)
9335                        .with_options(options)
9336                        .send()
9337                        .await?;
9338                    Ok(Operation::new(op))
9339                }
9340            };
9341
9342            let start = move || async {
9343                let op = self.send().await?;
9344                Ok(Operation::new(op))
9345            };
9346
9347            google_cloud_lro::internal::new_unit_response_poller(
9348                polling_error_policy,
9349                polling_backoff_policy,
9350                start,
9351                query,
9352            )
9353        }
9354
9355        /// Sets the value of [name][crate::model::DeleteInternalRangeRequest::name].
9356        ///
9357        /// This is a **required** field for requests.
9358        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9359            self.0.request.name = v.into();
9360            self
9361        }
9362
9363        /// Sets the value of [request_id][crate::model::DeleteInternalRangeRequest::request_id].
9364        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9365            self.0.request.request_id = v.into();
9366            self
9367        }
9368    }
9369
9370    #[doc(hidden)]
9371    impl crate::RequestBuilder for DeleteInternalRange {
9372        fn request_options(&mut self) -> &mut crate::RequestOptions {
9373            &mut self.0.options
9374        }
9375    }
9376
9377    /// The request builder for [InternalRangeService::list_locations][crate::client::InternalRangeService::list_locations] calls.
9378    ///
9379    /// # Example
9380    /// ```
9381    /// # use google_cloud_networkconnectivity_v1::builder::internal_range_service::ListLocations;
9382    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
9383    /// use google_cloud_gax::paginator::ItemPaginator;
9384    ///
9385    /// let builder = prepare_request_builder();
9386    /// let mut items = builder.by_item();
9387    /// while let Some(result) = items.next().await {
9388    ///   let item = result?;
9389    /// }
9390    /// # Ok(()) }
9391    ///
9392    /// fn prepare_request_builder() -> ListLocations {
9393    ///   # panic!();
9394    ///   // ... details omitted ...
9395    /// }
9396    /// ```
9397    #[derive(Clone, Debug)]
9398    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
9399
9400    impl ListLocations {
9401        pub(crate) fn new(
9402            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9403        ) -> Self {
9404            Self(RequestBuilder::new(stub))
9405        }
9406
9407        /// Sets the full request, replacing any prior values.
9408        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
9409            mut self,
9410            v: V,
9411        ) -> Self {
9412            self.0.request = v.into();
9413            self
9414        }
9415
9416        /// Sets all the options, replacing any prior values.
9417        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9418            self.0.options = v.into();
9419            self
9420        }
9421
9422        /// Sends the request.
9423        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
9424            (*self.0.stub)
9425                .list_locations(self.0.request, self.0.options)
9426                .await
9427                .map(crate::Response::into_body)
9428        }
9429
9430        /// Streams each page in the collection.
9431        pub fn by_page(
9432            self,
9433        ) -> impl google_cloud_gax::paginator::Paginator<
9434            google_cloud_location::model::ListLocationsResponse,
9435            crate::Error,
9436        > {
9437            use std::clone::Clone;
9438            let token = self.0.request.page_token.clone();
9439            let execute = move |token: String| {
9440                let mut builder = self.clone();
9441                builder.0.request = builder.0.request.set_page_token(token);
9442                builder.send()
9443            };
9444            google_cloud_gax::paginator::internal::new_paginator(token, execute)
9445        }
9446
9447        /// Streams each item in the collection.
9448        pub fn by_item(
9449            self,
9450        ) -> impl google_cloud_gax::paginator::ItemPaginator<
9451            google_cloud_location::model::ListLocationsResponse,
9452            crate::Error,
9453        > {
9454            use google_cloud_gax::paginator::Paginator;
9455            self.by_page().items()
9456        }
9457
9458        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
9459        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9460            self.0.request.name = v.into();
9461            self
9462        }
9463
9464        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
9465        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
9466            self.0.request.filter = v.into();
9467            self
9468        }
9469
9470        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
9471        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
9472            self.0.request.page_size = v.into();
9473            self
9474        }
9475
9476        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
9477        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
9478            self.0.request.page_token = v.into();
9479            self
9480        }
9481    }
9482
9483    #[doc(hidden)]
9484    impl crate::RequestBuilder for ListLocations {
9485        fn request_options(&mut self) -> &mut crate::RequestOptions {
9486            &mut self.0.options
9487        }
9488    }
9489
9490    /// The request builder for [InternalRangeService::get_location][crate::client::InternalRangeService::get_location] calls.
9491    ///
9492    /// # Example
9493    /// ```
9494    /// # use google_cloud_networkconnectivity_v1::builder::internal_range_service::GetLocation;
9495    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
9496    ///
9497    /// let builder = prepare_request_builder();
9498    /// let response = builder.send().await?;
9499    /// # Ok(()) }
9500    ///
9501    /// fn prepare_request_builder() -> GetLocation {
9502    ///   # panic!();
9503    ///   // ... details omitted ...
9504    /// }
9505    /// ```
9506    #[derive(Clone, Debug)]
9507    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
9508
9509    impl GetLocation {
9510        pub(crate) fn new(
9511            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9512        ) -> Self {
9513            Self(RequestBuilder::new(stub))
9514        }
9515
9516        /// Sets the full request, replacing any prior values.
9517        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
9518            mut self,
9519            v: V,
9520        ) -> Self {
9521            self.0.request = v.into();
9522            self
9523        }
9524
9525        /// Sets all the options, replacing any prior values.
9526        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9527            self.0.options = v.into();
9528            self
9529        }
9530
9531        /// Sends the request.
9532        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
9533            (*self.0.stub)
9534                .get_location(self.0.request, self.0.options)
9535                .await
9536                .map(crate::Response::into_body)
9537        }
9538
9539        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
9540        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9541            self.0.request.name = v.into();
9542            self
9543        }
9544    }
9545
9546    #[doc(hidden)]
9547    impl crate::RequestBuilder for GetLocation {
9548        fn request_options(&mut self) -> &mut crate::RequestOptions {
9549            &mut self.0.options
9550        }
9551    }
9552
9553    /// The request builder for [InternalRangeService::set_iam_policy][crate::client::InternalRangeService::set_iam_policy] calls.
9554    ///
9555    /// # Example
9556    /// ```
9557    /// # use google_cloud_networkconnectivity_v1::builder::internal_range_service::SetIamPolicy;
9558    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
9559    ///
9560    /// let builder = prepare_request_builder();
9561    /// let response = builder.send().await?;
9562    /// # Ok(()) }
9563    ///
9564    /// fn prepare_request_builder() -> SetIamPolicy {
9565    ///   # panic!();
9566    ///   // ... details omitted ...
9567    /// }
9568    /// ```
9569    #[derive(Clone, Debug)]
9570    pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
9571
9572    impl SetIamPolicy {
9573        pub(crate) fn new(
9574            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9575        ) -> Self {
9576            Self(RequestBuilder::new(stub))
9577        }
9578
9579        /// Sets the full request, replacing any prior values.
9580        pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
9581            mut self,
9582            v: V,
9583        ) -> Self {
9584            self.0.request = v.into();
9585            self
9586        }
9587
9588        /// Sets all the options, replacing any prior values.
9589        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9590            self.0.options = v.into();
9591            self
9592        }
9593
9594        /// Sends the request.
9595        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
9596            (*self.0.stub)
9597                .set_iam_policy(self.0.request, self.0.options)
9598                .await
9599                .map(crate::Response::into_body)
9600        }
9601
9602        /// Sets the value of [resource][google_cloud_iam_v1::model::SetIamPolicyRequest::resource].
9603        ///
9604        /// This is a **required** field for requests.
9605        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
9606            self.0.request.resource = v.into();
9607            self
9608        }
9609
9610        /// Sets the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
9611        ///
9612        /// This is a **required** field for requests.
9613        pub fn set_policy<T>(mut self, v: T) -> Self
9614        where
9615            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
9616        {
9617            self.0.request.policy = std::option::Option::Some(v.into());
9618            self
9619        }
9620
9621        /// Sets or clears the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
9622        ///
9623        /// This is a **required** field for requests.
9624        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
9625        where
9626            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
9627        {
9628            self.0.request.policy = v.map(|x| x.into());
9629            self
9630        }
9631
9632        /// Sets the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
9633        pub fn set_update_mask<T>(mut self, v: T) -> Self
9634        where
9635            T: std::convert::Into<wkt::FieldMask>,
9636        {
9637            self.0.request.update_mask = std::option::Option::Some(v.into());
9638            self
9639        }
9640
9641        /// Sets or clears the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
9642        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
9643        where
9644            T: std::convert::Into<wkt::FieldMask>,
9645        {
9646            self.0.request.update_mask = v.map(|x| x.into());
9647            self
9648        }
9649    }
9650
9651    #[doc(hidden)]
9652    impl crate::RequestBuilder for SetIamPolicy {
9653        fn request_options(&mut self) -> &mut crate::RequestOptions {
9654            &mut self.0.options
9655        }
9656    }
9657
9658    /// The request builder for [InternalRangeService::get_iam_policy][crate::client::InternalRangeService::get_iam_policy] calls.
9659    ///
9660    /// # Example
9661    /// ```
9662    /// # use google_cloud_networkconnectivity_v1::builder::internal_range_service::GetIamPolicy;
9663    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
9664    ///
9665    /// let builder = prepare_request_builder();
9666    /// let response = builder.send().await?;
9667    /// # Ok(()) }
9668    ///
9669    /// fn prepare_request_builder() -> GetIamPolicy {
9670    ///   # panic!();
9671    ///   // ... details omitted ...
9672    /// }
9673    /// ```
9674    #[derive(Clone, Debug)]
9675    pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
9676
9677    impl GetIamPolicy {
9678        pub(crate) fn new(
9679            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9680        ) -> Self {
9681            Self(RequestBuilder::new(stub))
9682        }
9683
9684        /// Sets the full request, replacing any prior values.
9685        pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
9686            mut self,
9687            v: V,
9688        ) -> Self {
9689            self.0.request = v.into();
9690            self
9691        }
9692
9693        /// Sets all the options, replacing any prior values.
9694        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9695            self.0.options = v.into();
9696            self
9697        }
9698
9699        /// Sends the request.
9700        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
9701            (*self.0.stub)
9702                .get_iam_policy(self.0.request, self.0.options)
9703                .await
9704                .map(crate::Response::into_body)
9705        }
9706
9707        /// Sets the value of [resource][google_cloud_iam_v1::model::GetIamPolicyRequest::resource].
9708        ///
9709        /// This is a **required** field for requests.
9710        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
9711            self.0.request.resource = v.into();
9712            self
9713        }
9714
9715        /// Sets the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
9716        pub fn set_options<T>(mut self, v: T) -> Self
9717        where
9718            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
9719        {
9720            self.0.request.options = std::option::Option::Some(v.into());
9721            self
9722        }
9723
9724        /// Sets or clears the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
9725        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
9726        where
9727            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
9728        {
9729            self.0.request.options = v.map(|x| x.into());
9730            self
9731        }
9732    }
9733
9734    #[doc(hidden)]
9735    impl crate::RequestBuilder for GetIamPolicy {
9736        fn request_options(&mut self) -> &mut crate::RequestOptions {
9737            &mut self.0.options
9738        }
9739    }
9740
9741    /// The request builder for [InternalRangeService::test_iam_permissions][crate::client::InternalRangeService::test_iam_permissions] calls.
9742    ///
9743    /// # Example
9744    /// ```
9745    /// # use google_cloud_networkconnectivity_v1::builder::internal_range_service::TestIamPermissions;
9746    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
9747    ///
9748    /// let builder = prepare_request_builder();
9749    /// let response = builder.send().await?;
9750    /// # Ok(()) }
9751    ///
9752    /// fn prepare_request_builder() -> TestIamPermissions {
9753    ///   # panic!();
9754    ///   // ... details omitted ...
9755    /// }
9756    /// ```
9757    #[derive(Clone, Debug)]
9758    pub struct TestIamPermissions(
9759        RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
9760    );
9761
9762    impl TestIamPermissions {
9763        pub(crate) fn new(
9764            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9765        ) -> Self {
9766            Self(RequestBuilder::new(stub))
9767        }
9768
9769        /// Sets the full request, replacing any prior values.
9770        pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
9771            mut self,
9772            v: V,
9773        ) -> Self {
9774            self.0.request = v.into();
9775            self
9776        }
9777
9778        /// Sets all the options, replacing any prior values.
9779        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9780            self.0.options = v.into();
9781            self
9782        }
9783
9784        /// Sends the request.
9785        pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
9786            (*self.0.stub)
9787                .test_iam_permissions(self.0.request, self.0.options)
9788                .await
9789                .map(crate::Response::into_body)
9790        }
9791
9792        /// Sets the value of [resource][google_cloud_iam_v1::model::TestIamPermissionsRequest::resource].
9793        ///
9794        /// This is a **required** field for requests.
9795        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
9796            self.0.request.resource = v.into();
9797            self
9798        }
9799
9800        /// Sets the value of [permissions][google_cloud_iam_v1::model::TestIamPermissionsRequest::permissions].
9801        ///
9802        /// This is a **required** field for requests.
9803        pub fn set_permissions<T, V>(mut self, v: T) -> Self
9804        where
9805            T: std::iter::IntoIterator<Item = V>,
9806            V: std::convert::Into<std::string::String>,
9807        {
9808            use std::iter::Iterator;
9809            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
9810            self
9811        }
9812    }
9813
9814    #[doc(hidden)]
9815    impl crate::RequestBuilder for TestIamPermissions {
9816        fn request_options(&mut self) -> &mut crate::RequestOptions {
9817            &mut self.0.options
9818        }
9819    }
9820
9821    /// The request builder for [InternalRangeService::list_operations][crate::client::InternalRangeService::list_operations] calls.
9822    ///
9823    /// # Example
9824    /// ```
9825    /// # use google_cloud_networkconnectivity_v1::builder::internal_range_service::ListOperations;
9826    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
9827    /// use google_cloud_gax::paginator::ItemPaginator;
9828    ///
9829    /// let builder = prepare_request_builder();
9830    /// let mut items = builder.by_item();
9831    /// while let Some(result) = items.next().await {
9832    ///   let item = result?;
9833    /// }
9834    /// # Ok(()) }
9835    ///
9836    /// fn prepare_request_builder() -> ListOperations {
9837    ///   # panic!();
9838    ///   // ... details omitted ...
9839    /// }
9840    /// ```
9841    #[derive(Clone, Debug)]
9842    pub struct ListOperations(
9843        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
9844    );
9845
9846    impl ListOperations {
9847        pub(crate) fn new(
9848            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9849        ) -> Self {
9850            Self(RequestBuilder::new(stub))
9851        }
9852
9853        /// Sets the full request, replacing any prior values.
9854        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
9855            mut self,
9856            v: V,
9857        ) -> Self {
9858            self.0.request = v.into();
9859            self
9860        }
9861
9862        /// Sets all the options, replacing any prior values.
9863        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9864            self.0.options = v.into();
9865            self
9866        }
9867
9868        /// Sends the request.
9869        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
9870            (*self.0.stub)
9871                .list_operations(self.0.request, self.0.options)
9872                .await
9873                .map(crate::Response::into_body)
9874        }
9875
9876        /// Streams each page in the collection.
9877        pub fn by_page(
9878            self,
9879        ) -> impl google_cloud_gax::paginator::Paginator<
9880            google_cloud_longrunning::model::ListOperationsResponse,
9881            crate::Error,
9882        > {
9883            use std::clone::Clone;
9884            let token = self.0.request.page_token.clone();
9885            let execute = move |token: String| {
9886                let mut builder = self.clone();
9887                builder.0.request = builder.0.request.set_page_token(token);
9888                builder.send()
9889            };
9890            google_cloud_gax::paginator::internal::new_paginator(token, execute)
9891        }
9892
9893        /// Streams each item in the collection.
9894        pub fn by_item(
9895            self,
9896        ) -> impl google_cloud_gax::paginator::ItemPaginator<
9897            google_cloud_longrunning::model::ListOperationsResponse,
9898            crate::Error,
9899        > {
9900            use google_cloud_gax::paginator::Paginator;
9901            self.by_page().items()
9902        }
9903
9904        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
9905        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9906            self.0.request.name = v.into();
9907            self
9908        }
9909
9910        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
9911        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
9912            self.0.request.filter = v.into();
9913            self
9914        }
9915
9916        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
9917        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
9918            self.0.request.page_size = v.into();
9919            self
9920        }
9921
9922        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
9923        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
9924            self.0.request.page_token = v.into();
9925            self
9926        }
9927
9928        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
9929        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
9930            self.0.request.return_partial_success = v.into();
9931            self
9932        }
9933    }
9934
9935    #[doc(hidden)]
9936    impl crate::RequestBuilder for ListOperations {
9937        fn request_options(&mut self) -> &mut crate::RequestOptions {
9938            &mut self.0.options
9939        }
9940    }
9941
9942    /// The request builder for [InternalRangeService::get_operation][crate::client::InternalRangeService::get_operation] calls.
9943    ///
9944    /// # Example
9945    /// ```
9946    /// # use google_cloud_networkconnectivity_v1::builder::internal_range_service::GetOperation;
9947    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
9948    ///
9949    /// let builder = prepare_request_builder();
9950    /// let response = builder.send().await?;
9951    /// # Ok(()) }
9952    ///
9953    /// fn prepare_request_builder() -> GetOperation {
9954    ///   # panic!();
9955    ///   // ... details omitted ...
9956    /// }
9957    /// ```
9958    #[derive(Clone, Debug)]
9959    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
9960
9961    impl GetOperation {
9962        pub(crate) fn new(
9963            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9964        ) -> Self {
9965            Self(RequestBuilder::new(stub))
9966        }
9967
9968        /// Sets the full request, replacing any prior values.
9969        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
9970            mut self,
9971            v: V,
9972        ) -> Self {
9973            self.0.request = v.into();
9974            self
9975        }
9976
9977        /// Sets all the options, replacing any prior values.
9978        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9979            self.0.options = v.into();
9980            self
9981        }
9982
9983        /// Sends the request.
9984        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9985            (*self.0.stub)
9986                .get_operation(self.0.request, self.0.options)
9987                .await
9988                .map(crate::Response::into_body)
9989        }
9990
9991        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
9992        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9993            self.0.request.name = v.into();
9994            self
9995        }
9996    }
9997
9998    #[doc(hidden)]
9999    impl crate::RequestBuilder for GetOperation {
10000        fn request_options(&mut self) -> &mut crate::RequestOptions {
10001            &mut self.0.options
10002        }
10003    }
10004
10005    /// The request builder for [InternalRangeService::delete_operation][crate::client::InternalRangeService::delete_operation] calls.
10006    ///
10007    /// # Example
10008    /// ```
10009    /// # use google_cloud_networkconnectivity_v1::builder::internal_range_service::DeleteOperation;
10010    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
10011    ///
10012    /// let builder = prepare_request_builder();
10013    /// let response = builder.send().await?;
10014    /// # Ok(()) }
10015    ///
10016    /// fn prepare_request_builder() -> DeleteOperation {
10017    ///   # panic!();
10018    ///   // ... details omitted ...
10019    /// }
10020    /// ```
10021    #[derive(Clone, Debug)]
10022    pub struct DeleteOperation(
10023        RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
10024    );
10025
10026    impl DeleteOperation {
10027        pub(crate) fn new(
10028            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
10029        ) -> Self {
10030            Self(RequestBuilder::new(stub))
10031        }
10032
10033        /// Sets the full request, replacing any prior values.
10034        pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
10035            mut self,
10036            v: V,
10037        ) -> Self {
10038            self.0.request = v.into();
10039            self
10040        }
10041
10042        /// Sets all the options, replacing any prior values.
10043        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10044            self.0.options = v.into();
10045            self
10046        }
10047
10048        /// Sends the request.
10049        pub async fn send(self) -> Result<()> {
10050            (*self.0.stub)
10051                .delete_operation(self.0.request, self.0.options)
10052                .await
10053                .map(crate::Response::into_body)
10054        }
10055
10056        /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
10057        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10058            self.0.request.name = v.into();
10059            self
10060        }
10061    }
10062
10063    #[doc(hidden)]
10064    impl crate::RequestBuilder for DeleteOperation {
10065        fn request_options(&mut self) -> &mut crate::RequestOptions {
10066            &mut self.0.options
10067        }
10068    }
10069
10070    /// The request builder for [InternalRangeService::cancel_operation][crate::client::InternalRangeService::cancel_operation] calls.
10071    ///
10072    /// # Example
10073    /// ```
10074    /// # use google_cloud_networkconnectivity_v1::builder::internal_range_service::CancelOperation;
10075    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
10076    ///
10077    /// let builder = prepare_request_builder();
10078    /// let response = builder.send().await?;
10079    /// # Ok(()) }
10080    ///
10081    /// fn prepare_request_builder() -> CancelOperation {
10082    ///   # panic!();
10083    ///   // ... details omitted ...
10084    /// }
10085    /// ```
10086    #[derive(Clone, Debug)]
10087    pub struct CancelOperation(
10088        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
10089    );
10090
10091    impl CancelOperation {
10092        pub(crate) fn new(
10093            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
10094        ) -> Self {
10095            Self(RequestBuilder::new(stub))
10096        }
10097
10098        /// Sets the full request, replacing any prior values.
10099        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
10100            mut self,
10101            v: V,
10102        ) -> Self {
10103            self.0.request = v.into();
10104            self
10105        }
10106
10107        /// Sets all the options, replacing any prior values.
10108        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10109            self.0.options = v.into();
10110            self
10111        }
10112
10113        /// Sends the request.
10114        pub async fn send(self) -> Result<()> {
10115            (*self.0.stub)
10116                .cancel_operation(self.0.request, self.0.options)
10117                .await
10118                .map(crate::Response::into_body)
10119        }
10120
10121        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
10122        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10123            self.0.request.name = v.into();
10124            self
10125        }
10126    }
10127
10128    #[doc(hidden)]
10129    impl crate::RequestBuilder for CancelOperation {
10130        fn request_options(&mut self) -> &mut crate::RequestOptions {
10131            &mut self.0.options
10132        }
10133    }
10134}
10135
10136/// Request and client builders for [PolicyBasedRoutingService][crate::client::PolicyBasedRoutingService].
10137pub mod policy_based_routing_service {
10138    use crate::Result;
10139
10140    /// A builder for [PolicyBasedRoutingService][crate::client::PolicyBasedRoutingService].
10141    ///
10142    /// ```
10143    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
10144    /// # use google_cloud_networkconnectivity_v1::*;
10145    /// # use builder::policy_based_routing_service::ClientBuilder;
10146    /// # use client::PolicyBasedRoutingService;
10147    /// let builder : ClientBuilder = PolicyBasedRoutingService::builder();
10148    /// let client = builder
10149    ///     .with_endpoint("https://networkconnectivity.googleapis.com")
10150    ///     .build().await?;
10151    /// # Ok(()) }
10152    /// ```
10153    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
10154
10155    pub(crate) mod client {
10156        use super::super::super::client::PolicyBasedRoutingService;
10157        pub struct Factory;
10158        impl crate::ClientFactory for Factory {
10159            type Client = PolicyBasedRoutingService;
10160            type Credentials = gaxi::options::Credentials;
10161            async fn build(
10162                self,
10163                config: gaxi::options::ClientConfig,
10164            ) -> crate::ClientBuilderResult<Self::Client> {
10165                Self::Client::new(config).await
10166            }
10167        }
10168    }
10169
10170    /// Common implementation for [crate::client::PolicyBasedRoutingService] request builders.
10171    #[derive(Clone, Debug)]
10172    pub(crate) struct RequestBuilder<R: std::default::Default> {
10173        stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10174        request: R,
10175        options: crate::RequestOptions,
10176    }
10177
10178    impl<R> RequestBuilder<R>
10179    where
10180        R: std::default::Default,
10181    {
10182        pub(crate) fn new(
10183            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10184        ) -> Self {
10185            Self {
10186                stub,
10187                request: R::default(),
10188                options: crate::RequestOptions::default(),
10189            }
10190        }
10191    }
10192
10193    /// The request builder for [PolicyBasedRoutingService::list_policy_based_routes][crate::client::PolicyBasedRoutingService::list_policy_based_routes] calls.
10194    ///
10195    /// # Example
10196    /// ```
10197    /// # use google_cloud_networkconnectivity_v1::builder::policy_based_routing_service::ListPolicyBasedRoutes;
10198    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
10199    /// use google_cloud_gax::paginator::ItemPaginator;
10200    ///
10201    /// let builder = prepare_request_builder();
10202    /// let mut items = builder.by_item();
10203    /// while let Some(result) = items.next().await {
10204    ///   let item = result?;
10205    /// }
10206    /// # Ok(()) }
10207    ///
10208    /// fn prepare_request_builder() -> ListPolicyBasedRoutes {
10209    ///   # panic!();
10210    ///   // ... details omitted ...
10211    /// }
10212    /// ```
10213    #[derive(Clone, Debug)]
10214    pub struct ListPolicyBasedRoutes(RequestBuilder<crate::model::ListPolicyBasedRoutesRequest>);
10215
10216    impl ListPolicyBasedRoutes {
10217        pub(crate) fn new(
10218            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10219        ) -> Self {
10220            Self(RequestBuilder::new(stub))
10221        }
10222
10223        /// Sets the full request, replacing any prior values.
10224        pub fn with_request<V: Into<crate::model::ListPolicyBasedRoutesRequest>>(
10225            mut self,
10226            v: V,
10227        ) -> Self {
10228            self.0.request = v.into();
10229            self
10230        }
10231
10232        /// Sets all the options, replacing any prior values.
10233        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10234            self.0.options = v.into();
10235            self
10236        }
10237
10238        /// Sends the request.
10239        pub async fn send(self) -> Result<crate::model::ListPolicyBasedRoutesResponse> {
10240            (*self.0.stub)
10241                .list_policy_based_routes(self.0.request, self.0.options)
10242                .await
10243                .map(crate::Response::into_body)
10244        }
10245
10246        /// Streams each page in the collection.
10247        pub fn by_page(
10248            self,
10249        ) -> impl google_cloud_gax::paginator::Paginator<
10250            crate::model::ListPolicyBasedRoutesResponse,
10251            crate::Error,
10252        > {
10253            use std::clone::Clone;
10254            let token = self.0.request.page_token.clone();
10255            let execute = move |token: String| {
10256                let mut builder = self.clone();
10257                builder.0.request = builder.0.request.set_page_token(token);
10258                builder.send()
10259            };
10260            google_cloud_gax::paginator::internal::new_paginator(token, execute)
10261        }
10262
10263        /// Streams each item in the collection.
10264        pub fn by_item(
10265            self,
10266        ) -> impl google_cloud_gax::paginator::ItemPaginator<
10267            crate::model::ListPolicyBasedRoutesResponse,
10268            crate::Error,
10269        > {
10270            use google_cloud_gax::paginator::Paginator;
10271            self.by_page().items()
10272        }
10273
10274        /// Sets the value of [parent][crate::model::ListPolicyBasedRoutesRequest::parent].
10275        ///
10276        /// This is a **required** field for requests.
10277        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
10278            self.0.request.parent = v.into();
10279            self
10280        }
10281
10282        /// Sets the value of [page_size][crate::model::ListPolicyBasedRoutesRequest::page_size].
10283        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
10284            self.0.request.page_size = v.into();
10285            self
10286        }
10287
10288        /// Sets the value of [page_token][crate::model::ListPolicyBasedRoutesRequest::page_token].
10289        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
10290            self.0.request.page_token = v.into();
10291            self
10292        }
10293
10294        /// Sets the value of [filter][crate::model::ListPolicyBasedRoutesRequest::filter].
10295        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
10296            self.0.request.filter = v.into();
10297            self
10298        }
10299
10300        /// Sets the value of [order_by][crate::model::ListPolicyBasedRoutesRequest::order_by].
10301        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
10302            self.0.request.order_by = v.into();
10303            self
10304        }
10305    }
10306
10307    #[doc(hidden)]
10308    impl crate::RequestBuilder for ListPolicyBasedRoutes {
10309        fn request_options(&mut self) -> &mut crate::RequestOptions {
10310            &mut self.0.options
10311        }
10312    }
10313
10314    /// The request builder for [PolicyBasedRoutingService::get_policy_based_route][crate::client::PolicyBasedRoutingService::get_policy_based_route] calls.
10315    ///
10316    /// # Example
10317    /// ```
10318    /// # use google_cloud_networkconnectivity_v1::builder::policy_based_routing_service::GetPolicyBasedRoute;
10319    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
10320    ///
10321    /// let builder = prepare_request_builder();
10322    /// let response = builder.send().await?;
10323    /// # Ok(()) }
10324    ///
10325    /// fn prepare_request_builder() -> GetPolicyBasedRoute {
10326    ///   # panic!();
10327    ///   // ... details omitted ...
10328    /// }
10329    /// ```
10330    #[derive(Clone, Debug)]
10331    pub struct GetPolicyBasedRoute(RequestBuilder<crate::model::GetPolicyBasedRouteRequest>);
10332
10333    impl GetPolicyBasedRoute {
10334        pub(crate) fn new(
10335            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10336        ) -> Self {
10337            Self(RequestBuilder::new(stub))
10338        }
10339
10340        /// Sets the full request, replacing any prior values.
10341        pub fn with_request<V: Into<crate::model::GetPolicyBasedRouteRequest>>(
10342            mut self,
10343            v: V,
10344        ) -> Self {
10345            self.0.request = v.into();
10346            self
10347        }
10348
10349        /// Sets all the options, replacing any prior values.
10350        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10351            self.0.options = v.into();
10352            self
10353        }
10354
10355        /// Sends the request.
10356        pub async fn send(self) -> Result<crate::model::PolicyBasedRoute> {
10357            (*self.0.stub)
10358                .get_policy_based_route(self.0.request, self.0.options)
10359                .await
10360                .map(crate::Response::into_body)
10361        }
10362
10363        /// Sets the value of [name][crate::model::GetPolicyBasedRouteRequest::name].
10364        ///
10365        /// This is a **required** field for requests.
10366        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10367            self.0.request.name = v.into();
10368            self
10369        }
10370    }
10371
10372    #[doc(hidden)]
10373    impl crate::RequestBuilder for GetPolicyBasedRoute {
10374        fn request_options(&mut self) -> &mut crate::RequestOptions {
10375            &mut self.0.options
10376        }
10377    }
10378
10379    /// The request builder for [PolicyBasedRoutingService::create_policy_based_route][crate::client::PolicyBasedRoutingService::create_policy_based_route] calls.
10380    ///
10381    /// # Example
10382    /// ```
10383    /// # use google_cloud_networkconnectivity_v1::builder::policy_based_routing_service::CreatePolicyBasedRoute;
10384    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
10385    /// use google_cloud_lro::Poller;
10386    ///
10387    /// let builder = prepare_request_builder();
10388    /// let response = builder.poller().until_done().await?;
10389    /// # Ok(()) }
10390    ///
10391    /// fn prepare_request_builder() -> CreatePolicyBasedRoute {
10392    ///   # panic!();
10393    ///   // ... details omitted ...
10394    /// }
10395    /// ```
10396    #[derive(Clone, Debug)]
10397    pub struct CreatePolicyBasedRoute(RequestBuilder<crate::model::CreatePolicyBasedRouteRequest>);
10398
10399    impl CreatePolicyBasedRoute {
10400        pub(crate) fn new(
10401            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10402        ) -> Self {
10403            Self(RequestBuilder::new(stub))
10404        }
10405
10406        /// Sets the full request, replacing any prior values.
10407        pub fn with_request<V: Into<crate::model::CreatePolicyBasedRouteRequest>>(
10408            mut self,
10409            v: V,
10410        ) -> Self {
10411            self.0.request = v.into();
10412            self
10413        }
10414
10415        /// Sets all the options, replacing any prior values.
10416        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10417            self.0.options = v.into();
10418            self
10419        }
10420
10421        /// Sends the request.
10422        ///
10423        /// # Long running operations
10424        ///
10425        /// This starts, but does not poll, a longrunning operation. More information
10426        /// on [create_policy_based_route][crate::client::PolicyBasedRoutingService::create_policy_based_route].
10427        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
10428            (*self.0.stub)
10429                .create_policy_based_route(self.0.request, self.0.options)
10430                .await
10431                .map(crate::Response::into_body)
10432        }
10433
10434        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_policy_based_route`.
10435        pub fn poller(
10436            self,
10437        ) -> impl google_cloud_lro::Poller<crate::model::PolicyBasedRoute, crate::model::OperationMetadata>
10438        {
10439            type Operation = google_cloud_lro::internal::Operation<
10440                crate::model::PolicyBasedRoute,
10441                crate::model::OperationMetadata,
10442            >;
10443            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
10444            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
10445
10446            let stub = self.0.stub.clone();
10447            let mut options = self.0.options.clone();
10448            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
10449            let query = move |name| {
10450                let stub = stub.clone();
10451                let options = options.clone();
10452                async {
10453                    let op = GetOperation::new(stub)
10454                        .set_name(name)
10455                        .with_options(options)
10456                        .send()
10457                        .await?;
10458                    Ok(Operation::new(op))
10459                }
10460            };
10461
10462            let start = move || async {
10463                let op = self.send().await?;
10464                Ok(Operation::new(op))
10465            };
10466
10467            google_cloud_lro::internal::new_poller(
10468                polling_error_policy,
10469                polling_backoff_policy,
10470                start,
10471                query,
10472            )
10473        }
10474
10475        /// Sets the value of [parent][crate::model::CreatePolicyBasedRouteRequest::parent].
10476        ///
10477        /// This is a **required** field for requests.
10478        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
10479            self.0.request.parent = v.into();
10480            self
10481        }
10482
10483        /// Sets the value of [policy_based_route_id][crate::model::CreatePolicyBasedRouteRequest::policy_based_route_id].
10484        ///
10485        /// This is a **required** field for requests.
10486        pub fn set_policy_based_route_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
10487            self.0.request.policy_based_route_id = v.into();
10488            self
10489        }
10490
10491        /// Sets the value of [policy_based_route][crate::model::CreatePolicyBasedRouteRequest::policy_based_route].
10492        ///
10493        /// This is a **required** field for requests.
10494        pub fn set_policy_based_route<T>(mut self, v: T) -> Self
10495        where
10496            T: std::convert::Into<crate::model::PolicyBasedRoute>,
10497        {
10498            self.0.request.policy_based_route = std::option::Option::Some(v.into());
10499            self
10500        }
10501
10502        /// Sets or clears the value of [policy_based_route][crate::model::CreatePolicyBasedRouteRequest::policy_based_route].
10503        ///
10504        /// This is a **required** field for requests.
10505        pub fn set_or_clear_policy_based_route<T>(mut self, v: std::option::Option<T>) -> Self
10506        where
10507            T: std::convert::Into<crate::model::PolicyBasedRoute>,
10508        {
10509            self.0.request.policy_based_route = v.map(|x| x.into());
10510            self
10511        }
10512
10513        /// Sets the value of [request_id][crate::model::CreatePolicyBasedRouteRequest::request_id].
10514        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
10515            self.0.request.request_id = v.into();
10516            self
10517        }
10518    }
10519
10520    #[doc(hidden)]
10521    impl crate::RequestBuilder for CreatePolicyBasedRoute {
10522        fn request_options(&mut self) -> &mut crate::RequestOptions {
10523            &mut self.0.options
10524        }
10525    }
10526
10527    /// The request builder for [PolicyBasedRoutingService::delete_policy_based_route][crate::client::PolicyBasedRoutingService::delete_policy_based_route] calls.
10528    ///
10529    /// # Example
10530    /// ```
10531    /// # use google_cloud_networkconnectivity_v1::builder::policy_based_routing_service::DeletePolicyBasedRoute;
10532    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
10533    /// use google_cloud_lro::Poller;
10534    ///
10535    /// let builder = prepare_request_builder();
10536    /// let response = builder.poller().until_done().await?;
10537    /// # Ok(()) }
10538    ///
10539    /// fn prepare_request_builder() -> DeletePolicyBasedRoute {
10540    ///   # panic!();
10541    ///   // ... details omitted ...
10542    /// }
10543    /// ```
10544    #[derive(Clone, Debug)]
10545    pub struct DeletePolicyBasedRoute(RequestBuilder<crate::model::DeletePolicyBasedRouteRequest>);
10546
10547    impl DeletePolicyBasedRoute {
10548        pub(crate) fn new(
10549            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10550        ) -> Self {
10551            Self(RequestBuilder::new(stub))
10552        }
10553
10554        /// Sets the full request, replacing any prior values.
10555        pub fn with_request<V: Into<crate::model::DeletePolicyBasedRouteRequest>>(
10556            mut self,
10557            v: V,
10558        ) -> Self {
10559            self.0.request = v.into();
10560            self
10561        }
10562
10563        /// Sets all the options, replacing any prior values.
10564        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10565            self.0.options = v.into();
10566            self
10567        }
10568
10569        /// Sends the request.
10570        ///
10571        /// # Long running operations
10572        ///
10573        /// This starts, but does not poll, a longrunning operation. More information
10574        /// on [delete_policy_based_route][crate::client::PolicyBasedRoutingService::delete_policy_based_route].
10575        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
10576            (*self.0.stub)
10577                .delete_policy_based_route(self.0.request, self.0.options)
10578                .await
10579                .map(crate::Response::into_body)
10580        }
10581
10582        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_policy_based_route`.
10583        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
10584            type Operation =
10585                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
10586            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
10587            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
10588
10589            let stub = self.0.stub.clone();
10590            let mut options = self.0.options.clone();
10591            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
10592            let query = move |name| {
10593                let stub = stub.clone();
10594                let options = options.clone();
10595                async {
10596                    let op = GetOperation::new(stub)
10597                        .set_name(name)
10598                        .with_options(options)
10599                        .send()
10600                        .await?;
10601                    Ok(Operation::new(op))
10602                }
10603            };
10604
10605            let start = move || async {
10606                let op = self.send().await?;
10607                Ok(Operation::new(op))
10608            };
10609
10610            google_cloud_lro::internal::new_unit_response_poller(
10611                polling_error_policy,
10612                polling_backoff_policy,
10613                start,
10614                query,
10615            )
10616        }
10617
10618        /// Sets the value of [name][crate::model::DeletePolicyBasedRouteRequest::name].
10619        ///
10620        /// This is a **required** field for requests.
10621        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10622            self.0.request.name = v.into();
10623            self
10624        }
10625
10626        /// Sets the value of [request_id][crate::model::DeletePolicyBasedRouteRequest::request_id].
10627        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
10628            self.0.request.request_id = v.into();
10629            self
10630        }
10631    }
10632
10633    #[doc(hidden)]
10634    impl crate::RequestBuilder for DeletePolicyBasedRoute {
10635        fn request_options(&mut self) -> &mut crate::RequestOptions {
10636            &mut self.0.options
10637        }
10638    }
10639
10640    /// The request builder for [PolicyBasedRoutingService::list_locations][crate::client::PolicyBasedRoutingService::list_locations] calls.
10641    ///
10642    /// # Example
10643    /// ```
10644    /// # use google_cloud_networkconnectivity_v1::builder::policy_based_routing_service::ListLocations;
10645    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
10646    /// use google_cloud_gax::paginator::ItemPaginator;
10647    ///
10648    /// let builder = prepare_request_builder();
10649    /// let mut items = builder.by_item();
10650    /// while let Some(result) = items.next().await {
10651    ///   let item = result?;
10652    /// }
10653    /// # Ok(()) }
10654    ///
10655    /// fn prepare_request_builder() -> ListLocations {
10656    ///   # panic!();
10657    ///   // ... details omitted ...
10658    /// }
10659    /// ```
10660    #[derive(Clone, Debug)]
10661    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
10662
10663    impl ListLocations {
10664        pub(crate) fn new(
10665            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10666        ) -> Self {
10667            Self(RequestBuilder::new(stub))
10668        }
10669
10670        /// Sets the full request, replacing any prior values.
10671        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
10672            mut self,
10673            v: V,
10674        ) -> Self {
10675            self.0.request = v.into();
10676            self
10677        }
10678
10679        /// Sets all the options, replacing any prior values.
10680        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10681            self.0.options = v.into();
10682            self
10683        }
10684
10685        /// Sends the request.
10686        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
10687            (*self.0.stub)
10688                .list_locations(self.0.request, self.0.options)
10689                .await
10690                .map(crate::Response::into_body)
10691        }
10692
10693        /// Streams each page in the collection.
10694        pub fn by_page(
10695            self,
10696        ) -> impl google_cloud_gax::paginator::Paginator<
10697            google_cloud_location::model::ListLocationsResponse,
10698            crate::Error,
10699        > {
10700            use std::clone::Clone;
10701            let token = self.0.request.page_token.clone();
10702            let execute = move |token: String| {
10703                let mut builder = self.clone();
10704                builder.0.request = builder.0.request.set_page_token(token);
10705                builder.send()
10706            };
10707            google_cloud_gax::paginator::internal::new_paginator(token, execute)
10708        }
10709
10710        /// Streams each item in the collection.
10711        pub fn by_item(
10712            self,
10713        ) -> impl google_cloud_gax::paginator::ItemPaginator<
10714            google_cloud_location::model::ListLocationsResponse,
10715            crate::Error,
10716        > {
10717            use google_cloud_gax::paginator::Paginator;
10718            self.by_page().items()
10719        }
10720
10721        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
10722        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10723            self.0.request.name = v.into();
10724            self
10725        }
10726
10727        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
10728        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
10729            self.0.request.filter = v.into();
10730            self
10731        }
10732
10733        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
10734        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
10735            self.0.request.page_size = v.into();
10736            self
10737        }
10738
10739        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
10740        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
10741            self.0.request.page_token = v.into();
10742            self
10743        }
10744    }
10745
10746    #[doc(hidden)]
10747    impl crate::RequestBuilder for ListLocations {
10748        fn request_options(&mut self) -> &mut crate::RequestOptions {
10749            &mut self.0.options
10750        }
10751    }
10752
10753    /// The request builder for [PolicyBasedRoutingService::get_location][crate::client::PolicyBasedRoutingService::get_location] calls.
10754    ///
10755    /// # Example
10756    /// ```
10757    /// # use google_cloud_networkconnectivity_v1::builder::policy_based_routing_service::GetLocation;
10758    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
10759    ///
10760    /// let builder = prepare_request_builder();
10761    /// let response = builder.send().await?;
10762    /// # Ok(()) }
10763    ///
10764    /// fn prepare_request_builder() -> GetLocation {
10765    ///   # panic!();
10766    ///   // ... details omitted ...
10767    /// }
10768    /// ```
10769    #[derive(Clone, Debug)]
10770    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
10771
10772    impl GetLocation {
10773        pub(crate) fn new(
10774            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10775        ) -> Self {
10776            Self(RequestBuilder::new(stub))
10777        }
10778
10779        /// Sets the full request, replacing any prior values.
10780        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
10781            mut self,
10782            v: V,
10783        ) -> Self {
10784            self.0.request = v.into();
10785            self
10786        }
10787
10788        /// Sets all the options, replacing any prior values.
10789        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10790            self.0.options = v.into();
10791            self
10792        }
10793
10794        /// Sends the request.
10795        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
10796            (*self.0.stub)
10797                .get_location(self.0.request, self.0.options)
10798                .await
10799                .map(crate::Response::into_body)
10800        }
10801
10802        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
10803        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10804            self.0.request.name = v.into();
10805            self
10806        }
10807    }
10808
10809    #[doc(hidden)]
10810    impl crate::RequestBuilder for GetLocation {
10811        fn request_options(&mut self) -> &mut crate::RequestOptions {
10812            &mut self.0.options
10813        }
10814    }
10815
10816    /// The request builder for [PolicyBasedRoutingService::set_iam_policy][crate::client::PolicyBasedRoutingService::set_iam_policy] calls.
10817    ///
10818    /// # Example
10819    /// ```
10820    /// # use google_cloud_networkconnectivity_v1::builder::policy_based_routing_service::SetIamPolicy;
10821    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
10822    ///
10823    /// let builder = prepare_request_builder();
10824    /// let response = builder.send().await?;
10825    /// # Ok(()) }
10826    ///
10827    /// fn prepare_request_builder() -> SetIamPolicy {
10828    ///   # panic!();
10829    ///   // ... details omitted ...
10830    /// }
10831    /// ```
10832    #[derive(Clone, Debug)]
10833    pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
10834
10835    impl SetIamPolicy {
10836        pub(crate) fn new(
10837            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10838        ) -> Self {
10839            Self(RequestBuilder::new(stub))
10840        }
10841
10842        /// Sets the full request, replacing any prior values.
10843        pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
10844            mut self,
10845            v: V,
10846        ) -> Self {
10847            self.0.request = v.into();
10848            self
10849        }
10850
10851        /// Sets all the options, replacing any prior values.
10852        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10853            self.0.options = v.into();
10854            self
10855        }
10856
10857        /// Sends the request.
10858        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
10859            (*self.0.stub)
10860                .set_iam_policy(self.0.request, self.0.options)
10861                .await
10862                .map(crate::Response::into_body)
10863        }
10864
10865        /// Sets the value of [resource][google_cloud_iam_v1::model::SetIamPolicyRequest::resource].
10866        ///
10867        /// This is a **required** field for requests.
10868        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
10869            self.0.request.resource = v.into();
10870            self
10871        }
10872
10873        /// Sets the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
10874        ///
10875        /// This is a **required** field for requests.
10876        pub fn set_policy<T>(mut self, v: T) -> Self
10877        where
10878            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
10879        {
10880            self.0.request.policy = std::option::Option::Some(v.into());
10881            self
10882        }
10883
10884        /// Sets or clears the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
10885        ///
10886        /// This is a **required** field for requests.
10887        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
10888        where
10889            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
10890        {
10891            self.0.request.policy = v.map(|x| x.into());
10892            self
10893        }
10894
10895        /// Sets the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
10896        pub fn set_update_mask<T>(mut self, v: T) -> Self
10897        where
10898            T: std::convert::Into<wkt::FieldMask>,
10899        {
10900            self.0.request.update_mask = std::option::Option::Some(v.into());
10901            self
10902        }
10903
10904        /// Sets or clears the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
10905        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
10906        where
10907            T: std::convert::Into<wkt::FieldMask>,
10908        {
10909            self.0.request.update_mask = v.map(|x| x.into());
10910            self
10911        }
10912    }
10913
10914    #[doc(hidden)]
10915    impl crate::RequestBuilder for SetIamPolicy {
10916        fn request_options(&mut self) -> &mut crate::RequestOptions {
10917            &mut self.0.options
10918        }
10919    }
10920
10921    /// The request builder for [PolicyBasedRoutingService::get_iam_policy][crate::client::PolicyBasedRoutingService::get_iam_policy] calls.
10922    ///
10923    /// # Example
10924    /// ```
10925    /// # use google_cloud_networkconnectivity_v1::builder::policy_based_routing_service::GetIamPolicy;
10926    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
10927    ///
10928    /// let builder = prepare_request_builder();
10929    /// let response = builder.send().await?;
10930    /// # Ok(()) }
10931    ///
10932    /// fn prepare_request_builder() -> GetIamPolicy {
10933    ///   # panic!();
10934    ///   // ... details omitted ...
10935    /// }
10936    /// ```
10937    #[derive(Clone, Debug)]
10938    pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
10939
10940    impl GetIamPolicy {
10941        pub(crate) fn new(
10942            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10943        ) -> Self {
10944            Self(RequestBuilder::new(stub))
10945        }
10946
10947        /// Sets the full request, replacing any prior values.
10948        pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
10949            mut self,
10950            v: V,
10951        ) -> Self {
10952            self.0.request = v.into();
10953            self
10954        }
10955
10956        /// Sets all the options, replacing any prior values.
10957        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10958            self.0.options = v.into();
10959            self
10960        }
10961
10962        /// Sends the request.
10963        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
10964            (*self.0.stub)
10965                .get_iam_policy(self.0.request, self.0.options)
10966                .await
10967                .map(crate::Response::into_body)
10968        }
10969
10970        /// Sets the value of [resource][google_cloud_iam_v1::model::GetIamPolicyRequest::resource].
10971        ///
10972        /// This is a **required** field for requests.
10973        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
10974            self.0.request.resource = v.into();
10975            self
10976        }
10977
10978        /// Sets the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
10979        pub fn set_options<T>(mut self, v: T) -> Self
10980        where
10981            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
10982        {
10983            self.0.request.options = std::option::Option::Some(v.into());
10984            self
10985        }
10986
10987        /// Sets or clears the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
10988        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
10989        where
10990            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
10991        {
10992            self.0.request.options = v.map(|x| x.into());
10993            self
10994        }
10995    }
10996
10997    #[doc(hidden)]
10998    impl crate::RequestBuilder for GetIamPolicy {
10999        fn request_options(&mut self) -> &mut crate::RequestOptions {
11000            &mut self.0.options
11001        }
11002    }
11003
11004    /// The request builder for [PolicyBasedRoutingService::test_iam_permissions][crate::client::PolicyBasedRoutingService::test_iam_permissions] calls.
11005    ///
11006    /// # Example
11007    /// ```
11008    /// # use google_cloud_networkconnectivity_v1::builder::policy_based_routing_service::TestIamPermissions;
11009    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
11010    ///
11011    /// let builder = prepare_request_builder();
11012    /// let response = builder.send().await?;
11013    /// # Ok(()) }
11014    ///
11015    /// fn prepare_request_builder() -> TestIamPermissions {
11016    ///   # panic!();
11017    ///   // ... details omitted ...
11018    /// }
11019    /// ```
11020    #[derive(Clone, Debug)]
11021    pub struct TestIamPermissions(
11022        RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
11023    );
11024
11025    impl TestIamPermissions {
11026        pub(crate) fn new(
11027            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
11028        ) -> Self {
11029            Self(RequestBuilder::new(stub))
11030        }
11031
11032        /// Sets the full request, replacing any prior values.
11033        pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
11034            mut self,
11035            v: V,
11036        ) -> Self {
11037            self.0.request = v.into();
11038            self
11039        }
11040
11041        /// Sets all the options, replacing any prior values.
11042        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11043            self.0.options = v.into();
11044            self
11045        }
11046
11047        /// Sends the request.
11048        pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
11049            (*self.0.stub)
11050                .test_iam_permissions(self.0.request, self.0.options)
11051                .await
11052                .map(crate::Response::into_body)
11053        }
11054
11055        /// Sets the value of [resource][google_cloud_iam_v1::model::TestIamPermissionsRequest::resource].
11056        ///
11057        /// This is a **required** field for requests.
11058        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
11059            self.0.request.resource = v.into();
11060            self
11061        }
11062
11063        /// Sets the value of [permissions][google_cloud_iam_v1::model::TestIamPermissionsRequest::permissions].
11064        ///
11065        /// This is a **required** field for requests.
11066        pub fn set_permissions<T, V>(mut self, v: T) -> Self
11067        where
11068            T: std::iter::IntoIterator<Item = V>,
11069            V: std::convert::Into<std::string::String>,
11070        {
11071            use std::iter::Iterator;
11072            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
11073            self
11074        }
11075    }
11076
11077    #[doc(hidden)]
11078    impl crate::RequestBuilder for TestIamPermissions {
11079        fn request_options(&mut self) -> &mut crate::RequestOptions {
11080            &mut self.0.options
11081        }
11082    }
11083
11084    /// The request builder for [PolicyBasedRoutingService::list_operations][crate::client::PolicyBasedRoutingService::list_operations] calls.
11085    ///
11086    /// # Example
11087    /// ```
11088    /// # use google_cloud_networkconnectivity_v1::builder::policy_based_routing_service::ListOperations;
11089    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
11090    /// use google_cloud_gax::paginator::ItemPaginator;
11091    ///
11092    /// let builder = prepare_request_builder();
11093    /// let mut items = builder.by_item();
11094    /// while let Some(result) = items.next().await {
11095    ///   let item = result?;
11096    /// }
11097    /// # Ok(()) }
11098    ///
11099    /// fn prepare_request_builder() -> ListOperations {
11100    ///   # panic!();
11101    ///   // ... details omitted ...
11102    /// }
11103    /// ```
11104    #[derive(Clone, Debug)]
11105    pub struct ListOperations(
11106        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
11107    );
11108
11109    impl ListOperations {
11110        pub(crate) fn new(
11111            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
11112        ) -> Self {
11113            Self(RequestBuilder::new(stub))
11114        }
11115
11116        /// Sets the full request, replacing any prior values.
11117        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
11118            mut self,
11119            v: V,
11120        ) -> Self {
11121            self.0.request = v.into();
11122            self
11123        }
11124
11125        /// Sets all the options, replacing any prior values.
11126        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11127            self.0.options = v.into();
11128            self
11129        }
11130
11131        /// Sends the request.
11132        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
11133            (*self.0.stub)
11134                .list_operations(self.0.request, self.0.options)
11135                .await
11136                .map(crate::Response::into_body)
11137        }
11138
11139        /// Streams each page in the collection.
11140        pub fn by_page(
11141            self,
11142        ) -> impl google_cloud_gax::paginator::Paginator<
11143            google_cloud_longrunning::model::ListOperationsResponse,
11144            crate::Error,
11145        > {
11146            use std::clone::Clone;
11147            let token = self.0.request.page_token.clone();
11148            let execute = move |token: String| {
11149                let mut builder = self.clone();
11150                builder.0.request = builder.0.request.set_page_token(token);
11151                builder.send()
11152            };
11153            google_cloud_gax::paginator::internal::new_paginator(token, execute)
11154        }
11155
11156        /// Streams each item in the collection.
11157        pub fn by_item(
11158            self,
11159        ) -> impl google_cloud_gax::paginator::ItemPaginator<
11160            google_cloud_longrunning::model::ListOperationsResponse,
11161            crate::Error,
11162        > {
11163            use google_cloud_gax::paginator::Paginator;
11164            self.by_page().items()
11165        }
11166
11167        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
11168        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11169            self.0.request.name = v.into();
11170            self
11171        }
11172
11173        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
11174        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
11175            self.0.request.filter = v.into();
11176            self
11177        }
11178
11179        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
11180        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
11181            self.0.request.page_size = v.into();
11182            self
11183        }
11184
11185        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
11186        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
11187            self.0.request.page_token = v.into();
11188            self
11189        }
11190
11191        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
11192        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
11193            self.0.request.return_partial_success = v.into();
11194            self
11195        }
11196    }
11197
11198    #[doc(hidden)]
11199    impl crate::RequestBuilder for ListOperations {
11200        fn request_options(&mut self) -> &mut crate::RequestOptions {
11201            &mut self.0.options
11202        }
11203    }
11204
11205    /// The request builder for [PolicyBasedRoutingService::get_operation][crate::client::PolicyBasedRoutingService::get_operation] calls.
11206    ///
11207    /// # Example
11208    /// ```
11209    /// # use google_cloud_networkconnectivity_v1::builder::policy_based_routing_service::GetOperation;
11210    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
11211    ///
11212    /// let builder = prepare_request_builder();
11213    /// let response = builder.send().await?;
11214    /// # Ok(()) }
11215    ///
11216    /// fn prepare_request_builder() -> GetOperation {
11217    ///   # panic!();
11218    ///   // ... details omitted ...
11219    /// }
11220    /// ```
11221    #[derive(Clone, Debug)]
11222    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
11223
11224    impl GetOperation {
11225        pub(crate) fn new(
11226            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
11227        ) -> Self {
11228            Self(RequestBuilder::new(stub))
11229        }
11230
11231        /// Sets the full request, replacing any prior values.
11232        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
11233            mut self,
11234            v: V,
11235        ) -> Self {
11236            self.0.request = v.into();
11237            self
11238        }
11239
11240        /// Sets all the options, replacing any prior values.
11241        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11242            self.0.options = v.into();
11243            self
11244        }
11245
11246        /// Sends the request.
11247        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
11248            (*self.0.stub)
11249                .get_operation(self.0.request, self.0.options)
11250                .await
11251                .map(crate::Response::into_body)
11252        }
11253
11254        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
11255        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11256            self.0.request.name = v.into();
11257            self
11258        }
11259    }
11260
11261    #[doc(hidden)]
11262    impl crate::RequestBuilder for GetOperation {
11263        fn request_options(&mut self) -> &mut crate::RequestOptions {
11264            &mut self.0.options
11265        }
11266    }
11267
11268    /// The request builder for [PolicyBasedRoutingService::delete_operation][crate::client::PolicyBasedRoutingService::delete_operation] calls.
11269    ///
11270    /// # Example
11271    /// ```
11272    /// # use google_cloud_networkconnectivity_v1::builder::policy_based_routing_service::DeleteOperation;
11273    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
11274    ///
11275    /// let builder = prepare_request_builder();
11276    /// let response = builder.send().await?;
11277    /// # Ok(()) }
11278    ///
11279    /// fn prepare_request_builder() -> DeleteOperation {
11280    ///   # panic!();
11281    ///   // ... details omitted ...
11282    /// }
11283    /// ```
11284    #[derive(Clone, Debug)]
11285    pub struct DeleteOperation(
11286        RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
11287    );
11288
11289    impl DeleteOperation {
11290        pub(crate) fn new(
11291            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
11292        ) -> Self {
11293            Self(RequestBuilder::new(stub))
11294        }
11295
11296        /// Sets the full request, replacing any prior values.
11297        pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
11298            mut self,
11299            v: V,
11300        ) -> Self {
11301            self.0.request = v.into();
11302            self
11303        }
11304
11305        /// Sets all the options, replacing any prior values.
11306        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11307            self.0.options = v.into();
11308            self
11309        }
11310
11311        /// Sends the request.
11312        pub async fn send(self) -> Result<()> {
11313            (*self.0.stub)
11314                .delete_operation(self.0.request, self.0.options)
11315                .await
11316                .map(crate::Response::into_body)
11317        }
11318
11319        /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
11320        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11321            self.0.request.name = v.into();
11322            self
11323        }
11324    }
11325
11326    #[doc(hidden)]
11327    impl crate::RequestBuilder for DeleteOperation {
11328        fn request_options(&mut self) -> &mut crate::RequestOptions {
11329            &mut self.0.options
11330        }
11331    }
11332
11333    /// The request builder for [PolicyBasedRoutingService::cancel_operation][crate::client::PolicyBasedRoutingService::cancel_operation] calls.
11334    ///
11335    /// # Example
11336    /// ```
11337    /// # use google_cloud_networkconnectivity_v1::builder::policy_based_routing_service::CancelOperation;
11338    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
11339    ///
11340    /// let builder = prepare_request_builder();
11341    /// let response = builder.send().await?;
11342    /// # Ok(()) }
11343    ///
11344    /// fn prepare_request_builder() -> CancelOperation {
11345    ///   # panic!();
11346    ///   // ... details omitted ...
11347    /// }
11348    /// ```
11349    #[derive(Clone, Debug)]
11350    pub struct CancelOperation(
11351        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
11352    );
11353
11354    impl CancelOperation {
11355        pub(crate) fn new(
11356            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
11357        ) -> Self {
11358            Self(RequestBuilder::new(stub))
11359        }
11360
11361        /// Sets the full request, replacing any prior values.
11362        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
11363            mut self,
11364            v: V,
11365        ) -> Self {
11366            self.0.request = v.into();
11367            self
11368        }
11369
11370        /// Sets all the options, replacing any prior values.
11371        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11372            self.0.options = v.into();
11373            self
11374        }
11375
11376        /// Sends the request.
11377        pub async fn send(self) -> Result<()> {
11378            (*self.0.stub)
11379                .cancel_operation(self.0.request, self.0.options)
11380                .await
11381                .map(crate::Response::into_body)
11382        }
11383
11384        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
11385        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11386            self.0.request.name = v.into();
11387            self
11388        }
11389    }
11390
11391    #[doc(hidden)]
11392    impl crate::RequestBuilder for CancelOperation {
11393        fn request_options(&mut self) -> &mut crate::RequestOptions {
11394            &mut self.0.options
11395        }
11396    }
11397}