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
17pub mod cross_network_automation_service {
18    use crate::Result;
19
20    /// A builder for [CrossNetworkAutomationService][crate::client::CrossNetworkAutomationService].
21    ///
22    /// ```
23    /// # tokio_test::block_on(async {
24    /// # use google_cloud_networkconnectivity_v1::*;
25    /// # use builder::cross_network_automation_service::ClientBuilder;
26    /// # use client::CrossNetworkAutomationService;
27    /// let builder : ClientBuilder = CrossNetworkAutomationService::builder();
28    /// let client = builder
29    ///     .with_endpoint("https://networkconnectivity.googleapis.com")
30    ///     .build().await?;
31    /// # gax::client_builder::Result::<()>::Ok(()) });
32    /// ```
33    pub type ClientBuilder =
34        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
35
36    pub(crate) mod client {
37        use super::super::super::client::CrossNetworkAutomationService;
38        pub struct Factory;
39        impl gax::client_builder::internal::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            ) -> gax::client_builder::Result<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: gax::options::RequestOptions,
57    }
58
59    impl<R> RequestBuilder<R>
60    where
61        R: std::default::Default,
62    {
63        pub(crate) fn new(
64            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
65        ) -> Self {
66            Self {
67                stub,
68                request: R::default(),
69                options: gax::options::RequestOptions::default(),
70            }
71        }
72    }
73
74    /// The request builder for [CrossNetworkAutomationService::list_service_connection_maps][crate::client::CrossNetworkAutomationService::list_service_connection_maps] calls.
75    ///
76    /// # Example
77    /// ```no_run
78    /// # use google_cloud_networkconnectivity_v1::builder;
79    /// use builder::cross_network_automation_service::ListServiceConnectionMaps;
80    /// # tokio_test::block_on(async {
81    /// use gax::paginator::ItemPaginator;
82    ///
83    /// let builder = prepare_request_builder();
84    /// let mut items = builder.by_item();
85    /// while let Some(result) = items.next().await {
86    ///   let item = result?;
87    /// }
88    /// # gax::Result::<()>::Ok(()) });
89    ///
90    /// fn prepare_request_builder() -> ListServiceConnectionMaps {
91    ///   # panic!();
92    ///   // ... details omitted ...
93    /// }
94    /// ```
95    #[derive(Clone, Debug)]
96    pub struct ListServiceConnectionMaps(
97        RequestBuilder<crate::model::ListServiceConnectionMapsRequest>,
98    );
99
100    impl ListServiceConnectionMaps {
101        pub(crate) fn new(
102            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
103        ) -> Self {
104            Self(RequestBuilder::new(stub))
105        }
106
107        /// Sets the full request, replacing any prior values.
108        pub fn with_request<V: Into<crate::model::ListServiceConnectionMapsRequest>>(
109            mut self,
110            v: V,
111        ) -> Self {
112            self.0.request = v.into();
113            self
114        }
115
116        /// Sets all the options, replacing any prior values.
117        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
118            self.0.options = v.into();
119            self
120        }
121
122        /// Sends the request.
123        pub async fn send(self) -> Result<crate::model::ListServiceConnectionMapsResponse> {
124            (*self.0.stub)
125                .list_service_connection_maps(self.0.request, self.0.options)
126                .await
127                .map(gax::response::Response::into_body)
128        }
129
130        /// Streams each page in the collection.
131        pub fn by_page(
132            self,
133        ) -> impl gax::paginator::Paginator<
134            crate::model::ListServiceConnectionMapsResponse,
135            gax::error::Error,
136        > {
137            use std::clone::Clone;
138            let token = self.0.request.page_token.clone();
139            let execute = move |token: String| {
140                let mut builder = self.clone();
141                builder.0.request = builder.0.request.set_page_token(token);
142                builder.send()
143            };
144            gax::paginator::internal::new_paginator(token, execute)
145        }
146
147        /// Streams each item in the collection.
148        pub fn by_item(
149            self,
150        ) -> impl gax::paginator::ItemPaginator<
151            crate::model::ListServiceConnectionMapsResponse,
152            gax::error::Error,
153        > {
154            use gax::paginator::Paginator;
155            self.by_page().items()
156        }
157
158        /// Sets the value of [parent][crate::model::ListServiceConnectionMapsRequest::parent].
159        ///
160        /// This is a **required** field for requests.
161        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
162            self.0.request.parent = v.into();
163            self
164        }
165
166        /// Sets the value of [page_size][crate::model::ListServiceConnectionMapsRequest::page_size].
167        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
168            self.0.request.page_size = v.into();
169            self
170        }
171
172        /// Sets the value of [page_token][crate::model::ListServiceConnectionMapsRequest::page_token].
173        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
174            self.0.request.page_token = v.into();
175            self
176        }
177
178        /// Sets the value of [filter][crate::model::ListServiceConnectionMapsRequest::filter].
179        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
180            self.0.request.filter = v.into();
181            self
182        }
183
184        /// Sets the value of [order_by][crate::model::ListServiceConnectionMapsRequest::order_by].
185        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
186            self.0.request.order_by = v.into();
187            self
188        }
189    }
190
191    #[doc(hidden)]
192    impl gax::options::internal::RequestBuilder for ListServiceConnectionMaps {
193        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
194            &mut self.0.options
195        }
196    }
197
198    /// The request builder for [CrossNetworkAutomationService::get_service_connection_map][crate::client::CrossNetworkAutomationService::get_service_connection_map] calls.
199    ///
200    /// # Example
201    /// ```no_run
202    /// # use google_cloud_networkconnectivity_v1::builder;
203    /// use builder::cross_network_automation_service::GetServiceConnectionMap;
204    /// # tokio_test::block_on(async {
205    ///
206    /// let builder = prepare_request_builder();
207    /// let response = builder.send().await?;
208    /// # gax::Result::<()>::Ok(()) });
209    ///
210    /// fn prepare_request_builder() -> GetServiceConnectionMap {
211    ///   # panic!();
212    ///   // ... details omitted ...
213    /// }
214    /// ```
215    #[derive(Clone, Debug)]
216    pub struct GetServiceConnectionMap(
217        RequestBuilder<crate::model::GetServiceConnectionMapRequest>,
218    );
219
220    impl GetServiceConnectionMap {
221        pub(crate) fn new(
222            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
223        ) -> Self {
224            Self(RequestBuilder::new(stub))
225        }
226
227        /// Sets the full request, replacing any prior values.
228        pub fn with_request<V: Into<crate::model::GetServiceConnectionMapRequest>>(
229            mut self,
230            v: V,
231        ) -> Self {
232            self.0.request = v.into();
233            self
234        }
235
236        /// Sets all the options, replacing any prior values.
237        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
238            self.0.options = v.into();
239            self
240        }
241
242        /// Sends the request.
243        pub async fn send(self) -> Result<crate::model::ServiceConnectionMap> {
244            (*self.0.stub)
245                .get_service_connection_map(self.0.request, self.0.options)
246                .await
247                .map(gax::response::Response::into_body)
248        }
249
250        /// Sets the value of [name][crate::model::GetServiceConnectionMapRequest::name].
251        ///
252        /// This is a **required** field for requests.
253        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
254            self.0.request.name = v.into();
255            self
256        }
257    }
258
259    #[doc(hidden)]
260    impl gax::options::internal::RequestBuilder for GetServiceConnectionMap {
261        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
262            &mut self.0.options
263        }
264    }
265
266    /// The request builder for [CrossNetworkAutomationService::create_service_connection_map][crate::client::CrossNetworkAutomationService::create_service_connection_map] calls.
267    ///
268    /// # Example
269    /// ```no_run
270    /// # use google_cloud_networkconnectivity_v1::builder;
271    /// use builder::cross_network_automation_service::CreateServiceConnectionMap;
272    /// # tokio_test::block_on(async {
273    /// use lro::Poller;
274    ///
275    /// let builder = prepare_request_builder();
276    /// let response = builder.poller().until_done().await?;
277    /// # gax::Result::<()>::Ok(()) });
278    ///
279    /// fn prepare_request_builder() -> CreateServiceConnectionMap {
280    ///   # panic!();
281    ///   // ... details omitted ...
282    /// }
283    /// ```
284    #[derive(Clone, Debug)]
285    pub struct CreateServiceConnectionMap(
286        RequestBuilder<crate::model::CreateServiceConnectionMapRequest>,
287    );
288
289    impl CreateServiceConnectionMap {
290        pub(crate) fn new(
291            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
292        ) -> Self {
293            Self(RequestBuilder::new(stub))
294        }
295
296        /// Sets the full request, replacing any prior values.
297        pub fn with_request<V: Into<crate::model::CreateServiceConnectionMapRequest>>(
298            mut self,
299            v: V,
300        ) -> Self {
301            self.0.request = v.into();
302            self
303        }
304
305        /// Sets all the options, replacing any prior values.
306        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
307            self.0.options = v.into();
308            self
309        }
310
311        /// Sends the request.
312        ///
313        /// # Long running operations
314        ///
315        /// This starts, but does not poll, a longrunning operation. More information
316        /// on [create_service_connection_map][crate::client::CrossNetworkAutomationService::create_service_connection_map].
317        pub async fn send(self) -> Result<longrunning::model::Operation> {
318            (*self.0.stub)
319                .create_service_connection_map(self.0.request, self.0.options)
320                .await
321                .map(gax::response::Response::into_body)
322        }
323
324        /// Creates a [Poller][lro::Poller] to work with `create_service_connection_map`.
325        pub fn poller(
326            self,
327        ) -> impl lro::Poller<crate::model::ServiceConnectionMap, crate::model::OperationMetadata>
328        {
329            type Operation = lro::internal::Operation<
330                crate::model::ServiceConnectionMap,
331                crate::model::OperationMetadata,
332            >;
333            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
334            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
335
336            let stub = self.0.stub.clone();
337            let mut options = self.0.options.clone();
338            options.set_retry_policy(gax::retry_policy::NeverRetry);
339            let query = move |name| {
340                let stub = stub.clone();
341                let options = options.clone();
342                async {
343                    let op = GetOperation::new(stub)
344                        .set_name(name)
345                        .with_options(options)
346                        .send()
347                        .await?;
348                    Ok(Operation::new(op))
349                }
350            };
351
352            let start = move || async {
353                let op = self.send().await?;
354                Ok(Operation::new(op))
355            };
356
357            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
358        }
359
360        /// Sets the value of [parent][crate::model::CreateServiceConnectionMapRequest::parent].
361        ///
362        /// This is a **required** field for requests.
363        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
364            self.0.request.parent = v.into();
365            self
366        }
367
368        /// Sets the value of [service_connection_map_id][crate::model::CreateServiceConnectionMapRequest::service_connection_map_id].
369        pub fn set_service_connection_map_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
370            self.0.request.service_connection_map_id = v.into();
371            self
372        }
373
374        /// Sets the value of [service_connection_map][crate::model::CreateServiceConnectionMapRequest::service_connection_map].
375        ///
376        /// This is a **required** field for requests.
377        pub fn set_service_connection_map<T>(mut self, v: T) -> Self
378        where
379            T: std::convert::Into<crate::model::ServiceConnectionMap>,
380        {
381            self.0.request.service_connection_map = std::option::Option::Some(v.into());
382            self
383        }
384
385        /// Sets or clears the value of [service_connection_map][crate::model::CreateServiceConnectionMapRequest::service_connection_map].
386        ///
387        /// This is a **required** field for requests.
388        pub fn set_or_clear_service_connection_map<T>(mut self, v: std::option::Option<T>) -> Self
389        where
390            T: std::convert::Into<crate::model::ServiceConnectionMap>,
391        {
392            self.0.request.service_connection_map = v.map(|x| x.into());
393            self
394        }
395
396        /// Sets the value of [request_id][crate::model::CreateServiceConnectionMapRequest::request_id].
397        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
398            self.0.request.request_id = v.into();
399            self
400        }
401    }
402
403    #[doc(hidden)]
404    impl gax::options::internal::RequestBuilder for CreateServiceConnectionMap {
405        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
406            &mut self.0.options
407        }
408    }
409
410    /// The request builder for [CrossNetworkAutomationService::update_service_connection_map][crate::client::CrossNetworkAutomationService::update_service_connection_map] calls.
411    ///
412    /// # Example
413    /// ```no_run
414    /// # use google_cloud_networkconnectivity_v1::builder;
415    /// use builder::cross_network_automation_service::UpdateServiceConnectionMap;
416    /// # tokio_test::block_on(async {
417    /// use lro::Poller;
418    ///
419    /// let builder = prepare_request_builder();
420    /// let response = builder.poller().until_done().await?;
421    /// # gax::Result::<()>::Ok(()) });
422    ///
423    /// fn prepare_request_builder() -> UpdateServiceConnectionMap {
424    ///   # panic!();
425    ///   // ... details omitted ...
426    /// }
427    /// ```
428    #[derive(Clone, Debug)]
429    pub struct UpdateServiceConnectionMap(
430        RequestBuilder<crate::model::UpdateServiceConnectionMapRequest>,
431    );
432
433    impl UpdateServiceConnectionMap {
434        pub(crate) fn new(
435            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
436        ) -> Self {
437            Self(RequestBuilder::new(stub))
438        }
439
440        /// Sets the full request, replacing any prior values.
441        pub fn with_request<V: Into<crate::model::UpdateServiceConnectionMapRequest>>(
442            mut self,
443            v: V,
444        ) -> Self {
445            self.0.request = v.into();
446            self
447        }
448
449        /// Sets all the options, replacing any prior values.
450        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
451            self.0.options = v.into();
452            self
453        }
454
455        /// Sends the request.
456        ///
457        /// # Long running operations
458        ///
459        /// This starts, but does not poll, a longrunning operation. More information
460        /// on [update_service_connection_map][crate::client::CrossNetworkAutomationService::update_service_connection_map].
461        pub async fn send(self) -> Result<longrunning::model::Operation> {
462            (*self.0.stub)
463                .update_service_connection_map(self.0.request, self.0.options)
464                .await
465                .map(gax::response::Response::into_body)
466        }
467
468        /// Creates a [Poller][lro::Poller] to work with `update_service_connection_map`.
469        pub fn poller(
470            self,
471        ) -> impl lro::Poller<crate::model::ServiceConnectionMap, crate::model::OperationMetadata>
472        {
473            type Operation = lro::internal::Operation<
474                crate::model::ServiceConnectionMap,
475                crate::model::OperationMetadata,
476            >;
477            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
478            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
479
480            let stub = self.0.stub.clone();
481            let mut options = self.0.options.clone();
482            options.set_retry_policy(gax::retry_policy::NeverRetry);
483            let query = move |name| {
484                let stub = stub.clone();
485                let options = options.clone();
486                async {
487                    let op = GetOperation::new(stub)
488                        .set_name(name)
489                        .with_options(options)
490                        .send()
491                        .await?;
492                    Ok(Operation::new(op))
493                }
494            };
495
496            let start = move || async {
497                let op = self.send().await?;
498                Ok(Operation::new(op))
499            };
500
501            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
502        }
503
504        /// Sets the value of [update_mask][crate::model::UpdateServiceConnectionMapRequest::update_mask].
505        pub fn set_update_mask<T>(mut self, v: T) -> Self
506        where
507            T: std::convert::Into<wkt::FieldMask>,
508        {
509            self.0.request.update_mask = std::option::Option::Some(v.into());
510            self
511        }
512
513        /// Sets or clears the value of [update_mask][crate::model::UpdateServiceConnectionMapRequest::update_mask].
514        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
515        where
516            T: std::convert::Into<wkt::FieldMask>,
517        {
518            self.0.request.update_mask = v.map(|x| x.into());
519            self
520        }
521
522        /// Sets the value of [service_connection_map][crate::model::UpdateServiceConnectionMapRequest::service_connection_map].
523        ///
524        /// This is a **required** field for requests.
525        pub fn set_service_connection_map<T>(mut self, v: T) -> Self
526        where
527            T: std::convert::Into<crate::model::ServiceConnectionMap>,
528        {
529            self.0.request.service_connection_map = std::option::Option::Some(v.into());
530            self
531        }
532
533        /// Sets or clears the value of [service_connection_map][crate::model::UpdateServiceConnectionMapRequest::service_connection_map].
534        ///
535        /// This is a **required** field for requests.
536        pub fn set_or_clear_service_connection_map<T>(mut self, v: std::option::Option<T>) -> Self
537        where
538            T: std::convert::Into<crate::model::ServiceConnectionMap>,
539        {
540            self.0.request.service_connection_map = v.map(|x| x.into());
541            self
542        }
543
544        /// Sets the value of [request_id][crate::model::UpdateServiceConnectionMapRequest::request_id].
545        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
546            self.0.request.request_id = v.into();
547            self
548        }
549    }
550
551    #[doc(hidden)]
552    impl gax::options::internal::RequestBuilder for UpdateServiceConnectionMap {
553        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
554            &mut self.0.options
555        }
556    }
557
558    /// The request builder for [CrossNetworkAutomationService::delete_service_connection_map][crate::client::CrossNetworkAutomationService::delete_service_connection_map] calls.
559    ///
560    /// # Example
561    /// ```no_run
562    /// # use google_cloud_networkconnectivity_v1::builder;
563    /// use builder::cross_network_automation_service::DeleteServiceConnectionMap;
564    /// # tokio_test::block_on(async {
565    /// use lro::Poller;
566    ///
567    /// let builder = prepare_request_builder();
568    /// let response = builder.poller().until_done().await?;
569    /// # gax::Result::<()>::Ok(()) });
570    ///
571    /// fn prepare_request_builder() -> DeleteServiceConnectionMap {
572    ///   # panic!();
573    ///   // ... details omitted ...
574    /// }
575    /// ```
576    #[derive(Clone, Debug)]
577    pub struct DeleteServiceConnectionMap(
578        RequestBuilder<crate::model::DeleteServiceConnectionMapRequest>,
579    );
580
581    impl DeleteServiceConnectionMap {
582        pub(crate) fn new(
583            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
584        ) -> Self {
585            Self(RequestBuilder::new(stub))
586        }
587
588        /// Sets the full request, replacing any prior values.
589        pub fn with_request<V: Into<crate::model::DeleteServiceConnectionMapRequest>>(
590            mut self,
591            v: V,
592        ) -> Self {
593            self.0.request = v.into();
594            self
595        }
596
597        /// Sets all the options, replacing any prior values.
598        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
599            self.0.options = v.into();
600            self
601        }
602
603        /// Sends the request.
604        ///
605        /// # Long running operations
606        ///
607        /// This starts, but does not poll, a longrunning operation. More information
608        /// on [delete_service_connection_map][crate::client::CrossNetworkAutomationService::delete_service_connection_map].
609        pub async fn send(self) -> Result<longrunning::model::Operation> {
610            (*self.0.stub)
611                .delete_service_connection_map(self.0.request, self.0.options)
612                .await
613                .map(gax::response::Response::into_body)
614        }
615
616        /// Creates a [Poller][lro::Poller] to work with `delete_service_connection_map`.
617        pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
618            type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
619            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
620            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
621
622            let stub = self.0.stub.clone();
623            let mut options = self.0.options.clone();
624            options.set_retry_policy(gax::retry_policy::NeverRetry);
625            let query = move |name| {
626                let stub = stub.clone();
627                let options = options.clone();
628                async {
629                    let op = GetOperation::new(stub)
630                        .set_name(name)
631                        .with_options(options)
632                        .send()
633                        .await?;
634                    Ok(Operation::new(op))
635                }
636            };
637
638            let start = move || async {
639                let op = self.send().await?;
640                Ok(Operation::new(op))
641            };
642
643            lro::internal::new_unit_response_poller(
644                polling_error_policy,
645                polling_backoff_policy,
646                start,
647                query,
648            )
649        }
650
651        /// Sets the value of [name][crate::model::DeleteServiceConnectionMapRequest::name].
652        ///
653        /// This is a **required** field for requests.
654        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
655            self.0.request.name = v.into();
656            self
657        }
658
659        /// Sets the value of [request_id][crate::model::DeleteServiceConnectionMapRequest::request_id].
660        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
661            self.0.request.request_id = v.into();
662            self
663        }
664
665        /// Sets the value of [etag][crate::model::DeleteServiceConnectionMapRequest::etag].
666        pub fn set_etag<T>(mut self, v: T) -> Self
667        where
668            T: std::convert::Into<std::string::String>,
669        {
670            self.0.request.etag = std::option::Option::Some(v.into());
671            self
672        }
673
674        /// Sets or clears the value of [etag][crate::model::DeleteServiceConnectionMapRequest::etag].
675        pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
676        where
677            T: std::convert::Into<std::string::String>,
678        {
679            self.0.request.etag = v.map(|x| x.into());
680            self
681        }
682    }
683
684    #[doc(hidden)]
685    impl gax::options::internal::RequestBuilder for DeleteServiceConnectionMap {
686        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
687            &mut self.0.options
688        }
689    }
690
691    /// The request builder for [CrossNetworkAutomationService::list_service_connection_policies][crate::client::CrossNetworkAutomationService::list_service_connection_policies] calls.
692    ///
693    /// # Example
694    /// ```no_run
695    /// # use google_cloud_networkconnectivity_v1::builder;
696    /// use builder::cross_network_automation_service::ListServiceConnectionPolicies;
697    /// # tokio_test::block_on(async {
698    /// use gax::paginator::ItemPaginator;
699    ///
700    /// let builder = prepare_request_builder();
701    /// let mut items = builder.by_item();
702    /// while let Some(result) = items.next().await {
703    ///   let item = result?;
704    /// }
705    /// # gax::Result::<()>::Ok(()) });
706    ///
707    /// fn prepare_request_builder() -> ListServiceConnectionPolicies {
708    ///   # panic!();
709    ///   // ... details omitted ...
710    /// }
711    /// ```
712    #[derive(Clone, Debug)]
713    pub struct ListServiceConnectionPolicies(
714        RequestBuilder<crate::model::ListServiceConnectionPoliciesRequest>,
715    );
716
717    impl ListServiceConnectionPolicies {
718        pub(crate) fn new(
719            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
720        ) -> Self {
721            Self(RequestBuilder::new(stub))
722        }
723
724        /// Sets the full request, replacing any prior values.
725        pub fn with_request<V: Into<crate::model::ListServiceConnectionPoliciesRequest>>(
726            mut self,
727            v: V,
728        ) -> Self {
729            self.0.request = v.into();
730            self
731        }
732
733        /// Sets all the options, replacing any prior values.
734        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
735            self.0.options = v.into();
736            self
737        }
738
739        /// Sends the request.
740        pub async fn send(self) -> Result<crate::model::ListServiceConnectionPoliciesResponse> {
741            (*self.0.stub)
742                .list_service_connection_policies(self.0.request, self.0.options)
743                .await
744                .map(gax::response::Response::into_body)
745        }
746
747        /// Streams each page in the collection.
748        pub fn by_page(
749            self,
750        ) -> impl gax::paginator::Paginator<
751            crate::model::ListServiceConnectionPoliciesResponse,
752            gax::error::Error,
753        > {
754            use std::clone::Clone;
755            let token = self.0.request.page_token.clone();
756            let execute = move |token: String| {
757                let mut builder = self.clone();
758                builder.0.request = builder.0.request.set_page_token(token);
759                builder.send()
760            };
761            gax::paginator::internal::new_paginator(token, execute)
762        }
763
764        /// Streams each item in the collection.
765        pub fn by_item(
766            self,
767        ) -> impl gax::paginator::ItemPaginator<
768            crate::model::ListServiceConnectionPoliciesResponse,
769            gax::error::Error,
770        > {
771            use gax::paginator::Paginator;
772            self.by_page().items()
773        }
774
775        /// Sets the value of [parent][crate::model::ListServiceConnectionPoliciesRequest::parent].
776        ///
777        /// This is a **required** field for requests.
778        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
779            self.0.request.parent = v.into();
780            self
781        }
782
783        /// Sets the value of [page_size][crate::model::ListServiceConnectionPoliciesRequest::page_size].
784        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
785            self.0.request.page_size = v.into();
786            self
787        }
788
789        /// Sets the value of [page_token][crate::model::ListServiceConnectionPoliciesRequest::page_token].
790        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
791            self.0.request.page_token = v.into();
792            self
793        }
794
795        /// Sets the value of [filter][crate::model::ListServiceConnectionPoliciesRequest::filter].
796        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
797            self.0.request.filter = v.into();
798            self
799        }
800
801        /// Sets the value of [order_by][crate::model::ListServiceConnectionPoliciesRequest::order_by].
802        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
803            self.0.request.order_by = v.into();
804            self
805        }
806    }
807
808    #[doc(hidden)]
809    impl gax::options::internal::RequestBuilder for ListServiceConnectionPolicies {
810        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
811            &mut self.0.options
812        }
813    }
814
815    /// The request builder for [CrossNetworkAutomationService::get_service_connection_policy][crate::client::CrossNetworkAutomationService::get_service_connection_policy] calls.
816    ///
817    /// # Example
818    /// ```no_run
819    /// # use google_cloud_networkconnectivity_v1::builder;
820    /// use builder::cross_network_automation_service::GetServiceConnectionPolicy;
821    /// # tokio_test::block_on(async {
822    ///
823    /// let builder = prepare_request_builder();
824    /// let response = builder.send().await?;
825    /// # gax::Result::<()>::Ok(()) });
826    ///
827    /// fn prepare_request_builder() -> GetServiceConnectionPolicy {
828    ///   # panic!();
829    ///   // ... details omitted ...
830    /// }
831    /// ```
832    #[derive(Clone, Debug)]
833    pub struct GetServiceConnectionPolicy(
834        RequestBuilder<crate::model::GetServiceConnectionPolicyRequest>,
835    );
836
837    impl GetServiceConnectionPolicy {
838        pub(crate) fn new(
839            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
840        ) -> Self {
841            Self(RequestBuilder::new(stub))
842        }
843
844        /// Sets the full request, replacing any prior values.
845        pub fn with_request<V: Into<crate::model::GetServiceConnectionPolicyRequest>>(
846            mut self,
847            v: V,
848        ) -> Self {
849            self.0.request = v.into();
850            self
851        }
852
853        /// Sets all the options, replacing any prior values.
854        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
855            self.0.options = v.into();
856            self
857        }
858
859        /// Sends the request.
860        pub async fn send(self) -> Result<crate::model::ServiceConnectionPolicy> {
861            (*self.0.stub)
862                .get_service_connection_policy(self.0.request, self.0.options)
863                .await
864                .map(gax::response::Response::into_body)
865        }
866
867        /// Sets the value of [name][crate::model::GetServiceConnectionPolicyRequest::name].
868        ///
869        /// This is a **required** field for requests.
870        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
871            self.0.request.name = v.into();
872            self
873        }
874    }
875
876    #[doc(hidden)]
877    impl gax::options::internal::RequestBuilder for GetServiceConnectionPolicy {
878        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
879            &mut self.0.options
880        }
881    }
882
883    /// The request builder for [CrossNetworkAutomationService::create_service_connection_policy][crate::client::CrossNetworkAutomationService::create_service_connection_policy] calls.
884    ///
885    /// # Example
886    /// ```no_run
887    /// # use google_cloud_networkconnectivity_v1::builder;
888    /// use builder::cross_network_automation_service::CreateServiceConnectionPolicy;
889    /// # tokio_test::block_on(async {
890    /// use lro::Poller;
891    ///
892    /// let builder = prepare_request_builder();
893    /// let response = builder.poller().until_done().await?;
894    /// # gax::Result::<()>::Ok(()) });
895    ///
896    /// fn prepare_request_builder() -> CreateServiceConnectionPolicy {
897    ///   # panic!();
898    ///   // ... details omitted ...
899    /// }
900    /// ```
901    #[derive(Clone, Debug)]
902    pub struct CreateServiceConnectionPolicy(
903        RequestBuilder<crate::model::CreateServiceConnectionPolicyRequest>,
904    );
905
906    impl CreateServiceConnectionPolicy {
907        pub(crate) fn new(
908            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
909        ) -> Self {
910            Self(RequestBuilder::new(stub))
911        }
912
913        /// Sets the full request, replacing any prior values.
914        pub fn with_request<V: Into<crate::model::CreateServiceConnectionPolicyRequest>>(
915            mut self,
916            v: V,
917        ) -> Self {
918            self.0.request = v.into();
919            self
920        }
921
922        /// Sets all the options, replacing any prior values.
923        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
924            self.0.options = v.into();
925            self
926        }
927
928        /// Sends the request.
929        ///
930        /// # Long running operations
931        ///
932        /// This starts, but does not poll, a longrunning operation. More information
933        /// on [create_service_connection_policy][crate::client::CrossNetworkAutomationService::create_service_connection_policy].
934        pub async fn send(self) -> Result<longrunning::model::Operation> {
935            (*self.0.stub)
936                .create_service_connection_policy(self.0.request, self.0.options)
937                .await
938                .map(gax::response::Response::into_body)
939        }
940
941        /// Creates a [Poller][lro::Poller] to work with `create_service_connection_policy`.
942        pub fn poller(
943            self,
944        ) -> impl lro::Poller<crate::model::ServiceConnectionPolicy, crate::model::OperationMetadata>
945        {
946            type Operation = lro::internal::Operation<
947                crate::model::ServiceConnectionPolicy,
948                crate::model::OperationMetadata,
949            >;
950            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
951            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
952
953            let stub = self.0.stub.clone();
954            let mut options = self.0.options.clone();
955            options.set_retry_policy(gax::retry_policy::NeverRetry);
956            let query = move |name| {
957                let stub = stub.clone();
958                let options = options.clone();
959                async {
960                    let op = GetOperation::new(stub)
961                        .set_name(name)
962                        .with_options(options)
963                        .send()
964                        .await?;
965                    Ok(Operation::new(op))
966                }
967            };
968
969            let start = move || async {
970                let op = self.send().await?;
971                Ok(Operation::new(op))
972            };
973
974            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
975        }
976
977        /// Sets the value of [parent][crate::model::CreateServiceConnectionPolicyRequest::parent].
978        ///
979        /// This is a **required** field for requests.
980        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
981            self.0.request.parent = v.into();
982            self
983        }
984
985        /// Sets the value of [service_connection_policy_id][crate::model::CreateServiceConnectionPolicyRequest::service_connection_policy_id].
986        pub fn set_service_connection_policy_id<T: Into<std::string::String>>(
987            mut self,
988            v: T,
989        ) -> Self {
990            self.0.request.service_connection_policy_id = v.into();
991            self
992        }
993
994        /// Sets the value of [service_connection_policy][crate::model::CreateServiceConnectionPolicyRequest::service_connection_policy].
995        ///
996        /// This is a **required** field for requests.
997        pub fn set_service_connection_policy<T>(mut self, v: T) -> Self
998        where
999            T: std::convert::Into<crate::model::ServiceConnectionPolicy>,
1000        {
1001            self.0.request.service_connection_policy = std::option::Option::Some(v.into());
1002            self
1003        }
1004
1005        /// Sets or clears the value of [service_connection_policy][crate::model::CreateServiceConnectionPolicyRequest::service_connection_policy].
1006        ///
1007        /// This is a **required** field for requests.
1008        pub fn set_or_clear_service_connection_policy<T>(
1009            mut self,
1010            v: std::option::Option<T>,
1011        ) -> Self
1012        where
1013            T: std::convert::Into<crate::model::ServiceConnectionPolicy>,
1014        {
1015            self.0.request.service_connection_policy = v.map(|x| x.into());
1016            self
1017        }
1018
1019        /// Sets the value of [request_id][crate::model::CreateServiceConnectionPolicyRequest::request_id].
1020        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1021            self.0.request.request_id = v.into();
1022            self
1023        }
1024    }
1025
1026    #[doc(hidden)]
1027    impl gax::options::internal::RequestBuilder for CreateServiceConnectionPolicy {
1028        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1029            &mut self.0.options
1030        }
1031    }
1032
1033    /// The request builder for [CrossNetworkAutomationService::update_service_connection_policy][crate::client::CrossNetworkAutomationService::update_service_connection_policy] calls.
1034    ///
1035    /// # Example
1036    /// ```no_run
1037    /// # use google_cloud_networkconnectivity_v1::builder;
1038    /// use builder::cross_network_automation_service::UpdateServiceConnectionPolicy;
1039    /// # tokio_test::block_on(async {
1040    /// use lro::Poller;
1041    ///
1042    /// let builder = prepare_request_builder();
1043    /// let response = builder.poller().until_done().await?;
1044    /// # gax::Result::<()>::Ok(()) });
1045    ///
1046    /// fn prepare_request_builder() -> UpdateServiceConnectionPolicy {
1047    ///   # panic!();
1048    ///   // ... details omitted ...
1049    /// }
1050    /// ```
1051    #[derive(Clone, Debug)]
1052    pub struct UpdateServiceConnectionPolicy(
1053        RequestBuilder<crate::model::UpdateServiceConnectionPolicyRequest>,
1054    );
1055
1056    impl UpdateServiceConnectionPolicy {
1057        pub(crate) fn new(
1058            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1059        ) -> Self {
1060            Self(RequestBuilder::new(stub))
1061        }
1062
1063        /// Sets the full request, replacing any prior values.
1064        pub fn with_request<V: Into<crate::model::UpdateServiceConnectionPolicyRequest>>(
1065            mut self,
1066            v: V,
1067        ) -> Self {
1068            self.0.request = v.into();
1069            self
1070        }
1071
1072        /// Sets all the options, replacing any prior values.
1073        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1074            self.0.options = v.into();
1075            self
1076        }
1077
1078        /// Sends the request.
1079        ///
1080        /// # Long running operations
1081        ///
1082        /// This starts, but does not poll, a longrunning operation. More information
1083        /// on [update_service_connection_policy][crate::client::CrossNetworkAutomationService::update_service_connection_policy].
1084        pub async fn send(self) -> Result<longrunning::model::Operation> {
1085            (*self.0.stub)
1086                .update_service_connection_policy(self.0.request, self.0.options)
1087                .await
1088                .map(gax::response::Response::into_body)
1089        }
1090
1091        /// Creates a [Poller][lro::Poller] to work with `update_service_connection_policy`.
1092        pub fn poller(
1093            self,
1094        ) -> impl lro::Poller<crate::model::ServiceConnectionPolicy, crate::model::OperationMetadata>
1095        {
1096            type Operation = lro::internal::Operation<
1097                crate::model::ServiceConnectionPolicy,
1098                crate::model::OperationMetadata,
1099            >;
1100            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1101            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1102
1103            let stub = self.0.stub.clone();
1104            let mut options = self.0.options.clone();
1105            options.set_retry_policy(gax::retry_policy::NeverRetry);
1106            let query = move |name| {
1107                let stub = stub.clone();
1108                let options = options.clone();
1109                async {
1110                    let op = GetOperation::new(stub)
1111                        .set_name(name)
1112                        .with_options(options)
1113                        .send()
1114                        .await?;
1115                    Ok(Operation::new(op))
1116                }
1117            };
1118
1119            let start = move || async {
1120                let op = self.send().await?;
1121                Ok(Operation::new(op))
1122            };
1123
1124            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1125        }
1126
1127        /// Sets the value of [update_mask][crate::model::UpdateServiceConnectionPolicyRequest::update_mask].
1128        pub fn set_update_mask<T>(mut self, v: T) -> Self
1129        where
1130            T: std::convert::Into<wkt::FieldMask>,
1131        {
1132            self.0.request.update_mask = std::option::Option::Some(v.into());
1133            self
1134        }
1135
1136        /// Sets or clears the value of [update_mask][crate::model::UpdateServiceConnectionPolicyRequest::update_mask].
1137        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1138        where
1139            T: std::convert::Into<wkt::FieldMask>,
1140        {
1141            self.0.request.update_mask = v.map(|x| x.into());
1142            self
1143        }
1144
1145        /// Sets the value of [service_connection_policy][crate::model::UpdateServiceConnectionPolicyRequest::service_connection_policy].
1146        ///
1147        /// This is a **required** field for requests.
1148        pub fn set_service_connection_policy<T>(mut self, v: T) -> Self
1149        where
1150            T: std::convert::Into<crate::model::ServiceConnectionPolicy>,
1151        {
1152            self.0.request.service_connection_policy = std::option::Option::Some(v.into());
1153            self
1154        }
1155
1156        /// Sets or clears the value of [service_connection_policy][crate::model::UpdateServiceConnectionPolicyRequest::service_connection_policy].
1157        ///
1158        /// This is a **required** field for requests.
1159        pub fn set_or_clear_service_connection_policy<T>(
1160            mut self,
1161            v: std::option::Option<T>,
1162        ) -> Self
1163        where
1164            T: std::convert::Into<crate::model::ServiceConnectionPolicy>,
1165        {
1166            self.0.request.service_connection_policy = v.map(|x| x.into());
1167            self
1168        }
1169
1170        /// Sets the value of [request_id][crate::model::UpdateServiceConnectionPolicyRequest::request_id].
1171        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1172            self.0.request.request_id = v.into();
1173            self
1174        }
1175    }
1176
1177    #[doc(hidden)]
1178    impl gax::options::internal::RequestBuilder for UpdateServiceConnectionPolicy {
1179        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1180            &mut self.0.options
1181        }
1182    }
1183
1184    /// The request builder for [CrossNetworkAutomationService::delete_service_connection_policy][crate::client::CrossNetworkAutomationService::delete_service_connection_policy] calls.
1185    ///
1186    /// # Example
1187    /// ```no_run
1188    /// # use google_cloud_networkconnectivity_v1::builder;
1189    /// use builder::cross_network_automation_service::DeleteServiceConnectionPolicy;
1190    /// # tokio_test::block_on(async {
1191    /// use lro::Poller;
1192    ///
1193    /// let builder = prepare_request_builder();
1194    /// let response = builder.poller().until_done().await?;
1195    /// # gax::Result::<()>::Ok(()) });
1196    ///
1197    /// fn prepare_request_builder() -> DeleteServiceConnectionPolicy {
1198    ///   # panic!();
1199    ///   // ... details omitted ...
1200    /// }
1201    /// ```
1202    #[derive(Clone, Debug)]
1203    pub struct DeleteServiceConnectionPolicy(
1204        RequestBuilder<crate::model::DeleteServiceConnectionPolicyRequest>,
1205    );
1206
1207    impl DeleteServiceConnectionPolicy {
1208        pub(crate) fn new(
1209            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1210        ) -> Self {
1211            Self(RequestBuilder::new(stub))
1212        }
1213
1214        /// Sets the full request, replacing any prior values.
1215        pub fn with_request<V: Into<crate::model::DeleteServiceConnectionPolicyRequest>>(
1216            mut self,
1217            v: V,
1218        ) -> Self {
1219            self.0.request = v.into();
1220            self
1221        }
1222
1223        /// Sets all the options, replacing any prior values.
1224        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1225            self.0.options = v.into();
1226            self
1227        }
1228
1229        /// Sends the request.
1230        ///
1231        /// # Long running operations
1232        ///
1233        /// This starts, but does not poll, a longrunning operation. More information
1234        /// on [delete_service_connection_policy][crate::client::CrossNetworkAutomationService::delete_service_connection_policy].
1235        pub async fn send(self) -> Result<longrunning::model::Operation> {
1236            (*self.0.stub)
1237                .delete_service_connection_policy(self.0.request, self.0.options)
1238                .await
1239                .map(gax::response::Response::into_body)
1240        }
1241
1242        /// Creates a [Poller][lro::Poller] to work with `delete_service_connection_policy`.
1243        pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
1244            type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
1245            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1246            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1247
1248            let stub = self.0.stub.clone();
1249            let mut options = self.0.options.clone();
1250            options.set_retry_policy(gax::retry_policy::NeverRetry);
1251            let query = move |name| {
1252                let stub = stub.clone();
1253                let options = options.clone();
1254                async {
1255                    let op = GetOperation::new(stub)
1256                        .set_name(name)
1257                        .with_options(options)
1258                        .send()
1259                        .await?;
1260                    Ok(Operation::new(op))
1261                }
1262            };
1263
1264            let start = move || async {
1265                let op = self.send().await?;
1266                Ok(Operation::new(op))
1267            };
1268
1269            lro::internal::new_unit_response_poller(
1270                polling_error_policy,
1271                polling_backoff_policy,
1272                start,
1273                query,
1274            )
1275        }
1276
1277        /// Sets the value of [name][crate::model::DeleteServiceConnectionPolicyRequest::name].
1278        ///
1279        /// This is a **required** field for requests.
1280        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1281            self.0.request.name = v.into();
1282            self
1283        }
1284
1285        /// Sets the value of [request_id][crate::model::DeleteServiceConnectionPolicyRequest::request_id].
1286        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1287            self.0.request.request_id = v.into();
1288            self
1289        }
1290
1291        /// Sets the value of [etag][crate::model::DeleteServiceConnectionPolicyRequest::etag].
1292        pub fn set_etag<T>(mut self, v: T) -> Self
1293        where
1294            T: std::convert::Into<std::string::String>,
1295        {
1296            self.0.request.etag = std::option::Option::Some(v.into());
1297            self
1298        }
1299
1300        /// Sets or clears the value of [etag][crate::model::DeleteServiceConnectionPolicyRequest::etag].
1301        pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
1302        where
1303            T: std::convert::Into<std::string::String>,
1304        {
1305            self.0.request.etag = v.map(|x| x.into());
1306            self
1307        }
1308    }
1309
1310    #[doc(hidden)]
1311    impl gax::options::internal::RequestBuilder for DeleteServiceConnectionPolicy {
1312        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1313            &mut self.0.options
1314        }
1315    }
1316
1317    /// The request builder for [CrossNetworkAutomationService::list_service_classes][crate::client::CrossNetworkAutomationService::list_service_classes] calls.
1318    ///
1319    /// # Example
1320    /// ```no_run
1321    /// # use google_cloud_networkconnectivity_v1::builder;
1322    /// use builder::cross_network_automation_service::ListServiceClasses;
1323    /// # tokio_test::block_on(async {
1324    /// use gax::paginator::ItemPaginator;
1325    ///
1326    /// let builder = prepare_request_builder();
1327    /// let mut items = builder.by_item();
1328    /// while let Some(result) = items.next().await {
1329    ///   let item = result?;
1330    /// }
1331    /// # gax::Result::<()>::Ok(()) });
1332    ///
1333    /// fn prepare_request_builder() -> ListServiceClasses {
1334    ///   # panic!();
1335    ///   // ... details omitted ...
1336    /// }
1337    /// ```
1338    #[derive(Clone, Debug)]
1339    pub struct ListServiceClasses(RequestBuilder<crate::model::ListServiceClassesRequest>);
1340
1341    impl ListServiceClasses {
1342        pub(crate) fn new(
1343            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1344        ) -> Self {
1345            Self(RequestBuilder::new(stub))
1346        }
1347
1348        /// Sets the full request, replacing any prior values.
1349        pub fn with_request<V: Into<crate::model::ListServiceClassesRequest>>(
1350            mut self,
1351            v: V,
1352        ) -> Self {
1353            self.0.request = v.into();
1354            self
1355        }
1356
1357        /// Sets all the options, replacing any prior values.
1358        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1359            self.0.options = v.into();
1360            self
1361        }
1362
1363        /// Sends the request.
1364        pub async fn send(self) -> Result<crate::model::ListServiceClassesResponse> {
1365            (*self.0.stub)
1366                .list_service_classes(self.0.request, self.0.options)
1367                .await
1368                .map(gax::response::Response::into_body)
1369        }
1370
1371        /// Streams each page in the collection.
1372        pub fn by_page(
1373            self,
1374        ) -> impl gax::paginator::Paginator<crate::model::ListServiceClassesResponse, gax::error::Error>
1375        {
1376            use std::clone::Clone;
1377            let token = self.0.request.page_token.clone();
1378            let execute = move |token: String| {
1379                let mut builder = self.clone();
1380                builder.0.request = builder.0.request.set_page_token(token);
1381                builder.send()
1382            };
1383            gax::paginator::internal::new_paginator(token, execute)
1384        }
1385
1386        /// Streams each item in the collection.
1387        pub fn by_item(
1388            self,
1389        ) -> impl gax::paginator::ItemPaginator<
1390            crate::model::ListServiceClassesResponse,
1391            gax::error::Error,
1392        > {
1393            use gax::paginator::Paginator;
1394            self.by_page().items()
1395        }
1396
1397        /// Sets the value of [parent][crate::model::ListServiceClassesRequest::parent].
1398        ///
1399        /// This is a **required** field for requests.
1400        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1401            self.0.request.parent = v.into();
1402            self
1403        }
1404
1405        /// Sets the value of [page_size][crate::model::ListServiceClassesRequest::page_size].
1406        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1407            self.0.request.page_size = v.into();
1408            self
1409        }
1410
1411        /// Sets the value of [page_token][crate::model::ListServiceClassesRequest::page_token].
1412        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1413            self.0.request.page_token = v.into();
1414            self
1415        }
1416
1417        /// Sets the value of [filter][crate::model::ListServiceClassesRequest::filter].
1418        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1419            self.0.request.filter = v.into();
1420            self
1421        }
1422
1423        /// Sets the value of [order_by][crate::model::ListServiceClassesRequest::order_by].
1424        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1425            self.0.request.order_by = v.into();
1426            self
1427        }
1428    }
1429
1430    #[doc(hidden)]
1431    impl gax::options::internal::RequestBuilder for ListServiceClasses {
1432        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1433            &mut self.0.options
1434        }
1435    }
1436
1437    /// The request builder for [CrossNetworkAutomationService::get_service_class][crate::client::CrossNetworkAutomationService::get_service_class] calls.
1438    ///
1439    /// # Example
1440    /// ```no_run
1441    /// # use google_cloud_networkconnectivity_v1::builder;
1442    /// use builder::cross_network_automation_service::GetServiceClass;
1443    /// # tokio_test::block_on(async {
1444    ///
1445    /// let builder = prepare_request_builder();
1446    /// let response = builder.send().await?;
1447    /// # gax::Result::<()>::Ok(()) });
1448    ///
1449    /// fn prepare_request_builder() -> GetServiceClass {
1450    ///   # panic!();
1451    ///   // ... details omitted ...
1452    /// }
1453    /// ```
1454    #[derive(Clone, Debug)]
1455    pub struct GetServiceClass(RequestBuilder<crate::model::GetServiceClassRequest>);
1456
1457    impl GetServiceClass {
1458        pub(crate) fn new(
1459            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1460        ) -> Self {
1461            Self(RequestBuilder::new(stub))
1462        }
1463
1464        /// Sets the full request, replacing any prior values.
1465        pub fn with_request<V: Into<crate::model::GetServiceClassRequest>>(mut self, v: V) -> Self {
1466            self.0.request = v.into();
1467            self
1468        }
1469
1470        /// Sets all the options, replacing any prior values.
1471        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1472            self.0.options = v.into();
1473            self
1474        }
1475
1476        /// Sends the request.
1477        pub async fn send(self) -> Result<crate::model::ServiceClass> {
1478            (*self.0.stub)
1479                .get_service_class(self.0.request, self.0.options)
1480                .await
1481                .map(gax::response::Response::into_body)
1482        }
1483
1484        /// Sets the value of [name][crate::model::GetServiceClassRequest::name].
1485        ///
1486        /// This is a **required** field for requests.
1487        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1488            self.0.request.name = v.into();
1489            self
1490        }
1491    }
1492
1493    #[doc(hidden)]
1494    impl gax::options::internal::RequestBuilder for GetServiceClass {
1495        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1496            &mut self.0.options
1497        }
1498    }
1499
1500    /// The request builder for [CrossNetworkAutomationService::update_service_class][crate::client::CrossNetworkAutomationService::update_service_class] calls.
1501    ///
1502    /// # Example
1503    /// ```no_run
1504    /// # use google_cloud_networkconnectivity_v1::builder;
1505    /// use builder::cross_network_automation_service::UpdateServiceClass;
1506    /// # tokio_test::block_on(async {
1507    /// use lro::Poller;
1508    ///
1509    /// let builder = prepare_request_builder();
1510    /// let response = builder.poller().until_done().await?;
1511    /// # gax::Result::<()>::Ok(()) });
1512    ///
1513    /// fn prepare_request_builder() -> UpdateServiceClass {
1514    ///   # panic!();
1515    ///   // ... details omitted ...
1516    /// }
1517    /// ```
1518    #[derive(Clone, Debug)]
1519    pub struct UpdateServiceClass(RequestBuilder<crate::model::UpdateServiceClassRequest>);
1520
1521    impl UpdateServiceClass {
1522        pub(crate) fn new(
1523            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1524        ) -> Self {
1525            Self(RequestBuilder::new(stub))
1526        }
1527
1528        /// Sets the full request, replacing any prior values.
1529        pub fn with_request<V: Into<crate::model::UpdateServiceClassRequest>>(
1530            mut self,
1531            v: V,
1532        ) -> Self {
1533            self.0.request = v.into();
1534            self
1535        }
1536
1537        /// Sets all the options, replacing any prior values.
1538        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1539            self.0.options = v.into();
1540            self
1541        }
1542
1543        /// Sends the request.
1544        ///
1545        /// # Long running operations
1546        ///
1547        /// This starts, but does not poll, a longrunning operation. More information
1548        /// on [update_service_class][crate::client::CrossNetworkAutomationService::update_service_class].
1549        pub async fn send(self) -> Result<longrunning::model::Operation> {
1550            (*self.0.stub)
1551                .update_service_class(self.0.request, self.0.options)
1552                .await
1553                .map(gax::response::Response::into_body)
1554        }
1555
1556        /// Creates a [Poller][lro::Poller] to work with `update_service_class`.
1557        pub fn poller(
1558            self,
1559        ) -> impl lro::Poller<crate::model::ServiceClass, crate::model::OperationMetadata> {
1560            type Operation = lro::internal::Operation<
1561                crate::model::ServiceClass,
1562                crate::model::OperationMetadata,
1563            >;
1564            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1565            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1566
1567            let stub = self.0.stub.clone();
1568            let mut options = self.0.options.clone();
1569            options.set_retry_policy(gax::retry_policy::NeverRetry);
1570            let query = move |name| {
1571                let stub = stub.clone();
1572                let options = options.clone();
1573                async {
1574                    let op = GetOperation::new(stub)
1575                        .set_name(name)
1576                        .with_options(options)
1577                        .send()
1578                        .await?;
1579                    Ok(Operation::new(op))
1580                }
1581            };
1582
1583            let start = move || async {
1584                let op = self.send().await?;
1585                Ok(Operation::new(op))
1586            };
1587
1588            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1589        }
1590
1591        /// Sets the value of [update_mask][crate::model::UpdateServiceClassRequest::update_mask].
1592        pub fn set_update_mask<T>(mut self, v: T) -> Self
1593        where
1594            T: std::convert::Into<wkt::FieldMask>,
1595        {
1596            self.0.request.update_mask = std::option::Option::Some(v.into());
1597            self
1598        }
1599
1600        /// Sets or clears the value of [update_mask][crate::model::UpdateServiceClassRequest::update_mask].
1601        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1602        where
1603            T: std::convert::Into<wkt::FieldMask>,
1604        {
1605            self.0.request.update_mask = v.map(|x| x.into());
1606            self
1607        }
1608
1609        /// Sets the value of [service_class][crate::model::UpdateServiceClassRequest::service_class].
1610        ///
1611        /// This is a **required** field for requests.
1612        pub fn set_service_class<T>(mut self, v: T) -> Self
1613        where
1614            T: std::convert::Into<crate::model::ServiceClass>,
1615        {
1616            self.0.request.service_class = std::option::Option::Some(v.into());
1617            self
1618        }
1619
1620        /// Sets or clears the value of [service_class][crate::model::UpdateServiceClassRequest::service_class].
1621        ///
1622        /// This is a **required** field for requests.
1623        pub fn set_or_clear_service_class<T>(mut self, v: std::option::Option<T>) -> Self
1624        where
1625            T: std::convert::Into<crate::model::ServiceClass>,
1626        {
1627            self.0.request.service_class = v.map(|x| x.into());
1628            self
1629        }
1630
1631        /// Sets the value of [request_id][crate::model::UpdateServiceClassRequest::request_id].
1632        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1633            self.0.request.request_id = v.into();
1634            self
1635        }
1636    }
1637
1638    #[doc(hidden)]
1639    impl gax::options::internal::RequestBuilder for UpdateServiceClass {
1640        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1641            &mut self.0.options
1642        }
1643    }
1644
1645    /// The request builder for [CrossNetworkAutomationService::delete_service_class][crate::client::CrossNetworkAutomationService::delete_service_class] calls.
1646    ///
1647    /// # Example
1648    /// ```no_run
1649    /// # use google_cloud_networkconnectivity_v1::builder;
1650    /// use builder::cross_network_automation_service::DeleteServiceClass;
1651    /// # tokio_test::block_on(async {
1652    /// use lro::Poller;
1653    ///
1654    /// let builder = prepare_request_builder();
1655    /// let response = builder.poller().until_done().await?;
1656    /// # gax::Result::<()>::Ok(()) });
1657    ///
1658    /// fn prepare_request_builder() -> DeleteServiceClass {
1659    ///   # panic!();
1660    ///   // ... details omitted ...
1661    /// }
1662    /// ```
1663    #[derive(Clone, Debug)]
1664    pub struct DeleteServiceClass(RequestBuilder<crate::model::DeleteServiceClassRequest>);
1665
1666    impl DeleteServiceClass {
1667        pub(crate) fn new(
1668            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1669        ) -> Self {
1670            Self(RequestBuilder::new(stub))
1671        }
1672
1673        /// Sets the full request, replacing any prior values.
1674        pub fn with_request<V: Into<crate::model::DeleteServiceClassRequest>>(
1675            mut self,
1676            v: V,
1677        ) -> Self {
1678            self.0.request = v.into();
1679            self
1680        }
1681
1682        /// Sets all the options, replacing any prior values.
1683        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1684            self.0.options = v.into();
1685            self
1686        }
1687
1688        /// Sends the request.
1689        ///
1690        /// # Long running operations
1691        ///
1692        /// This starts, but does not poll, a longrunning operation. More information
1693        /// on [delete_service_class][crate::client::CrossNetworkAutomationService::delete_service_class].
1694        pub async fn send(self) -> Result<longrunning::model::Operation> {
1695            (*self.0.stub)
1696                .delete_service_class(self.0.request, self.0.options)
1697                .await
1698                .map(gax::response::Response::into_body)
1699        }
1700
1701        /// Creates a [Poller][lro::Poller] to work with `delete_service_class`.
1702        pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
1703            type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
1704            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1705            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1706
1707            let stub = self.0.stub.clone();
1708            let mut options = self.0.options.clone();
1709            options.set_retry_policy(gax::retry_policy::NeverRetry);
1710            let query = move |name| {
1711                let stub = stub.clone();
1712                let options = options.clone();
1713                async {
1714                    let op = GetOperation::new(stub)
1715                        .set_name(name)
1716                        .with_options(options)
1717                        .send()
1718                        .await?;
1719                    Ok(Operation::new(op))
1720                }
1721            };
1722
1723            let start = move || async {
1724                let op = self.send().await?;
1725                Ok(Operation::new(op))
1726            };
1727
1728            lro::internal::new_unit_response_poller(
1729                polling_error_policy,
1730                polling_backoff_policy,
1731                start,
1732                query,
1733            )
1734        }
1735
1736        /// Sets the value of [name][crate::model::DeleteServiceClassRequest::name].
1737        ///
1738        /// This is a **required** field for requests.
1739        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1740            self.0.request.name = v.into();
1741            self
1742        }
1743
1744        /// Sets the value of [request_id][crate::model::DeleteServiceClassRequest::request_id].
1745        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1746            self.0.request.request_id = v.into();
1747            self
1748        }
1749
1750        /// Sets the value of [etag][crate::model::DeleteServiceClassRequest::etag].
1751        pub fn set_etag<T>(mut self, v: T) -> Self
1752        where
1753            T: std::convert::Into<std::string::String>,
1754        {
1755            self.0.request.etag = std::option::Option::Some(v.into());
1756            self
1757        }
1758
1759        /// Sets or clears the value of [etag][crate::model::DeleteServiceClassRequest::etag].
1760        pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
1761        where
1762            T: std::convert::Into<std::string::String>,
1763        {
1764            self.0.request.etag = v.map(|x| x.into());
1765            self
1766        }
1767    }
1768
1769    #[doc(hidden)]
1770    impl gax::options::internal::RequestBuilder for DeleteServiceClass {
1771        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1772            &mut self.0.options
1773        }
1774    }
1775
1776    /// The request builder for [CrossNetworkAutomationService::get_service_connection_token][crate::client::CrossNetworkAutomationService::get_service_connection_token] calls.
1777    ///
1778    /// # Example
1779    /// ```no_run
1780    /// # use google_cloud_networkconnectivity_v1::builder;
1781    /// use builder::cross_network_automation_service::GetServiceConnectionToken;
1782    /// # tokio_test::block_on(async {
1783    ///
1784    /// let builder = prepare_request_builder();
1785    /// let response = builder.send().await?;
1786    /// # gax::Result::<()>::Ok(()) });
1787    ///
1788    /// fn prepare_request_builder() -> GetServiceConnectionToken {
1789    ///   # panic!();
1790    ///   // ... details omitted ...
1791    /// }
1792    /// ```
1793    #[derive(Clone, Debug)]
1794    pub struct GetServiceConnectionToken(
1795        RequestBuilder<crate::model::GetServiceConnectionTokenRequest>,
1796    );
1797
1798    impl GetServiceConnectionToken {
1799        pub(crate) fn new(
1800            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1801        ) -> Self {
1802            Self(RequestBuilder::new(stub))
1803        }
1804
1805        /// Sets the full request, replacing any prior values.
1806        pub fn with_request<V: Into<crate::model::GetServiceConnectionTokenRequest>>(
1807            mut self,
1808            v: V,
1809        ) -> Self {
1810            self.0.request = v.into();
1811            self
1812        }
1813
1814        /// Sets all the options, replacing any prior values.
1815        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1816            self.0.options = v.into();
1817            self
1818        }
1819
1820        /// Sends the request.
1821        pub async fn send(self) -> Result<crate::model::ServiceConnectionToken> {
1822            (*self.0.stub)
1823                .get_service_connection_token(self.0.request, self.0.options)
1824                .await
1825                .map(gax::response::Response::into_body)
1826        }
1827
1828        /// Sets the value of [name][crate::model::GetServiceConnectionTokenRequest::name].
1829        ///
1830        /// This is a **required** field for requests.
1831        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1832            self.0.request.name = v.into();
1833            self
1834        }
1835    }
1836
1837    #[doc(hidden)]
1838    impl gax::options::internal::RequestBuilder for GetServiceConnectionToken {
1839        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1840            &mut self.0.options
1841        }
1842    }
1843
1844    /// The request builder for [CrossNetworkAutomationService::list_service_connection_tokens][crate::client::CrossNetworkAutomationService::list_service_connection_tokens] calls.
1845    ///
1846    /// # Example
1847    /// ```no_run
1848    /// # use google_cloud_networkconnectivity_v1::builder;
1849    /// use builder::cross_network_automation_service::ListServiceConnectionTokens;
1850    /// # tokio_test::block_on(async {
1851    /// use gax::paginator::ItemPaginator;
1852    ///
1853    /// let builder = prepare_request_builder();
1854    /// let mut items = builder.by_item();
1855    /// while let Some(result) = items.next().await {
1856    ///   let item = result?;
1857    /// }
1858    /// # gax::Result::<()>::Ok(()) });
1859    ///
1860    /// fn prepare_request_builder() -> ListServiceConnectionTokens {
1861    ///   # panic!();
1862    ///   // ... details omitted ...
1863    /// }
1864    /// ```
1865    #[derive(Clone, Debug)]
1866    pub struct ListServiceConnectionTokens(
1867        RequestBuilder<crate::model::ListServiceConnectionTokensRequest>,
1868    );
1869
1870    impl ListServiceConnectionTokens {
1871        pub(crate) fn new(
1872            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1873        ) -> Self {
1874            Self(RequestBuilder::new(stub))
1875        }
1876
1877        /// Sets the full request, replacing any prior values.
1878        pub fn with_request<V: Into<crate::model::ListServiceConnectionTokensRequest>>(
1879            mut self,
1880            v: V,
1881        ) -> Self {
1882            self.0.request = v.into();
1883            self
1884        }
1885
1886        /// Sets all the options, replacing any prior values.
1887        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1888            self.0.options = v.into();
1889            self
1890        }
1891
1892        /// Sends the request.
1893        pub async fn send(self) -> Result<crate::model::ListServiceConnectionTokensResponse> {
1894            (*self.0.stub)
1895                .list_service_connection_tokens(self.0.request, self.0.options)
1896                .await
1897                .map(gax::response::Response::into_body)
1898        }
1899
1900        /// Streams each page in the collection.
1901        pub fn by_page(
1902            self,
1903        ) -> impl gax::paginator::Paginator<
1904            crate::model::ListServiceConnectionTokensResponse,
1905            gax::error::Error,
1906        > {
1907            use std::clone::Clone;
1908            let token = self.0.request.page_token.clone();
1909            let execute = move |token: String| {
1910                let mut builder = self.clone();
1911                builder.0.request = builder.0.request.set_page_token(token);
1912                builder.send()
1913            };
1914            gax::paginator::internal::new_paginator(token, execute)
1915        }
1916
1917        /// Streams each item in the collection.
1918        pub fn by_item(
1919            self,
1920        ) -> impl gax::paginator::ItemPaginator<
1921            crate::model::ListServiceConnectionTokensResponse,
1922            gax::error::Error,
1923        > {
1924            use gax::paginator::Paginator;
1925            self.by_page().items()
1926        }
1927
1928        /// Sets the value of [parent][crate::model::ListServiceConnectionTokensRequest::parent].
1929        ///
1930        /// This is a **required** field for requests.
1931        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1932            self.0.request.parent = v.into();
1933            self
1934        }
1935
1936        /// Sets the value of [page_size][crate::model::ListServiceConnectionTokensRequest::page_size].
1937        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1938            self.0.request.page_size = v.into();
1939            self
1940        }
1941
1942        /// Sets the value of [page_token][crate::model::ListServiceConnectionTokensRequest::page_token].
1943        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1944            self.0.request.page_token = v.into();
1945            self
1946        }
1947
1948        /// Sets the value of [filter][crate::model::ListServiceConnectionTokensRequest::filter].
1949        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1950            self.0.request.filter = v.into();
1951            self
1952        }
1953
1954        /// Sets the value of [order_by][crate::model::ListServiceConnectionTokensRequest::order_by].
1955        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1956            self.0.request.order_by = v.into();
1957            self
1958        }
1959    }
1960
1961    #[doc(hidden)]
1962    impl gax::options::internal::RequestBuilder for ListServiceConnectionTokens {
1963        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1964            &mut self.0.options
1965        }
1966    }
1967
1968    /// The request builder for [CrossNetworkAutomationService::create_service_connection_token][crate::client::CrossNetworkAutomationService::create_service_connection_token] calls.
1969    ///
1970    /// # Example
1971    /// ```no_run
1972    /// # use google_cloud_networkconnectivity_v1::builder;
1973    /// use builder::cross_network_automation_service::CreateServiceConnectionToken;
1974    /// # tokio_test::block_on(async {
1975    /// use lro::Poller;
1976    ///
1977    /// let builder = prepare_request_builder();
1978    /// let response = builder.poller().until_done().await?;
1979    /// # gax::Result::<()>::Ok(()) });
1980    ///
1981    /// fn prepare_request_builder() -> CreateServiceConnectionToken {
1982    ///   # panic!();
1983    ///   // ... details omitted ...
1984    /// }
1985    /// ```
1986    #[derive(Clone, Debug)]
1987    pub struct CreateServiceConnectionToken(
1988        RequestBuilder<crate::model::CreateServiceConnectionTokenRequest>,
1989    );
1990
1991    impl CreateServiceConnectionToken {
1992        pub(crate) fn new(
1993            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1994        ) -> Self {
1995            Self(RequestBuilder::new(stub))
1996        }
1997
1998        /// Sets the full request, replacing any prior values.
1999        pub fn with_request<V: Into<crate::model::CreateServiceConnectionTokenRequest>>(
2000            mut self,
2001            v: V,
2002        ) -> Self {
2003            self.0.request = v.into();
2004            self
2005        }
2006
2007        /// Sets all the options, replacing any prior values.
2008        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2009            self.0.options = v.into();
2010            self
2011        }
2012
2013        /// Sends the request.
2014        ///
2015        /// # Long running operations
2016        ///
2017        /// This starts, but does not poll, a longrunning operation. More information
2018        /// on [create_service_connection_token][crate::client::CrossNetworkAutomationService::create_service_connection_token].
2019        pub async fn send(self) -> Result<longrunning::model::Operation> {
2020            (*self.0.stub)
2021                .create_service_connection_token(self.0.request, self.0.options)
2022                .await
2023                .map(gax::response::Response::into_body)
2024        }
2025
2026        /// Creates a [Poller][lro::Poller] to work with `create_service_connection_token`.
2027        pub fn poller(
2028            self,
2029        ) -> impl lro::Poller<crate::model::ServiceConnectionToken, crate::model::OperationMetadata>
2030        {
2031            type Operation = lro::internal::Operation<
2032                crate::model::ServiceConnectionToken,
2033                crate::model::OperationMetadata,
2034            >;
2035            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2036            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2037
2038            let stub = self.0.stub.clone();
2039            let mut options = self.0.options.clone();
2040            options.set_retry_policy(gax::retry_policy::NeverRetry);
2041            let query = move |name| {
2042                let stub = stub.clone();
2043                let options = options.clone();
2044                async {
2045                    let op = GetOperation::new(stub)
2046                        .set_name(name)
2047                        .with_options(options)
2048                        .send()
2049                        .await?;
2050                    Ok(Operation::new(op))
2051                }
2052            };
2053
2054            let start = move || async {
2055                let op = self.send().await?;
2056                Ok(Operation::new(op))
2057            };
2058
2059            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2060        }
2061
2062        /// Sets the value of [parent][crate::model::CreateServiceConnectionTokenRequest::parent].
2063        ///
2064        /// This is a **required** field for requests.
2065        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2066            self.0.request.parent = v.into();
2067            self
2068        }
2069
2070        /// Sets the value of [service_connection_token_id][crate::model::CreateServiceConnectionTokenRequest::service_connection_token_id].
2071        pub fn set_service_connection_token_id<T: Into<std::string::String>>(
2072            mut self,
2073            v: T,
2074        ) -> Self {
2075            self.0.request.service_connection_token_id = v.into();
2076            self
2077        }
2078
2079        /// Sets the value of [service_connection_token][crate::model::CreateServiceConnectionTokenRequest::service_connection_token].
2080        ///
2081        /// This is a **required** field for requests.
2082        pub fn set_service_connection_token<T>(mut self, v: T) -> Self
2083        where
2084            T: std::convert::Into<crate::model::ServiceConnectionToken>,
2085        {
2086            self.0.request.service_connection_token = std::option::Option::Some(v.into());
2087            self
2088        }
2089
2090        /// Sets or clears the value of [service_connection_token][crate::model::CreateServiceConnectionTokenRequest::service_connection_token].
2091        ///
2092        /// This is a **required** field for requests.
2093        pub fn set_or_clear_service_connection_token<T>(mut self, v: std::option::Option<T>) -> Self
2094        where
2095            T: std::convert::Into<crate::model::ServiceConnectionToken>,
2096        {
2097            self.0.request.service_connection_token = v.map(|x| x.into());
2098            self
2099        }
2100
2101        /// Sets the value of [request_id][crate::model::CreateServiceConnectionTokenRequest::request_id].
2102        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2103            self.0.request.request_id = v.into();
2104            self
2105        }
2106    }
2107
2108    #[doc(hidden)]
2109    impl gax::options::internal::RequestBuilder for CreateServiceConnectionToken {
2110        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2111            &mut self.0.options
2112        }
2113    }
2114
2115    /// The request builder for [CrossNetworkAutomationService::delete_service_connection_token][crate::client::CrossNetworkAutomationService::delete_service_connection_token] calls.
2116    ///
2117    /// # Example
2118    /// ```no_run
2119    /// # use google_cloud_networkconnectivity_v1::builder;
2120    /// use builder::cross_network_automation_service::DeleteServiceConnectionToken;
2121    /// # tokio_test::block_on(async {
2122    /// use lro::Poller;
2123    ///
2124    /// let builder = prepare_request_builder();
2125    /// let response = builder.poller().until_done().await?;
2126    /// # gax::Result::<()>::Ok(()) });
2127    ///
2128    /// fn prepare_request_builder() -> DeleteServiceConnectionToken {
2129    ///   # panic!();
2130    ///   // ... details omitted ...
2131    /// }
2132    /// ```
2133    #[derive(Clone, Debug)]
2134    pub struct DeleteServiceConnectionToken(
2135        RequestBuilder<crate::model::DeleteServiceConnectionTokenRequest>,
2136    );
2137
2138    impl DeleteServiceConnectionToken {
2139        pub(crate) fn new(
2140            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2141        ) -> Self {
2142            Self(RequestBuilder::new(stub))
2143        }
2144
2145        /// Sets the full request, replacing any prior values.
2146        pub fn with_request<V: Into<crate::model::DeleteServiceConnectionTokenRequest>>(
2147            mut self,
2148            v: V,
2149        ) -> Self {
2150            self.0.request = v.into();
2151            self
2152        }
2153
2154        /// Sets all the options, replacing any prior values.
2155        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2156            self.0.options = v.into();
2157            self
2158        }
2159
2160        /// Sends the request.
2161        ///
2162        /// # Long running operations
2163        ///
2164        /// This starts, but does not poll, a longrunning operation. More information
2165        /// on [delete_service_connection_token][crate::client::CrossNetworkAutomationService::delete_service_connection_token].
2166        pub async fn send(self) -> Result<longrunning::model::Operation> {
2167            (*self.0.stub)
2168                .delete_service_connection_token(self.0.request, self.0.options)
2169                .await
2170                .map(gax::response::Response::into_body)
2171        }
2172
2173        /// Creates a [Poller][lro::Poller] to work with `delete_service_connection_token`.
2174        pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
2175            type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2176            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2177            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2178
2179            let stub = self.0.stub.clone();
2180            let mut options = self.0.options.clone();
2181            options.set_retry_policy(gax::retry_policy::NeverRetry);
2182            let query = move |name| {
2183                let stub = stub.clone();
2184                let options = options.clone();
2185                async {
2186                    let op = GetOperation::new(stub)
2187                        .set_name(name)
2188                        .with_options(options)
2189                        .send()
2190                        .await?;
2191                    Ok(Operation::new(op))
2192                }
2193            };
2194
2195            let start = move || async {
2196                let op = self.send().await?;
2197                Ok(Operation::new(op))
2198            };
2199
2200            lro::internal::new_unit_response_poller(
2201                polling_error_policy,
2202                polling_backoff_policy,
2203                start,
2204                query,
2205            )
2206        }
2207
2208        /// Sets the value of [name][crate::model::DeleteServiceConnectionTokenRequest::name].
2209        ///
2210        /// This is a **required** field for requests.
2211        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2212            self.0.request.name = v.into();
2213            self
2214        }
2215
2216        /// Sets the value of [request_id][crate::model::DeleteServiceConnectionTokenRequest::request_id].
2217        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2218            self.0.request.request_id = v.into();
2219            self
2220        }
2221
2222        /// Sets the value of [etag][crate::model::DeleteServiceConnectionTokenRequest::etag].
2223        pub fn set_etag<T>(mut self, v: T) -> Self
2224        where
2225            T: std::convert::Into<std::string::String>,
2226        {
2227            self.0.request.etag = std::option::Option::Some(v.into());
2228            self
2229        }
2230
2231        /// Sets or clears the value of [etag][crate::model::DeleteServiceConnectionTokenRequest::etag].
2232        pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
2233        where
2234            T: std::convert::Into<std::string::String>,
2235        {
2236            self.0.request.etag = v.map(|x| x.into());
2237            self
2238        }
2239    }
2240
2241    #[doc(hidden)]
2242    impl gax::options::internal::RequestBuilder for DeleteServiceConnectionToken {
2243        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2244            &mut self.0.options
2245        }
2246    }
2247
2248    /// The request builder for [CrossNetworkAutomationService::list_locations][crate::client::CrossNetworkAutomationService::list_locations] calls.
2249    ///
2250    /// # Example
2251    /// ```no_run
2252    /// # use google_cloud_networkconnectivity_v1::builder;
2253    /// use builder::cross_network_automation_service::ListLocations;
2254    /// # tokio_test::block_on(async {
2255    /// use gax::paginator::ItemPaginator;
2256    ///
2257    /// let builder = prepare_request_builder();
2258    /// let mut items = builder.by_item();
2259    /// while let Some(result) = items.next().await {
2260    ///   let item = result?;
2261    /// }
2262    /// # gax::Result::<()>::Ok(()) });
2263    ///
2264    /// fn prepare_request_builder() -> ListLocations {
2265    ///   # panic!();
2266    ///   // ... details omitted ...
2267    /// }
2268    /// ```
2269    #[derive(Clone, Debug)]
2270    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
2271
2272    impl ListLocations {
2273        pub(crate) fn new(
2274            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2275        ) -> Self {
2276            Self(RequestBuilder::new(stub))
2277        }
2278
2279        /// Sets the full request, replacing any prior values.
2280        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
2281            mut self,
2282            v: V,
2283        ) -> Self {
2284            self.0.request = v.into();
2285            self
2286        }
2287
2288        /// Sets all the options, replacing any prior values.
2289        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2290            self.0.options = v.into();
2291            self
2292        }
2293
2294        /// Sends the request.
2295        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
2296            (*self.0.stub)
2297                .list_locations(self.0.request, self.0.options)
2298                .await
2299                .map(gax::response::Response::into_body)
2300        }
2301
2302        /// Streams each page in the collection.
2303        pub fn by_page(
2304            self,
2305        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
2306        {
2307            use std::clone::Clone;
2308            let token = self.0.request.page_token.clone();
2309            let execute = move |token: String| {
2310                let mut builder = self.clone();
2311                builder.0.request = builder.0.request.set_page_token(token);
2312                builder.send()
2313            };
2314            gax::paginator::internal::new_paginator(token, execute)
2315        }
2316
2317        /// Streams each item in the collection.
2318        pub fn by_item(
2319            self,
2320        ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
2321        {
2322            use gax::paginator::Paginator;
2323            self.by_page().items()
2324        }
2325
2326        /// Sets the value of [name][location::model::ListLocationsRequest::name].
2327        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2328            self.0.request.name = v.into();
2329            self
2330        }
2331
2332        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
2333        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2334            self.0.request.filter = v.into();
2335            self
2336        }
2337
2338        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
2339        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2340            self.0.request.page_size = v.into();
2341            self
2342        }
2343
2344        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
2345        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2346            self.0.request.page_token = v.into();
2347            self
2348        }
2349    }
2350
2351    #[doc(hidden)]
2352    impl gax::options::internal::RequestBuilder for ListLocations {
2353        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2354            &mut self.0.options
2355        }
2356    }
2357
2358    /// The request builder for [CrossNetworkAutomationService::get_location][crate::client::CrossNetworkAutomationService::get_location] calls.
2359    ///
2360    /// # Example
2361    /// ```no_run
2362    /// # use google_cloud_networkconnectivity_v1::builder;
2363    /// use builder::cross_network_automation_service::GetLocation;
2364    /// # tokio_test::block_on(async {
2365    ///
2366    /// let builder = prepare_request_builder();
2367    /// let response = builder.send().await?;
2368    /// # gax::Result::<()>::Ok(()) });
2369    ///
2370    /// fn prepare_request_builder() -> GetLocation {
2371    ///   # panic!();
2372    ///   // ... details omitted ...
2373    /// }
2374    /// ```
2375    #[derive(Clone, Debug)]
2376    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
2377
2378    impl GetLocation {
2379        pub(crate) fn new(
2380            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2381        ) -> Self {
2382            Self(RequestBuilder::new(stub))
2383        }
2384
2385        /// Sets the full request, replacing any prior values.
2386        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
2387            self.0.request = v.into();
2388            self
2389        }
2390
2391        /// Sets all the options, replacing any prior values.
2392        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2393            self.0.options = v.into();
2394            self
2395        }
2396
2397        /// Sends the request.
2398        pub async fn send(self) -> Result<location::model::Location> {
2399            (*self.0.stub)
2400                .get_location(self.0.request, self.0.options)
2401                .await
2402                .map(gax::response::Response::into_body)
2403        }
2404
2405        /// Sets the value of [name][location::model::GetLocationRequest::name].
2406        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2407            self.0.request.name = v.into();
2408            self
2409        }
2410    }
2411
2412    #[doc(hidden)]
2413    impl gax::options::internal::RequestBuilder for GetLocation {
2414        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2415            &mut self.0.options
2416        }
2417    }
2418
2419    /// The request builder for [CrossNetworkAutomationService::set_iam_policy][crate::client::CrossNetworkAutomationService::set_iam_policy] calls.
2420    ///
2421    /// # Example
2422    /// ```no_run
2423    /// # use google_cloud_networkconnectivity_v1::builder;
2424    /// use builder::cross_network_automation_service::SetIamPolicy;
2425    /// # tokio_test::block_on(async {
2426    ///
2427    /// let builder = prepare_request_builder();
2428    /// let response = builder.send().await?;
2429    /// # gax::Result::<()>::Ok(()) });
2430    ///
2431    /// fn prepare_request_builder() -> SetIamPolicy {
2432    ///   # panic!();
2433    ///   // ... details omitted ...
2434    /// }
2435    /// ```
2436    #[derive(Clone, Debug)]
2437    pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
2438
2439    impl SetIamPolicy {
2440        pub(crate) fn new(
2441            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2442        ) -> Self {
2443            Self(RequestBuilder::new(stub))
2444        }
2445
2446        /// Sets the full request, replacing any prior values.
2447        pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
2448            self.0.request = v.into();
2449            self
2450        }
2451
2452        /// Sets all the options, replacing any prior values.
2453        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2454            self.0.options = v.into();
2455            self
2456        }
2457
2458        /// Sends the request.
2459        pub async fn send(self) -> Result<iam_v1::model::Policy> {
2460            (*self.0.stub)
2461                .set_iam_policy(self.0.request, self.0.options)
2462                .await
2463                .map(gax::response::Response::into_body)
2464        }
2465
2466        /// Sets the value of [resource][iam_v1::model::SetIamPolicyRequest::resource].
2467        ///
2468        /// This is a **required** field for requests.
2469        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2470            self.0.request.resource = v.into();
2471            self
2472        }
2473
2474        /// Sets the value of [policy][iam_v1::model::SetIamPolicyRequest::policy].
2475        ///
2476        /// This is a **required** field for requests.
2477        pub fn set_policy<T>(mut self, v: T) -> Self
2478        where
2479            T: std::convert::Into<iam_v1::model::Policy>,
2480        {
2481            self.0.request.policy = std::option::Option::Some(v.into());
2482            self
2483        }
2484
2485        /// Sets or clears the value of [policy][iam_v1::model::SetIamPolicyRequest::policy].
2486        ///
2487        /// This is a **required** field for requests.
2488        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
2489        where
2490            T: std::convert::Into<iam_v1::model::Policy>,
2491        {
2492            self.0.request.policy = v.map(|x| x.into());
2493            self
2494        }
2495
2496        /// Sets the value of [update_mask][iam_v1::model::SetIamPolicyRequest::update_mask].
2497        pub fn set_update_mask<T>(mut self, v: T) -> Self
2498        where
2499            T: std::convert::Into<wkt::FieldMask>,
2500        {
2501            self.0.request.update_mask = std::option::Option::Some(v.into());
2502            self
2503        }
2504
2505        /// Sets or clears the value of [update_mask][iam_v1::model::SetIamPolicyRequest::update_mask].
2506        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2507        where
2508            T: std::convert::Into<wkt::FieldMask>,
2509        {
2510            self.0.request.update_mask = v.map(|x| x.into());
2511            self
2512        }
2513    }
2514
2515    #[doc(hidden)]
2516    impl gax::options::internal::RequestBuilder for SetIamPolicy {
2517        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2518            &mut self.0.options
2519        }
2520    }
2521
2522    /// The request builder for [CrossNetworkAutomationService::get_iam_policy][crate::client::CrossNetworkAutomationService::get_iam_policy] calls.
2523    ///
2524    /// # Example
2525    /// ```no_run
2526    /// # use google_cloud_networkconnectivity_v1::builder;
2527    /// use builder::cross_network_automation_service::GetIamPolicy;
2528    /// # tokio_test::block_on(async {
2529    ///
2530    /// let builder = prepare_request_builder();
2531    /// let response = builder.send().await?;
2532    /// # gax::Result::<()>::Ok(()) });
2533    ///
2534    /// fn prepare_request_builder() -> GetIamPolicy {
2535    ///   # panic!();
2536    ///   // ... details omitted ...
2537    /// }
2538    /// ```
2539    #[derive(Clone, Debug)]
2540    pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
2541
2542    impl GetIamPolicy {
2543        pub(crate) fn new(
2544            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2545        ) -> Self {
2546            Self(RequestBuilder::new(stub))
2547        }
2548
2549        /// Sets the full request, replacing any prior values.
2550        pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
2551            self.0.request = v.into();
2552            self
2553        }
2554
2555        /// Sets all the options, replacing any prior values.
2556        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2557            self.0.options = v.into();
2558            self
2559        }
2560
2561        /// Sends the request.
2562        pub async fn send(self) -> Result<iam_v1::model::Policy> {
2563            (*self.0.stub)
2564                .get_iam_policy(self.0.request, self.0.options)
2565                .await
2566                .map(gax::response::Response::into_body)
2567        }
2568
2569        /// Sets the value of [resource][iam_v1::model::GetIamPolicyRequest::resource].
2570        ///
2571        /// This is a **required** field for requests.
2572        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2573            self.0.request.resource = v.into();
2574            self
2575        }
2576
2577        /// Sets the value of [options][iam_v1::model::GetIamPolicyRequest::options].
2578        pub fn set_options<T>(mut self, v: T) -> Self
2579        where
2580            T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
2581        {
2582            self.0.request.options = std::option::Option::Some(v.into());
2583            self
2584        }
2585
2586        /// Sets or clears the value of [options][iam_v1::model::GetIamPolicyRequest::options].
2587        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
2588        where
2589            T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
2590        {
2591            self.0.request.options = v.map(|x| x.into());
2592            self
2593        }
2594    }
2595
2596    #[doc(hidden)]
2597    impl gax::options::internal::RequestBuilder for GetIamPolicy {
2598        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2599            &mut self.0.options
2600        }
2601    }
2602
2603    /// The request builder for [CrossNetworkAutomationService::test_iam_permissions][crate::client::CrossNetworkAutomationService::test_iam_permissions] calls.
2604    ///
2605    /// # Example
2606    /// ```no_run
2607    /// # use google_cloud_networkconnectivity_v1::builder;
2608    /// use builder::cross_network_automation_service::TestIamPermissions;
2609    /// # tokio_test::block_on(async {
2610    ///
2611    /// let builder = prepare_request_builder();
2612    /// let response = builder.send().await?;
2613    /// # gax::Result::<()>::Ok(()) });
2614    ///
2615    /// fn prepare_request_builder() -> TestIamPermissions {
2616    ///   # panic!();
2617    ///   // ... details omitted ...
2618    /// }
2619    /// ```
2620    #[derive(Clone, Debug)]
2621    pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
2622
2623    impl TestIamPermissions {
2624        pub(crate) fn new(
2625            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2626        ) -> Self {
2627            Self(RequestBuilder::new(stub))
2628        }
2629
2630        /// Sets the full request, replacing any prior values.
2631        pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
2632            mut self,
2633            v: V,
2634        ) -> Self {
2635            self.0.request = v.into();
2636            self
2637        }
2638
2639        /// Sets all the options, replacing any prior values.
2640        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2641            self.0.options = v.into();
2642            self
2643        }
2644
2645        /// Sends the request.
2646        pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
2647            (*self.0.stub)
2648                .test_iam_permissions(self.0.request, self.0.options)
2649                .await
2650                .map(gax::response::Response::into_body)
2651        }
2652
2653        /// Sets the value of [resource][iam_v1::model::TestIamPermissionsRequest::resource].
2654        ///
2655        /// This is a **required** field for requests.
2656        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2657            self.0.request.resource = v.into();
2658            self
2659        }
2660
2661        /// Sets the value of [permissions][iam_v1::model::TestIamPermissionsRequest::permissions].
2662        ///
2663        /// This is a **required** field for requests.
2664        pub fn set_permissions<T, V>(mut self, v: T) -> Self
2665        where
2666            T: std::iter::IntoIterator<Item = V>,
2667            V: std::convert::Into<std::string::String>,
2668        {
2669            use std::iter::Iterator;
2670            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
2671            self
2672        }
2673    }
2674
2675    #[doc(hidden)]
2676    impl gax::options::internal::RequestBuilder for TestIamPermissions {
2677        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2678            &mut self.0.options
2679        }
2680    }
2681
2682    /// The request builder for [CrossNetworkAutomationService::list_operations][crate::client::CrossNetworkAutomationService::list_operations] calls.
2683    ///
2684    /// # Example
2685    /// ```no_run
2686    /// # use google_cloud_networkconnectivity_v1::builder;
2687    /// use builder::cross_network_automation_service::ListOperations;
2688    /// # tokio_test::block_on(async {
2689    /// use gax::paginator::ItemPaginator;
2690    ///
2691    /// let builder = prepare_request_builder();
2692    /// let mut items = builder.by_item();
2693    /// while let Some(result) = items.next().await {
2694    ///   let item = result?;
2695    /// }
2696    /// # gax::Result::<()>::Ok(()) });
2697    ///
2698    /// fn prepare_request_builder() -> ListOperations {
2699    ///   # panic!();
2700    ///   // ... details omitted ...
2701    /// }
2702    /// ```
2703    #[derive(Clone, Debug)]
2704    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
2705
2706    impl ListOperations {
2707        pub(crate) fn new(
2708            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2709        ) -> Self {
2710            Self(RequestBuilder::new(stub))
2711        }
2712
2713        /// Sets the full request, replacing any prior values.
2714        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
2715            mut self,
2716            v: V,
2717        ) -> Self {
2718            self.0.request = v.into();
2719            self
2720        }
2721
2722        /// Sets all the options, replacing any prior values.
2723        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2724            self.0.options = v.into();
2725            self
2726        }
2727
2728        /// Sends the request.
2729        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
2730            (*self.0.stub)
2731                .list_operations(self.0.request, self.0.options)
2732                .await
2733                .map(gax::response::Response::into_body)
2734        }
2735
2736        /// Streams each page in the collection.
2737        pub fn by_page(
2738            self,
2739        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
2740        {
2741            use std::clone::Clone;
2742            let token = self.0.request.page_token.clone();
2743            let execute = move |token: String| {
2744                let mut builder = self.clone();
2745                builder.0.request = builder.0.request.set_page_token(token);
2746                builder.send()
2747            };
2748            gax::paginator::internal::new_paginator(token, execute)
2749        }
2750
2751        /// Streams each item in the collection.
2752        pub fn by_item(
2753            self,
2754        ) -> impl gax::paginator::ItemPaginator<
2755            longrunning::model::ListOperationsResponse,
2756            gax::error::Error,
2757        > {
2758            use gax::paginator::Paginator;
2759            self.by_page().items()
2760        }
2761
2762        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
2763        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2764            self.0.request.name = v.into();
2765            self
2766        }
2767
2768        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
2769        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2770            self.0.request.filter = v.into();
2771            self
2772        }
2773
2774        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
2775        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2776            self.0.request.page_size = v.into();
2777            self
2778        }
2779
2780        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
2781        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2782            self.0.request.page_token = v.into();
2783            self
2784        }
2785    }
2786
2787    #[doc(hidden)]
2788    impl gax::options::internal::RequestBuilder for ListOperations {
2789        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2790            &mut self.0.options
2791        }
2792    }
2793
2794    /// The request builder for [CrossNetworkAutomationService::get_operation][crate::client::CrossNetworkAutomationService::get_operation] calls.
2795    ///
2796    /// # Example
2797    /// ```no_run
2798    /// # use google_cloud_networkconnectivity_v1::builder;
2799    /// use builder::cross_network_automation_service::GetOperation;
2800    /// # tokio_test::block_on(async {
2801    ///
2802    /// let builder = prepare_request_builder();
2803    /// let response = builder.send().await?;
2804    /// # gax::Result::<()>::Ok(()) });
2805    ///
2806    /// fn prepare_request_builder() -> GetOperation {
2807    ///   # panic!();
2808    ///   // ... details omitted ...
2809    /// }
2810    /// ```
2811    #[derive(Clone, Debug)]
2812    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
2813
2814    impl GetOperation {
2815        pub(crate) fn new(
2816            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2817        ) -> Self {
2818            Self(RequestBuilder::new(stub))
2819        }
2820
2821        /// Sets the full request, replacing any prior values.
2822        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
2823            mut self,
2824            v: V,
2825        ) -> Self {
2826            self.0.request = v.into();
2827            self
2828        }
2829
2830        /// Sets all the options, replacing any prior values.
2831        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2832            self.0.options = v.into();
2833            self
2834        }
2835
2836        /// Sends the request.
2837        pub async fn send(self) -> Result<longrunning::model::Operation> {
2838            (*self.0.stub)
2839                .get_operation(self.0.request, self.0.options)
2840                .await
2841                .map(gax::response::Response::into_body)
2842        }
2843
2844        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
2845        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2846            self.0.request.name = v.into();
2847            self
2848        }
2849    }
2850
2851    #[doc(hidden)]
2852    impl gax::options::internal::RequestBuilder for GetOperation {
2853        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2854            &mut self.0.options
2855        }
2856    }
2857
2858    /// The request builder for [CrossNetworkAutomationService::delete_operation][crate::client::CrossNetworkAutomationService::delete_operation] calls.
2859    ///
2860    /// # Example
2861    /// ```no_run
2862    /// # use google_cloud_networkconnectivity_v1::builder;
2863    /// use builder::cross_network_automation_service::DeleteOperation;
2864    /// # tokio_test::block_on(async {
2865    ///
2866    /// let builder = prepare_request_builder();
2867    /// let response = builder.send().await?;
2868    /// # gax::Result::<()>::Ok(()) });
2869    ///
2870    /// fn prepare_request_builder() -> DeleteOperation {
2871    ///   # panic!();
2872    ///   // ... details omitted ...
2873    /// }
2874    /// ```
2875    #[derive(Clone, Debug)]
2876    pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
2877
2878    impl DeleteOperation {
2879        pub(crate) fn new(
2880            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2881        ) -> Self {
2882            Self(RequestBuilder::new(stub))
2883        }
2884
2885        /// Sets the full request, replacing any prior values.
2886        pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
2887            mut self,
2888            v: V,
2889        ) -> Self {
2890            self.0.request = v.into();
2891            self
2892        }
2893
2894        /// Sets all the options, replacing any prior values.
2895        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2896            self.0.options = v.into();
2897            self
2898        }
2899
2900        /// Sends the request.
2901        pub async fn send(self) -> Result<()> {
2902            (*self.0.stub)
2903                .delete_operation(self.0.request, self.0.options)
2904                .await
2905                .map(gax::response::Response::into_body)
2906        }
2907
2908        /// Sets the value of [name][longrunning::model::DeleteOperationRequest::name].
2909        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2910            self.0.request.name = v.into();
2911            self
2912        }
2913    }
2914
2915    #[doc(hidden)]
2916    impl gax::options::internal::RequestBuilder for DeleteOperation {
2917        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2918            &mut self.0.options
2919        }
2920    }
2921
2922    /// The request builder for [CrossNetworkAutomationService::cancel_operation][crate::client::CrossNetworkAutomationService::cancel_operation] calls.
2923    ///
2924    /// # Example
2925    /// ```no_run
2926    /// # use google_cloud_networkconnectivity_v1::builder;
2927    /// use builder::cross_network_automation_service::CancelOperation;
2928    /// # tokio_test::block_on(async {
2929    ///
2930    /// let builder = prepare_request_builder();
2931    /// let response = builder.send().await?;
2932    /// # gax::Result::<()>::Ok(()) });
2933    ///
2934    /// fn prepare_request_builder() -> CancelOperation {
2935    ///   # panic!();
2936    ///   // ... details omitted ...
2937    /// }
2938    /// ```
2939    #[derive(Clone, Debug)]
2940    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
2941
2942    impl CancelOperation {
2943        pub(crate) fn new(
2944            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2945        ) -> Self {
2946            Self(RequestBuilder::new(stub))
2947        }
2948
2949        /// Sets the full request, replacing any prior values.
2950        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
2951            mut self,
2952            v: V,
2953        ) -> Self {
2954            self.0.request = v.into();
2955            self
2956        }
2957
2958        /// Sets all the options, replacing any prior values.
2959        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2960            self.0.options = v.into();
2961            self
2962        }
2963
2964        /// Sends the request.
2965        pub async fn send(self) -> Result<()> {
2966            (*self.0.stub)
2967                .cancel_operation(self.0.request, self.0.options)
2968                .await
2969                .map(gax::response::Response::into_body)
2970        }
2971
2972        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
2973        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2974            self.0.request.name = v.into();
2975            self
2976        }
2977    }
2978
2979    #[doc(hidden)]
2980    impl gax::options::internal::RequestBuilder for CancelOperation {
2981        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2982            &mut self.0.options
2983        }
2984    }
2985}
2986
2987pub mod hub_service {
2988    use crate::Result;
2989
2990    /// A builder for [HubService][crate::client::HubService].
2991    ///
2992    /// ```
2993    /// # tokio_test::block_on(async {
2994    /// # use google_cloud_networkconnectivity_v1::*;
2995    /// # use builder::hub_service::ClientBuilder;
2996    /// # use client::HubService;
2997    /// let builder : ClientBuilder = HubService::builder();
2998    /// let client = builder
2999    ///     .with_endpoint("https://networkconnectivity.googleapis.com")
3000    ///     .build().await?;
3001    /// # gax::client_builder::Result::<()>::Ok(()) });
3002    /// ```
3003    pub type ClientBuilder =
3004        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
3005
3006    pub(crate) mod client {
3007        use super::super::super::client::HubService;
3008        pub struct Factory;
3009        impl gax::client_builder::internal::ClientFactory for Factory {
3010            type Client = HubService;
3011            type Credentials = gaxi::options::Credentials;
3012            async fn build(
3013                self,
3014                config: gaxi::options::ClientConfig,
3015            ) -> gax::client_builder::Result<Self::Client> {
3016                Self::Client::new(config).await
3017            }
3018        }
3019    }
3020
3021    /// Common implementation for [crate::client::HubService] request builders.
3022    #[derive(Clone, Debug)]
3023    pub(crate) struct RequestBuilder<R: std::default::Default> {
3024        stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
3025        request: R,
3026        options: gax::options::RequestOptions,
3027    }
3028
3029    impl<R> RequestBuilder<R>
3030    where
3031        R: std::default::Default,
3032    {
3033        pub(crate) fn new(
3034            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
3035        ) -> Self {
3036            Self {
3037                stub,
3038                request: R::default(),
3039                options: gax::options::RequestOptions::default(),
3040            }
3041        }
3042    }
3043
3044    /// The request builder for [HubService::list_hubs][crate::client::HubService::list_hubs] calls.
3045    ///
3046    /// # Example
3047    /// ```no_run
3048    /// # use google_cloud_networkconnectivity_v1::builder;
3049    /// use builder::hub_service::ListHubs;
3050    /// # tokio_test::block_on(async {
3051    /// use gax::paginator::ItemPaginator;
3052    ///
3053    /// let builder = prepare_request_builder();
3054    /// let mut items = builder.by_item();
3055    /// while let Some(result) = items.next().await {
3056    ///   let item = result?;
3057    /// }
3058    /// # gax::Result::<()>::Ok(()) });
3059    ///
3060    /// fn prepare_request_builder() -> ListHubs {
3061    ///   # panic!();
3062    ///   // ... details omitted ...
3063    /// }
3064    /// ```
3065    #[derive(Clone, Debug)]
3066    pub struct ListHubs(RequestBuilder<crate::model::ListHubsRequest>);
3067
3068    impl ListHubs {
3069        pub(crate) fn new(
3070            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
3071        ) -> Self {
3072            Self(RequestBuilder::new(stub))
3073        }
3074
3075        /// Sets the full request, replacing any prior values.
3076        pub fn with_request<V: Into<crate::model::ListHubsRequest>>(mut self, v: V) -> Self {
3077            self.0.request = v.into();
3078            self
3079        }
3080
3081        /// Sets all the options, replacing any prior values.
3082        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3083            self.0.options = v.into();
3084            self
3085        }
3086
3087        /// Sends the request.
3088        pub async fn send(self) -> Result<crate::model::ListHubsResponse> {
3089            (*self.0.stub)
3090                .list_hubs(self.0.request, self.0.options)
3091                .await
3092                .map(gax::response::Response::into_body)
3093        }
3094
3095        /// Streams each page in the collection.
3096        pub fn by_page(
3097            self,
3098        ) -> impl gax::paginator::Paginator<crate::model::ListHubsResponse, gax::error::Error>
3099        {
3100            use std::clone::Clone;
3101            let token = self.0.request.page_token.clone();
3102            let execute = move |token: String| {
3103                let mut builder = self.clone();
3104                builder.0.request = builder.0.request.set_page_token(token);
3105                builder.send()
3106            };
3107            gax::paginator::internal::new_paginator(token, execute)
3108        }
3109
3110        /// Streams each item in the collection.
3111        pub fn by_item(
3112            self,
3113        ) -> impl gax::paginator::ItemPaginator<crate::model::ListHubsResponse, gax::error::Error>
3114        {
3115            use gax::paginator::Paginator;
3116            self.by_page().items()
3117        }
3118
3119        /// Sets the value of [parent][crate::model::ListHubsRequest::parent].
3120        ///
3121        /// This is a **required** field for requests.
3122        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3123            self.0.request.parent = v.into();
3124            self
3125        }
3126
3127        /// Sets the value of [page_size][crate::model::ListHubsRequest::page_size].
3128        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3129            self.0.request.page_size = v.into();
3130            self
3131        }
3132
3133        /// Sets the value of [page_token][crate::model::ListHubsRequest::page_token].
3134        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3135            self.0.request.page_token = v.into();
3136            self
3137        }
3138
3139        /// Sets the value of [filter][crate::model::ListHubsRequest::filter].
3140        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3141            self.0.request.filter = v.into();
3142            self
3143        }
3144
3145        /// Sets the value of [order_by][crate::model::ListHubsRequest::order_by].
3146        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3147            self.0.request.order_by = v.into();
3148            self
3149        }
3150    }
3151
3152    #[doc(hidden)]
3153    impl gax::options::internal::RequestBuilder for ListHubs {
3154        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3155            &mut self.0.options
3156        }
3157    }
3158
3159    /// The request builder for [HubService::get_hub][crate::client::HubService::get_hub] calls.
3160    ///
3161    /// # Example
3162    /// ```no_run
3163    /// # use google_cloud_networkconnectivity_v1::builder;
3164    /// use builder::hub_service::GetHub;
3165    /// # tokio_test::block_on(async {
3166    ///
3167    /// let builder = prepare_request_builder();
3168    /// let response = builder.send().await?;
3169    /// # gax::Result::<()>::Ok(()) });
3170    ///
3171    /// fn prepare_request_builder() -> GetHub {
3172    ///   # panic!();
3173    ///   // ... details omitted ...
3174    /// }
3175    /// ```
3176    #[derive(Clone, Debug)]
3177    pub struct GetHub(RequestBuilder<crate::model::GetHubRequest>);
3178
3179    impl GetHub {
3180        pub(crate) fn new(
3181            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
3182        ) -> Self {
3183            Self(RequestBuilder::new(stub))
3184        }
3185
3186        /// Sets the full request, replacing any prior values.
3187        pub fn with_request<V: Into<crate::model::GetHubRequest>>(mut self, v: V) -> Self {
3188            self.0.request = v.into();
3189            self
3190        }
3191
3192        /// Sets all the options, replacing any prior values.
3193        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3194            self.0.options = v.into();
3195            self
3196        }
3197
3198        /// Sends the request.
3199        pub async fn send(self) -> Result<crate::model::Hub> {
3200            (*self.0.stub)
3201                .get_hub(self.0.request, self.0.options)
3202                .await
3203                .map(gax::response::Response::into_body)
3204        }
3205
3206        /// Sets the value of [name][crate::model::GetHubRequest::name].
3207        ///
3208        /// This is a **required** field for requests.
3209        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3210            self.0.request.name = v.into();
3211            self
3212        }
3213    }
3214
3215    #[doc(hidden)]
3216    impl gax::options::internal::RequestBuilder for GetHub {
3217        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3218            &mut self.0.options
3219        }
3220    }
3221
3222    /// The request builder for [HubService::create_hub][crate::client::HubService::create_hub] calls.
3223    ///
3224    /// # Example
3225    /// ```no_run
3226    /// # use google_cloud_networkconnectivity_v1::builder;
3227    /// use builder::hub_service::CreateHub;
3228    /// # tokio_test::block_on(async {
3229    /// use lro::Poller;
3230    ///
3231    /// let builder = prepare_request_builder();
3232    /// let response = builder.poller().until_done().await?;
3233    /// # gax::Result::<()>::Ok(()) });
3234    ///
3235    /// fn prepare_request_builder() -> CreateHub {
3236    ///   # panic!();
3237    ///   // ... details omitted ...
3238    /// }
3239    /// ```
3240    #[derive(Clone, Debug)]
3241    pub struct CreateHub(RequestBuilder<crate::model::CreateHubRequest>);
3242
3243    impl CreateHub {
3244        pub(crate) fn new(
3245            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
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::CreateHubRequest>>(mut self, v: V) -> Self {
3252            self.0.request = v.into();
3253            self
3254        }
3255
3256        /// Sets all the options, replacing any prior values.
3257        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3258            self.0.options = v.into();
3259            self
3260        }
3261
3262        /// Sends the request.
3263        ///
3264        /// # Long running operations
3265        ///
3266        /// This starts, but does not poll, a longrunning operation. More information
3267        /// on [create_hub][crate::client::HubService::create_hub].
3268        pub async fn send(self) -> Result<longrunning::model::Operation> {
3269            (*self.0.stub)
3270                .create_hub(self.0.request, self.0.options)
3271                .await
3272                .map(gax::response::Response::into_body)
3273        }
3274
3275        /// Creates a [Poller][lro::Poller] to work with `create_hub`.
3276        pub fn poller(
3277            self,
3278        ) -> impl lro::Poller<crate::model::Hub, crate::model::OperationMetadata> {
3279            type Operation =
3280                lro::internal::Operation<crate::model::Hub, crate::model::OperationMetadata>;
3281            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3282            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3283
3284            let stub = self.0.stub.clone();
3285            let mut options = self.0.options.clone();
3286            options.set_retry_policy(gax::retry_policy::NeverRetry);
3287            let query = move |name| {
3288                let stub = stub.clone();
3289                let options = options.clone();
3290                async {
3291                    let op = GetOperation::new(stub)
3292                        .set_name(name)
3293                        .with_options(options)
3294                        .send()
3295                        .await?;
3296                    Ok(Operation::new(op))
3297                }
3298            };
3299
3300            let start = move || async {
3301                let op = self.send().await?;
3302                Ok(Operation::new(op))
3303            };
3304
3305            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3306        }
3307
3308        /// Sets the value of [parent][crate::model::CreateHubRequest::parent].
3309        ///
3310        /// This is a **required** field for requests.
3311        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3312            self.0.request.parent = v.into();
3313            self
3314        }
3315
3316        /// Sets the value of [hub_id][crate::model::CreateHubRequest::hub_id].
3317        ///
3318        /// This is a **required** field for requests.
3319        pub fn set_hub_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3320            self.0.request.hub_id = v.into();
3321            self
3322        }
3323
3324        /// Sets the value of [hub][crate::model::CreateHubRequest::hub].
3325        ///
3326        /// This is a **required** field for requests.
3327        pub fn set_hub<T>(mut self, v: T) -> Self
3328        where
3329            T: std::convert::Into<crate::model::Hub>,
3330        {
3331            self.0.request.hub = std::option::Option::Some(v.into());
3332            self
3333        }
3334
3335        /// Sets or clears the value of [hub][crate::model::CreateHubRequest::hub].
3336        ///
3337        /// This is a **required** field for requests.
3338        pub fn set_or_clear_hub<T>(mut self, v: std::option::Option<T>) -> Self
3339        where
3340            T: std::convert::Into<crate::model::Hub>,
3341        {
3342            self.0.request.hub = v.map(|x| x.into());
3343            self
3344        }
3345
3346        /// Sets the value of [request_id][crate::model::CreateHubRequest::request_id].
3347        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3348            self.0.request.request_id = v.into();
3349            self
3350        }
3351    }
3352
3353    #[doc(hidden)]
3354    impl gax::options::internal::RequestBuilder for CreateHub {
3355        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3356            &mut self.0.options
3357        }
3358    }
3359
3360    /// The request builder for [HubService::update_hub][crate::client::HubService::update_hub] calls.
3361    ///
3362    /// # Example
3363    /// ```no_run
3364    /// # use google_cloud_networkconnectivity_v1::builder;
3365    /// use builder::hub_service::UpdateHub;
3366    /// # tokio_test::block_on(async {
3367    /// use lro::Poller;
3368    ///
3369    /// let builder = prepare_request_builder();
3370    /// let response = builder.poller().until_done().await?;
3371    /// # gax::Result::<()>::Ok(()) });
3372    ///
3373    /// fn prepare_request_builder() -> UpdateHub {
3374    ///   # panic!();
3375    ///   // ... details omitted ...
3376    /// }
3377    /// ```
3378    #[derive(Clone, Debug)]
3379    pub struct UpdateHub(RequestBuilder<crate::model::UpdateHubRequest>);
3380
3381    impl UpdateHub {
3382        pub(crate) fn new(
3383            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
3384        ) -> Self {
3385            Self(RequestBuilder::new(stub))
3386        }
3387
3388        /// Sets the full request, replacing any prior values.
3389        pub fn with_request<V: Into<crate::model::UpdateHubRequest>>(mut self, v: V) -> Self {
3390            self.0.request = v.into();
3391            self
3392        }
3393
3394        /// Sets all the options, replacing any prior values.
3395        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3396            self.0.options = v.into();
3397            self
3398        }
3399
3400        /// Sends the request.
3401        ///
3402        /// # Long running operations
3403        ///
3404        /// This starts, but does not poll, a longrunning operation. More information
3405        /// on [update_hub][crate::client::HubService::update_hub].
3406        pub async fn send(self) -> Result<longrunning::model::Operation> {
3407            (*self.0.stub)
3408                .update_hub(self.0.request, self.0.options)
3409                .await
3410                .map(gax::response::Response::into_body)
3411        }
3412
3413        /// Creates a [Poller][lro::Poller] to work with `update_hub`.
3414        pub fn poller(
3415            self,
3416        ) -> impl lro::Poller<crate::model::Hub, crate::model::OperationMetadata> {
3417            type Operation =
3418                lro::internal::Operation<crate::model::Hub, crate::model::OperationMetadata>;
3419            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3420            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3421
3422            let stub = self.0.stub.clone();
3423            let mut options = self.0.options.clone();
3424            options.set_retry_policy(gax::retry_policy::NeverRetry);
3425            let query = move |name| {
3426                let stub = stub.clone();
3427                let options = options.clone();
3428                async {
3429                    let op = GetOperation::new(stub)
3430                        .set_name(name)
3431                        .with_options(options)
3432                        .send()
3433                        .await?;
3434                    Ok(Operation::new(op))
3435                }
3436            };
3437
3438            let start = move || async {
3439                let op = self.send().await?;
3440                Ok(Operation::new(op))
3441            };
3442
3443            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3444        }
3445
3446        /// Sets the value of [update_mask][crate::model::UpdateHubRequest::update_mask].
3447        pub fn set_update_mask<T>(mut self, v: T) -> Self
3448        where
3449            T: std::convert::Into<wkt::FieldMask>,
3450        {
3451            self.0.request.update_mask = std::option::Option::Some(v.into());
3452            self
3453        }
3454
3455        /// Sets or clears the value of [update_mask][crate::model::UpdateHubRequest::update_mask].
3456        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3457        where
3458            T: std::convert::Into<wkt::FieldMask>,
3459        {
3460            self.0.request.update_mask = v.map(|x| x.into());
3461            self
3462        }
3463
3464        /// Sets the value of [hub][crate::model::UpdateHubRequest::hub].
3465        ///
3466        /// This is a **required** field for requests.
3467        pub fn set_hub<T>(mut self, v: T) -> Self
3468        where
3469            T: std::convert::Into<crate::model::Hub>,
3470        {
3471            self.0.request.hub = std::option::Option::Some(v.into());
3472            self
3473        }
3474
3475        /// Sets or clears the value of [hub][crate::model::UpdateHubRequest::hub].
3476        ///
3477        /// This is a **required** field for requests.
3478        pub fn set_or_clear_hub<T>(mut self, v: std::option::Option<T>) -> Self
3479        where
3480            T: std::convert::Into<crate::model::Hub>,
3481        {
3482            self.0.request.hub = v.map(|x| x.into());
3483            self
3484        }
3485
3486        /// Sets the value of [request_id][crate::model::UpdateHubRequest::request_id].
3487        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3488            self.0.request.request_id = v.into();
3489            self
3490        }
3491    }
3492
3493    #[doc(hidden)]
3494    impl gax::options::internal::RequestBuilder for UpdateHub {
3495        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3496            &mut self.0.options
3497        }
3498    }
3499
3500    /// The request builder for [HubService::delete_hub][crate::client::HubService::delete_hub] calls.
3501    ///
3502    /// # Example
3503    /// ```no_run
3504    /// # use google_cloud_networkconnectivity_v1::builder;
3505    /// use builder::hub_service::DeleteHub;
3506    /// # tokio_test::block_on(async {
3507    /// use lro::Poller;
3508    ///
3509    /// let builder = prepare_request_builder();
3510    /// let response = builder.poller().until_done().await?;
3511    /// # gax::Result::<()>::Ok(()) });
3512    ///
3513    /// fn prepare_request_builder() -> DeleteHub {
3514    ///   # panic!();
3515    ///   // ... details omitted ...
3516    /// }
3517    /// ```
3518    #[derive(Clone, Debug)]
3519    pub struct DeleteHub(RequestBuilder<crate::model::DeleteHubRequest>);
3520
3521    impl DeleteHub {
3522        pub(crate) fn new(
3523            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
3524        ) -> Self {
3525            Self(RequestBuilder::new(stub))
3526        }
3527
3528        /// Sets the full request, replacing any prior values.
3529        pub fn with_request<V: Into<crate::model::DeleteHubRequest>>(mut self, v: V) -> Self {
3530            self.0.request = v.into();
3531            self
3532        }
3533
3534        /// Sets all the options, replacing any prior values.
3535        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3536            self.0.options = v.into();
3537            self
3538        }
3539
3540        /// Sends the request.
3541        ///
3542        /// # Long running operations
3543        ///
3544        /// This starts, but does not poll, a longrunning operation. More information
3545        /// on [delete_hub][crate::client::HubService::delete_hub].
3546        pub async fn send(self) -> Result<longrunning::model::Operation> {
3547            (*self.0.stub)
3548                .delete_hub(self.0.request, self.0.options)
3549                .await
3550                .map(gax::response::Response::into_body)
3551        }
3552
3553        /// Creates a [Poller][lro::Poller] to work with `delete_hub`.
3554        pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
3555            type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
3556            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3557            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3558
3559            let stub = self.0.stub.clone();
3560            let mut options = self.0.options.clone();
3561            options.set_retry_policy(gax::retry_policy::NeverRetry);
3562            let query = move |name| {
3563                let stub = stub.clone();
3564                let options = options.clone();
3565                async {
3566                    let op = GetOperation::new(stub)
3567                        .set_name(name)
3568                        .with_options(options)
3569                        .send()
3570                        .await?;
3571                    Ok(Operation::new(op))
3572                }
3573            };
3574
3575            let start = move || async {
3576                let op = self.send().await?;
3577                Ok(Operation::new(op))
3578            };
3579
3580            lro::internal::new_unit_response_poller(
3581                polling_error_policy,
3582                polling_backoff_policy,
3583                start,
3584                query,
3585            )
3586        }
3587
3588        /// Sets the value of [name][crate::model::DeleteHubRequest::name].
3589        ///
3590        /// This is a **required** field for requests.
3591        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3592            self.0.request.name = v.into();
3593            self
3594        }
3595
3596        /// Sets the value of [request_id][crate::model::DeleteHubRequest::request_id].
3597        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3598            self.0.request.request_id = v.into();
3599            self
3600        }
3601    }
3602
3603    #[doc(hidden)]
3604    impl gax::options::internal::RequestBuilder for DeleteHub {
3605        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3606            &mut self.0.options
3607        }
3608    }
3609
3610    /// The request builder for [HubService::list_hub_spokes][crate::client::HubService::list_hub_spokes] calls.
3611    ///
3612    /// # Example
3613    /// ```no_run
3614    /// # use google_cloud_networkconnectivity_v1::builder;
3615    /// use builder::hub_service::ListHubSpokes;
3616    /// # tokio_test::block_on(async {
3617    /// use gax::paginator::ItemPaginator;
3618    ///
3619    /// let builder = prepare_request_builder();
3620    /// let mut items = builder.by_item();
3621    /// while let Some(result) = items.next().await {
3622    ///   let item = result?;
3623    /// }
3624    /// # gax::Result::<()>::Ok(()) });
3625    ///
3626    /// fn prepare_request_builder() -> ListHubSpokes {
3627    ///   # panic!();
3628    ///   // ... details omitted ...
3629    /// }
3630    /// ```
3631    #[derive(Clone, Debug)]
3632    pub struct ListHubSpokes(RequestBuilder<crate::model::ListHubSpokesRequest>);
3633
3634    impl ListHubSpokes {
3635        pub(crate) fn new(
3636            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
3637        ) -> Self {
3638            Self(RequestBuilder::new(stub))
3639        }
3640
3641        /// Sets the full request, replacing any prior values.
3642        pub fn with_request<V: Into<crate::model::ListHubSpokesRequest>>(mut self, v: V) -> Self {
3643            self.0.request = v.into();
3644            self
3645        }
3646
3647        /// Sets all the options, replacing any prior values.
3648        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3649            self.0.options = v.into();
3650            self
3651        }
3652
3653        /// Sends the request.
3654        pub async fn send(self) -> Result<crate::model::ListHubSpokesResponse> {
3655            (*self.0.stub)
3656                .list_hub_spokes(self.0.request, self.0.options)
3657                .await
3658                .map(gax::response::Response::into_body)
3659        }
3660
3661        /// Streams each page in the collection.
3662        pub fn by_page(
3663            self,
3664        ) -> impl gax::paginator::Paginator<crate::model::ListHubSpokesResponse, gax::error::Error>
3665        {
3666            use std::clone::Clone;
3667            let token = self.0.request.page_token.clone();
3668            let execute = move |token: String| {
3669                let mut builder = self.clone();
3670                builder.0.request = builder.0.request.set_page_token(token);
3671                builder.send()
3672            };
3673            gax::paginator::internal::new_paginator(token, execute)
3674        }
3675
3676        /// Streams each item in the collection.
3677        pub fn by_item(
3678            self,
3679        ) -> impl gax::paginator::ItemPaginator<crate::model::ListHubSpokesResponse, gax::error::Error>
3680        {
3681            use gax::paginator::Paginator;
3682            self.by_page().items()
3683        }
3684
3685        /// Sets the value of [name][crate::model::ListHubSpokesRequest::name].
3686        ///
3687        /// This is a **required** field for requests.
3688        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3689            self.0.request.name = v.into();
3690            self
3691        }
3692
3693        /// Sets the value of [spoke_locations][crate::model::ListHubSpokesRequest::spoke_locations].
3694        pub fn set_spoke_locations<T, V>(mut self, v: T) -> Self
3695        where
3696            T: std::iter::IntoIterator<Item = V>,
3697            V: std::convert::Into<std::string::String>,
3698        {
3699            use std::iter::Iterator;
3700            self.0.request.spoke_locations = v.into_iter().map(|i| i.into()).collect();
3701            self
3702        }
3703
3704        /// Sets the value of [page_size][crate::model::ListHubSpokesRequest::page_size].
3705        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3706            self.0.request.page_size = v.into();
3707            self
3708        }
3709
3710        /// Sets the value of [page_token][crate::model::ListHubSpokesRequest::page_token].
3711        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3712            self.0.request.page_token = v.into();
3713            self
3714        }
3715
3716        /// Sets the value of [filter][crate::model::ListHubSpokesRequest::filter].
3717        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3718            self.0.request.filter = v.into();
3719            self
3720        }
3721
3722        /// Sets the value of [order_by][crate::model::ListHubSpokesRequest::order_by].
3723        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3724            self.0.request.order_by = v.into();
3725            self
3726        }
3727
3728        /// Sets the value of [view][crate::model::ListHubSpokesRequest::view].
3729        pub fn set_view<T: Into<crate::model::list_hub_spokes_request::SpokeView>>(
3730            mut self,
3731            v: T,
3732        ) -> Self {
3733            self.0.request.view = v.into();
3734            self
3735        }
3736    }
3737
3738    #[doc(hidden)]
3739    impl gax::options::internal::RequestBuilder for ListHubSpokes {
3740        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3741            &mut self.0.options
3742        }
3743    }
3744
3745    /// The request builder for [HubService::query_hub_status][crate::client::HubService::query_hub_status] calls.
3746    ///
3747    /// # Example
3748    /// ```no_run
3749    /// # use google_cloud_networkconnectivity_v1::builder;
3750    /// use builder::hub_service::QueryHubStatus;
3751    /// # tokio_test::block_on(async {
3752    /// use gax::paginator::ItemPaginator;
3753    ///
3754    /// let builder = prepare_request_builder();
3755    /// let mut items = builder.by_item();
3756    /// while let Some(result) = items.next().await {
3757    ///   let item = result?;
3758    /// }
3759    /// # gax::Result::<()>::Ok(()) });
3760    ///
3761    /// fn prepare_request_builder() -> QueryHubStatus {
3762    ///   # panic!();
3763    ///   // ... details omitted ...
3764    /// }
3765    /// ```
3766    #[derive(Clone, Debug)]
3767    pub struct QueryHubStatus(RequestBuilder<crate::model::QueryHubStatusRequest>);
3768
3769    impl QueryHubStatus {
3770        pub(crate) fn new(
3771            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
3772        ) -> Self {
3773            Self(RequestBuilder::new(stub))
3774        }
3775
3776        /// Sets the full request, replacing any prior values.
3777        pub fn with_request<V: Into<crate::model::QueryHubStatusRequest>>(mut self, v: V) -> Self {
3778            self.0.request = v.into();
3779            self
3780        }
3781
3782        /// Sets all the options, replacing any prior values.
3783        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3784            self.0.options = v.into();
3785            self
3786        }
3787
3788        /// Sends the request.
3789        pub async fn send(self) -> Result<crate::model::QueryHubStatusResponse> {
3790            (*self.0.stub)
3791                .query_hub_status(self.0.request, self.0.options)
3792                .await
3793                .map(gax::response::Response::into_body)
3794        }
3795
3796        /// Streams each page in the collection.
3797        pub fn by_page(
3798            self,
3799        ) -> impl gax::paginator::Paginator<crate::model::QueryHubStatusResponse, gax::error::Error>
3800        {
3801            use std::clone::Clone;
3802            let token = self.0.request.page_token.clone();
3803            let execute = move |token: String| {
3804                let mut builder = self.clone();
3805                builder.0.request = builder.0.request.set_page_token(token);
3806                builder.send()
3807            };
3808            gax::paginator::internal::new_paginator(token, execute)
3809        }
3810
3811        /// Streams each item in the collection.
3812        pub fn by_item(
3813            self,
3814        ) -> impl gax::paginator::ItemPaginator<crate::model::QueryHubStatusResponse, gax::error::Error>
3815        {
3816            use gax::paginator::Paginator;
3817            self.by_page().items()
3818        }
3819
3820        /// Sets the value of [name][crate::model::QueryHubStatusRequest::name].
3821        ///
3822        /// This is a **required** field for requests.
3823        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3824            self.0.request.name = v.into();
3825            self
3826        }
3827
3828        /// Sets the value of [page_size][crate::model::QueryHubStatusRequest::page_size].
3829        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3830            self.0.request.page_size = v.into();
3831            self
3832        }
3833
3834        /// Sets the value of [page_token][crate::model::QueryHubStatusRequest::page_token].
3835        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3836            self.0.request.page_token = v.into();
3837            self
3838        }
3839
3840        /// Sets the value of [filter][crate::model::QueryHubStatusRequest::filter].
3841        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3842            self.0.request.filter = v.into();
3843            self
3844        }
3845
3846        /// Sets the value of [order_by][crate::model::QueryHubStatusRequest::order_by].
3847        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3848            self.0.request.order_by = v.into();
3849            self
3850        }
3851
3852        /// Sets the value of [group_by][crate::model::QueryHubStatusRequest::group_by].
3853        pub fn set_group_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3854            self.0.request.group_by = v.into();
3855            self
3856        }
3857    }
3858
3859    #[doc(hidden)]
3860    impl gax::options::internal::RequestBuilder for QueryHubStatus {
3861        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3862            &mut self.0.options
3863        }
3864    }
3865
3866    /// The request builder for [HubService::list_spokes][crate::client::HubService::list_spokes] calls.
3867    ///
3868    /// # Example
3869    /// ```no_run
3870    /// # use google_cloud_networkconnectivity_v1::builder;
3871    /// use builder::hub_service::ListSpokes;
3872    /// # tokio_test::block_on(async {
3873    /// use gax::paginator::ItemPaginator;
3874    ///
3875    /// let builder = prepare_request_builder();
3876    /// let mut items = builder.by_item();
3877    /// while let Some(result) = items.next().await {
3878    ///   let item = result?;
3879    /// }
3880    /// # gax::Result::<()>::Ok(()) });
3881    ///
3882    /// fn prepare_request_builder() -> ListSpokes {
3883    ///   # panic!();
3884    ///   // ... details omitted ...
3885    /// }
3886    /// ```
3887    #[derive(Clone, Debug)]
3888    pub struct ListSpokes(RequestBuilder<crate::model::ListSpokesRequest>);
3889
3890    impl ListSpokes {
3891        pub(crate) fn new(
3892            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
3893        ) -> Self {
3894            Self(RequestBuilder::new(stub))
3895        }
3896
3897        /// Sets the full request, replacing any prior values.
3898        pub fn with_request<V: Into<crate::model::ListSpokesRequest>>(mut self, v: V) -> Self {
3899            self.0.request = v.into();
3900            self
3901        }
3902
3903        /// Sets all the options, replacing any prior values.
3904        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3905            self.0.options = v.into();
3906            self
3907        }
3908
3909        /// Sends the request.
3910        pub async fn send(self) -> Result<crate::model::ListSpokesResponse> {
3911            (*self.0.stub)
3912                .list_spokes(self.0.request, self.0.options)
3913                .await
3914                .map(gax::response::Response::into_body)
3915        }
3916
3917        /// Streams each page in the collection.
3918        pub fn by_page(
3919            self,
3920        ) -> impl gax::paginator::Paginator<crate::model::ListSpokesResponse, gax::error::Error>
3921        {
3922            use std::clone::Clone;
3923            let token = self.0.request.page_token.clone();
3924            let execute = move |token: String| {
3925                let mut builder = self.clone();
3926                builder.0.request = builder.0.request.set_page_token(token);
3927                builder.send()
3928            };
3929            gax::paginator::internal::new_paginator(token, execute)
3930        }
3931
3932        /// Streams each item in the collection.
3933        pub fn by_item(
3934            self,
3935        ) -> impl gax::paginator::ItemPaginator<crate::model::ListSpokesResponse, gax::error::Error>
3936        {
3937            use gax::paginator::Paginator;
3938            self.by_page().items()
3939        }
3940
3941        /// Sets the value of [parent][crate::model::ListSpokesRequest::parent].
3942        ///
3943        /// This is a **required** field for requests.
3944        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3945            self.0.request.parent = v.into();
3946            self
3947        }
3948
3949        /// Sets the value of [page_size][crate::model::ListSpokesRequest::page_size].
3950        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3951            self.0.request.page_size = v.into();
3952            self
3953        }
3954
3955        /// Sets the value of [page_token][crate::model::ListSpokesRequest::page_token].
3956        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3957            self.0.request.page_token = v.into();
3958            self
3959        }
3960
3961        /// Sets the value of [filter][crate::model::ListSpokesRequest::filter].
3962        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3963            self.0.request.filter = v.into();
3964            self
3965        }
3966
3967        /// Sets the value of [order_by][crate::model::ListSpokesRequest::order_by].
3968        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3969            self.0.request.order_by = v.into();
3970            self
3971        }
3972    }
3973
3974    #[doc(hidden)]
3975    impl gax::options::internal::RequestBuilder for ListSpokes {
3976        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3977            &mut self.0.options
3978        }
3979    }
3980
3981    /// The request builder for [HubService::get_spoke][crate::client::HubService::get_spoke] calls.
3982    ///
3983    /// # Example
3984    /// ```no_run
3985    /// # use google_cloud_networkconnectivity_v1::builder;
3986    /// use builder::hub_service::GetSpoke;
3987    /// # tokio_test::block_on(async {
3988    ///
3989    /// let builder = prepare_request_builder();
3990    /// let response = builder.send().await?;
3991    /// # gax::Result::<()>::Ok(()) });
3992    ///
3993    /// fn prepare_request_builder() -> GetSpoke {
3994    ///   # panic!();
3995    ///   // ... details omitted ...
3996    /// }
3997    /// ```
3998    #[derive(Clone, Debug)]
3999    pub struct GetSpoke(RequestBuilder<crate::model::GetSpokeRequest>);
4000
4001    impl GetSpoke {
4002        pub(crate) fn new(
4003            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
4004        ) -> Self {
4005            Self(RequestBuilder::new(stub))
4006        }
4007
4008        /// Sets the full request, replacing any prior values.
4009        pub fn with_request<V: Into<crate::model::GetSpokeRequest>>(mut self, v: V) -> Self {
4010            self.0.request = v.into();
4011            self
4012        }
4013
4014        /// Sets all the options, replacing any prior values.
4015        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4016            self.0.options = v.into();
4017            self
4018        }
4019
4020        /// Sends the request.
4021        pub async fn send(self) -> Result<crate::model::Spoke> {
4022            (*self.0.stub)
4023                .get_spoke(self.0.request, self.0.options)
4024                .await
4025                .map(gax::response::Response::into_body)
4026        }
4027
4028        /// Sets the value of [name][crate::model::GetSpokeRequest::name].
4029        ///
4030        /// This is a **required** field for requests.
4031        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4032            self.0.request.name = v.into();
4033            self
4034        }
4035    }
4036
4037    #[doc(hidden)]
4038    impl gax::options::internal::RequestBuilder for GetSpoke {
4039        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4040            &mut self.0.options
4041        }
4042    }
4043
4044    /// The request builder for [HubService::create_spoke][crate::client::HubService::create_spoke] calls.
4045    ///
4046    /// # Example
4047    /// ```no_run
4048    /// # use google_cloud_networkconnectivity_v1::builder;
4049    /// use builder::hub_service::CreateSpoke;
4050    /// # tokio_test::block_on(async {
4051    /// use lro::Poller;
4052    ///
4053    /// let builder = prepare_request_builder();
4054    /// let response = builder.poller().until_done().await?;
4055    /// # gax::Result::<()>::Ok(()) });
4056    ///
4057    /// fn prepare_request_builder() -> CreateSpoke {
4058    ///   # panic!();
4059    ///   // ... details omitted ...
4060    /// }
4061    /// ```
4062    #[derive(Clone, Debug)]
4063    pub struct CreateSpoke(RequestBuilder<crate::model::CreateSpokeRequest>);
4064
4065    impl CreateSpoke {
4066        pub(crate) fn new(
4067            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
4068        ) -> Self {
4069            Self(RequestBuilder::new(stub))
4070        }
4071
4072        /// Sets the full request, replacing any prior values.
4073        pub fn with_request<V: Into<crate::model::CreateSpokeRequest>>(mut self, v: V) -> Self {
4074            self.0.request = v.into();
4075            self
4076        }
4077
4078        /// Sets all the options, replacing any prior values.
4079        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4080            self.0.options = v.into();
4081            self
4082        }
4083
4084        /// Sends the request.
4085        ///
4086        /// # Long running operations
4087        ///
4088        /// This starts, but does not poll, a longrunning operation. More information
4089        /// on [create_spoke][crate::client::HubService::create_spoke].
4090        pub async fn send(self) -> Result<longrunning::model::Operation> {
4091            (*self.0.stub)
4092                .create_spoke(self.0.request, self.0.options)
4093                .await
4094                .map(gax::response::Response::into_body)
4095        }
4096
4097        /// Creates a [Poller][lro::Poller] to work with `create_spoke`.
4098        pub fn poller(
4099            self,
4100        ) -> impl lro::Poller<crate::model::Spoke, crate::model::OperationMetadata> {
4101            type Operation =
4102                lro::internal::Operation<crate::model::Spoke, crate::model::OperationMetadata>;
4103            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4104            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4105
4106            let stub = self.0.stub.clone();
4107            let mut options = self.0.options.clone();
4108            options.set_retry_policy(gax::retry_policy::NeverRetry);
4109            let query = move |name| {
4110                let stub = stub.clone();
4111                let options = options.clone();
4112                async {
4113                    let op = GetOperation::new(stub)
4114                        .set_name(name)
4115                        .with_options(options)
4116                        .send()
4117                        .await?;
4118                    Ok(Operation::new(op))
4119                }
4120            };
4121
4122            let start = move || async {
4123                let op = self.send().await?;
4124                Ok(Operation::new(op))
4125            };
4126
4127            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
4128        }
4129
4130        /// Sets the value of [parent][crate::model::CreateSpokeRequest::parent].
4131        ///
4132        /// This is a **required** field for requests.
4133        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4134            self.0.request.parent = v.into();
4135            self
4136        }
4137
4138        /// Sets the value of [spoke_id][crate::model::CreateSpokeRequest::spoke_id].
4139        ///
4140        /// This is a **required** field for requests.
4141        pub fn set_spoke_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4142            self.0.request.spoke_id = v.into();
4143            self
4144        }
4145
4146        /// Sets the value of [spoke][crate::model::CreateSpokeRequest::spoke].
4147        ///
4148        /// This is a **required** field for requests.
4149        pub fn set_spoke<T>(mut self, v: T) -> Self
4150        where
4151            T: std::convert::Into<crate::model::Spoke>,
4152        {
4153            self.0.request.spoke = std::option::Option::Some(v.into());
4154            self
4155        }
4156
4157        /// Sets or clears the value of [spoke][crate::model::CreateSpokeRequest::spoke].
4158        ///
4159        /// This is a **required** field for requests.
4160        pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
4161        where
4162            T: std::convert::Into<crate::model::Spoke>,
4163        {
4164            self.0.request.spoke = v.map(|x| x.into());
4165            self
4166        }
4167
4168        /// Sets the value of [request_id][crate::model::CreateSpokeRequest::request_id].
4169        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4170            self.0.request.request_id = v.into();
4171            self
4172        }
4173    }
4174
4175    #[doc(hidden)]
4176    impl gax::options::internal::RequestBuilder for CreateSpoke {
4177        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4178            &mut self.0.options
4179        }
4180    }
4181
4182    /// The request builder for [HubService::update_spoke][crate::client::HubService::update_spoke] calls.
4183    ///
4184    /// # Example
4185    /// ```no_run
4186    /// # use google_cloud_networkconnectivity_v1::builder;
4187    /// use builder::hub_service::UpdateSpoke;
4188    /// # tokio_test::block_on(async {
4189    /// use lro::Poller;
4190    ///
4191    /// let builder = prepare_request_builder();
4192    /// let response = builder.poller().until_done().await?;
4193    /// # gax::Result::<()>::Ok(()) });
4194    ///
4195    /// fn prepare_request_builder() -> UpdateSpoke {
4196    ///   # panic!();
4197    ///   // ... details omitted ...
4198    /// }
4199    /// ```
4200    #[derive(Clone, Debug)]
4201    pub struct UpdateSpoke(RequestBuilder<crate::model::UpdateSpokeRequest>);
4202
4203    impl UpdateSpoke {
4204        pub(crate) fn new(
4205            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
4206        ) -> Self {
4207            Self(RequestBuilder::new(stub))
4208        }
4209
4210        /// Sets the full request, replacing any prior values.
4211        pub fn with_request<V: Into<crate::model::UpdateSpokeRequest>>(mut self, v: V) -> Self {
4212            self.0.request = v.into();
4213            self
4214        }
4215
4216        /// Sets all the options, replacing any prior values.
4217        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4218            self.0.options = v.into();
4219            self
4220        }
4221
4222        /// Sends the request.
4223        ///
4224        /// # Long running operations
4225        ///
4226        /// This starts, but does not poll, a longrunning operation. More information
4227        /// on [update_spoke][crate::client::HubService::update_spoke].
4228        pub async fn send(self) -> Result<longrunning::model::Operation> {
4229            (*self.0.stub)
4230                .update_spoke(self.0.request, self.0.options)
4231                .await
4232                .map(gax::response::Response::into_body)
4233        }
4234
4235        /// Creates a [Poller][lro::Poller] to work with `update_spoke`.
4236        pub fn poller(
4237            self,
4238        ) -> impl lro::Poller<crate::model::Spoke, crate::model::OperationMetadata> {
4239            type Operation =
4240                lro::internal::Operation<crate::model::Spoke, crate::model::OperationMetadata>;
4241            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4242            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4243
4244            let stub = self.0.stub.clone();
4245            let mut options = self.0.options.clone();
4246            options.set_retry_policy(gax::retry_policy::NeverRetry);
4247            let query = move |name| {
4248                let stub = stub.clone();
4249                let options = options.clone();
4250                async {
4251                    let op = GetOperation::new(stub)
4252                        .set_name(name)
4253                        .with_options(options)
4254                        .send()
4255                        .await?;
4256                    Ok(Operation::new(op))
4257                }
4258            };
4259
4260            let start = move || async {
4261                let op = self.send().await?;
4262                Ok(Operation::new(op))
4263            };
4264
4265            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
4266        }
4267
4268        /// Sets the value of [update_mask][crate::model::UpdateSpokeRequest::update_mask].
4269        pub fn set_update_mask<T>(mut self, v: T) -> Self
4270        where
4271            T: std::convert::Into<wkt::FieldMask>,
4272        {
4273            self.0.request.update_mask = std::option::Option::Some(v.into());
4274            self
4275        }
4276
4277        /// Sets or clears the value of [update_mask][crate::model::UpdateSpokeRequest::update_mask].
4278        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4279        where
4280            T: std::convert::Into<wkt::FieldMask>,
4281        {
4282            self.0.request.update_mask = v.map(|x| x.into());
4283            self
4284        }
4285
4286        /// Sets the value of [spoke][crate::model::UpdateSpokeRequest::spoke].
4287        ///
4288        /// This is a **required** field for requests.
4289        pub fn set_spoke<T>(mut self, v: T) -> Self
4290        where
4291            T: std::convert::Into<crate::model::Spoke>,
4292        {
4293            self.0.request.spoke = std::option::Option::Some(v.into());
4294            self
4295        }
4296
4297        /// Sets or clears the value of [spoke][crate::model::UpdateSpokeRequest::spoke].
4298        ///
4299        /// This is a **required** field for requests.
4300        pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
4301        where
4302            T: std::convert::Into<crate::model::Spoke>,
4303        {
4304            self.0.request.spoke = v.map(|x| x.into());
4305            self
4306        }
4307
4308        /// Sets the value of [request_id][crate::model::UpdateSpokeRequest::request_id].
4309        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4310            self.0.request.request_id = v.into();
4311            self
4312        }
4313    }
4314
4315    #[doc(hidden)]
4316    impl gax::options::internal::RequestBuilder for UpdateSpoke {
4317        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4318            &mut self.0.options
4319        }
4320    }
4321
4322    /// The request builder for [HubService::reject_hub_spoke][crate::client::HubService::reject_hub_spoke] calls.
4323    ///
4324    /// # Example
4325    /// ```no_run
4326    /// # use google_cloud_networkconnectivity_v1::builder;
4327    /// use builder::hub_service::RejectHubSpoke;
4328    /// # tokio_test::block_on(async {
4329    /// use lro::Poller;
4330    ///
4331    /// let builder = prepare_request_builder();
4332    /// let response = builder.poller().until_done().await?;
4333    /// # gax::Result::<()>::Ok(()) });
4334    ///
4335    /// fn prepare_request_builder() -> RejectHubSpoke {
4336    ///   # panic!();
4337    ///   // ... details omitted ...
4338    /// }
4339    /// ```
4340    #[derive(Clone, Debug)]
4341    pub struct RejectHubSpoke(RequestBuilder<crate::model::RejectHubSpokeRequest>);
4342
4343    impl RejectHubSpoke {
4344        pub(crate) fn new(
4345            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
4346        ) -> Self {
4347            Self(RequestBuilder::new(stub))
4348        }
4349
4350        /// Sets the full request, replacing any prior values.
4351        pub fn with_request<V: Into<crate::model::RejectHubSpokeRequest>>(mut self, v: V) -> Self {
4352            self.0.request = v.into();
4353            self
4354        }
4355
4356        /// Sets all the options, replacing any prior values.
4357        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4358            self.0.options = v.into();
4359            self
4360        }
4361
4362        /// Sends the request.
4363        ///
4364        /// # Long running operations
4365        ///
4366        /// This starts, but does not poll, a longrunning operation. More information
4367        /// on [reject_hub_spoke][crate::client::HubService::reject_hub_spoke].
4368        pub async fn send(self) -> Result<longrunning::model::Operation> {
4369            (*self.0.stub)
4370                .reject_hub_spoke(self.0.request, self.0.options)
4371                .await
4372                .map(gax::response::Response::into_body)
4373        }
4374
4375        /// Creates a [Poller][lro::Poller] to work with `reject_hub_spoke`.
4376        pub fn poller(
4377            self,
4378        ) -> impl lro::Poller<crate::model::RejectHubSpokeResponse, crate::model::OperationMetadata>
4379        {
4380            type Operation = lro::internal::Operation<
4381                crate::model::RejectHubSpokeResponse,
4382                crate::model::OperationMetadata,
4383            >;
4384            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4385            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4386
4387            let stub = self.0.stub.clone();
4388            let mut options = self.0.options.clone();
4389            options.set_retry_policy(gax::retry_policy::NeverRetry);
4390            let query = move |name| {
4391                let stub = stub.clone();
4392                let options = options.clone();
4393                async {
4394                    let op = GetOperation::new(stub)
4395                        .set_name(name)
4396                        .with_options(options)
4397                        .send()
4398                        .await?;
4399                    Ok(Operation::new(op))
4400                }
4401            };
4402
4403            let start = move || async {
4404                let op = self.send().await?;
4405                Ok(Operation::new(op))
4406            };
4407
4408            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
4409        }
4410
4411        /// Sets the value of [name][crate::model::RejectHubSpokeRequest::name].
4412        ///
4413        /// This is a **required** field for requests.
4414        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4415            self.0.request.name = v.into();
4416            self
4417        }
4418
4419        /// Sets the value of [spoke_uri][crate::model::RejectHubSpokeRequest::spoke_uri].
4420        ///
4421        /// This is a **required** field for requests.
4422        pub fn set_spoke_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
4423            self.0.request.spoke_uri = v.into();
4424            self
4425        }
4426
4427        /// Sets the value of [request_id][crate::model::RejectHubSpokeRequest::request_id].
4428        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4429            self.0.request.request_id = v.into();
4430            self
4431        }
4432
4433        /// Sets the value of [details][crate::model::RejectHubSpokeRequest::details].
4434        pub fn set_details<T: Into<std::string::String>>(mut self, v: T) -> Self {
4435            self.0.request.details = v.into();
4436            self
4437        }
4438    }
4439
4440    #[doc(hidden)]
4441    impl gax::options::internal::RequestBuilder for RejectHubSpoke {
4442        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4443            &mut self.0.options
4444        }
4445    }
4446
4447    /// The request builder for [HubService::accept_hub_spoke][crate::client::HubService::accept_hub_spoke] calls.
4448    ///
4449    /// # Example
4450    /// ```no_run
4451    /// # use google_cloud_networkconnectivity_v1::builder;
4452    /// use builder::hub_service::AcceptHubSpoke;
4453    /// # tokio_test::block_on(async {
4454    /// use lro::Poller;
4455    ///
4456    /// let builder = prepare_request_builder();
4457    /// let response = builder.poller().until_done().await?;
4458    /// # gax::Result::<()>::Ok(()) });
4459    ///
4460    /// fn prepare_request_builder() -> AcceptHubSpoke {
4461    ///   # panic!();
4462    ///   // ... details omitted ...
4463    /// }
4464    /// ```
4465    #[derive(Clone, Debug)]
4466    pub struct AcceptHubSpoke(RequestBuilder<crate::model::AcceptHubSpokeRequest>);
4467
4468    impl AcceptHubSpoke {
4469        pub(crate) fn new(
4470            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
4471        ) -> Self {
4472            Self(RequestBuilder::new(stub))
4473        }
4474
4475        /// Sets the full request, replacing any prior values.
4476        pub fn with_request<V: Into<crate::model::AcceptHubSpokeRequest>>(mut self, v: V) -> Self {
4477            self.0.request = v.into();
4478            self
4479        }
4480
4481        /// Sets all the options, replacing any prior values.
4482        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4483            self.0.options = v.into();
4484            self
4485        }
4486
4487        /// Sends the request.
4488        ///
4489        /// # Long running operations
4490        ///
4491        /// This starts, but does not poll, a longrunning operation. More information
4492        /// on [accept_hub_spoke][crate::client::HubService::accept_hub_spoke].
4493        pub async fn send(self) -> Result<longrunning::model::Operation> {
4494            (*self.0.stub)
4495                .accept_hub_spoke(self.0.request, self.0.options)
4496                .await
4497                .map(gax::response::Response::into_body)
4498        }
4499
4500        /// Creates a [Poller][lro::Poller] to work with `accept_hub_spoke`.
4501        pub fn poller(
4502            self,
4503        ) -> impl lro::Poller<crate::model::AcceptHubSpokeResponse, crate::model::OperationMetadata>
4504        {
4505            type Operation = lro::internal::Operation<
4506                crate::model::AcceptHubSpokeResponse,
4507                crate::model::OperationMetadata,
4508            >;
4509            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4510            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4511
4512            let stub = self.0.stub.clone();
4513            let mut options = self.0.options.clone();
4514            options.set_retry_policy(gax::retry_policy::NeverRetry);
4515            let query = move |name| {
4516                let stub = stub.clone();
4517                let options = options.clone();
4518                async {
4519                    let op = GetOperation::new(stub)
4520                        .set_name(name)
4521                        .with_options(options)
4522                        .send()
4523                        .await?;
4524                    Ok(Operation::new(op))
4525                }
4526            };
4527
4528            let start = move || async {
4529                let op = self.send().await?;
4530                Ok(Operation::new(op))
4531            };
4532
4533            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
4534        }
4535
4536        /// Sets the value of [name][crate::model::AcceptHubSpokeRequest::name].
4537        ///
4538        /// This is a **required** field for requests.
4539        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4540            self.0.request.name = v.into();
4541            self
4542        }
4543
4544        /// Sets the value of [spoke_uri][crate::model::AcceptHubSpokeRequest::spoke_uri].
4545        ///
4546        /// This is a **required** field for requests.
4547        pub fn set_spoke_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
4548            self.0.request.spoke_uri = v.into();
4549            self
4550        }
4551
4552        /// Sets the value of [request_id][crate::model::AcceptHubSpokeRequest::request_id].
4553        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4554            self.0.request.request_id = v.into();
4555            self
4556        }
4557    }
4558
4559    #[doc(hidden)]
4560    impl gax::options::internal::RequestBuilder for AcceptHubSpoke {
4561        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4562            &mut self.0.options
4563        }
4564    }
4565
4566    /// The request builder for [HubService::accept_spoke_update][crate::client::HubService::accept_spoke_update] calls.
4567    ///
4568    /// # Example
4569    /// ```no_run
4570    /// # use google_cloud_networkconnectivity_v1::builder;
4571    /// use builder::hub_service::AcceptSpokeUpdate;
4572    /// # tokio_test::block_on(async {
4573    /// use lro::Poller;
4574    ///
4575    /// let builder = prepare_request_builder();
4576    /// let response = builder.poller().until_done().await?;
4577    /// # gax::Result::<()>::Ok(()) });
4578    ///
4579    /// fn prepare_request_builder() -> AcceptSpokeUpdate {
4580    ///   # panic!();
4581    ///   // ... details omitted ...
4582    /// }
4583    /// ```
4584    #[derive(Clone, Debug)]
4585    pub struct AcceptSpokeUpdate(RequestBuilder<crate::model::AcceptSpokeUpdateRequest>);
4586
4587    impl AcceptSpokeUpdate {
4588        pub(crate) fn new(
4589            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
4590        ) -> Self {
4591            Self(RequestBuilder::new(stub))
4592        }
4593
4594        /// Sets the full request, replacing any prior values.
4595        pub fn with_request<V: Into<crate::model::AcceptSpokeUpdateRequest>>(
4596            mut self,
4597            v: V,
4598        ) -> Self {
4599            self.0.request = v.into();
4600            self
4601        }
4602
4603        /// Sets all the options, replacing any prior values.
4604        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4605            self.0.options = v.into();
4606            self
4607        }
4608
4609        /// Sends the request.
4610        ///
4611        /// # Long running operations
4612        ///
4613        /// This starts, but does not poll, a longrunning operation. More information
4614        /// on [accept_spoke_update][crate::client::HubService::accept_spoke_update].
4615        pub async fn send(self) -> Result<longrunning::model::Operation> {
4616            (*self.0.stub)
4617                .accept_spoke_update(self.0.request, self.0.options)
4618                .await
4619                .map(gax::response::Response::into_body)
4620        }
4621
4622        /// Creates a [Poller][lro::Poller] to work with `accept_spoke_update`.
4623        pub fn poller(
4624            self,
4625        ) -> impl lro::Poller<crate::model::AcceptSpokeUpdateResponse, crate::model::OperationMetadata>
4626        {
4627            type Operation = lro::internal::Operation<
4628                crate::model::AcceptSpokeUpdateResponse,
4629                crate::model::OperationMetadata,
4630            >;
4631            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4632            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4633
4634            let stub = self.0.stub.clone();
4635            let mut options = self.0.options.clone();
4636            options.set_retry_policy(gax::retry_policy::NeverRetry);
4637            let query = move |name| {
4638                let stub = stub.clone();
4639                let options = options.clone();
4640                async {
4641                    let op = GetOperation::new(stub)
4642                        .set_name(name)
4643                        .with_options(options)
4644                        .send()
4645                        .await?;
4646                    Ok(Operation::new(op))
4647                }
4648            };
4649
4650            let start = move || async {
4651                let op = self.send().await?;
4652                Ok(Operation::new(op))
4653            };
4654
4655            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
4656        }
4657
4658        /// Sets the value of [name][crate::model::AcceptSpokeUpdateRequest::name].
4659        ///
4660        /// This is a **required** field for requests.
4661        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4662            self.0.request.name = v.into();
4663            self
4664        }
4665
4666        /// Sets the value of [spoke_uri][crate::model::AcceptSpokeUpdateRequest::spoke_uri].
4667        ///
4668        /// This is a **required** field for requests.
4669        pub fn set_spoke_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
4670            self.0.request.spoke_uri = v.into();
4671            self
4672        }
4673
4674        /// Sets the value of [spoke_etag][crate::model::AcceptSpokeUpdateRequest::spoke_etag].
4675        ///
4676        /// This is a **required** field for requests.
4677        pub fn set_spoke_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
4678            self.0.request.spoke_etag = v.into();
4679            self
4680        }
4681
4682        /// Sets the value of [request_id][crate::model::AcceptSpokeUpdateRequest::request_id].
4683        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4684            self.0.request.request_id = v.into();
4685            self
4686        }
4687    }
4688
4689    #[doc(hidden)]
4690    impl gax::options::internal::RequestBuilder for AcceptSpokeUpdate {
4691        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4692            &mut self.0.options
4693        }
4694    }
4695
4696    /// The request builder for [HubService::reject_spoke_update][crate::client::HubService::reject_spoke_update] calls.
4697    ///
4698    /// # Example
4699    /// ```no_run
4700    /// # use google_cloud_networkconnectivity_v1::builder;
4701    /// use builder::hub_service::RejectSpokeUpdate;
4702    /// # tokio_test::block_on(async {
4703    /// use lro::Poller;
4704    ///
4705    /// let builder = prepare_request_builder();
4706    /// let response = builder.poller().until_done().await?;
4707    /// # gax::Result::<()>::Ok(()) });
4708    ///
4709    /// fn prepare_request_builder() -> RejectSpokeUpdate {
4710    ///   # panic!();
4711    ///   // ... details omitted ...
4712    /// }
4713    /// ```
4714    #[derive(Clone, Debug)]
4715    pub struct RejectSpokeUpdate(RequestBuilder<crate::model::RejectSpokeUpdateRequest>);
4716
4717    impl RejectSpokeUpdate {
4718        pub(crate) fn new(
4719            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
4720        ) -> Self {
4721            Self(RequestBuilder::new(stub))
4722        }
4723
4724        /// Sets the full request, replacing any prior values.
4725        pub fn with_request<V: Into<crate::model::RejectSpokeUpdateRequest>>(
4726            mut self,
4727            v: V,
4728        ) -> Self {
4729            self.0.request = v.into();
4730            self
4731        }
4732
4733        /// Sets all the options, replacing any prior values.
4734        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4735            self.0.options = v.into();
4736            self
4737        }
4738
4739        /// Sends the request.
4740        ///
4741        /// # Long running operations
4742        ///
4743        /// This starts, but does not poll, a longrunning operation. More information
4744        /// on [reject_spoke_update][crate::client::HubService::reject_spoke_update].
4745        pub async fn send(self) -> Result<longrunning::model::Operation> {
4746            (*self.0.stub)
4747                .reject_spoke_update(self.0.request, self.0.options)
4748                .await
4749                .map(gax::response::Response::into_body)
4750        }
4751
4752        /// Creates a [Poller][lro::Poller] to work with `reject_spoke_update`.
4753        pub fn poller(
4754            self,
4755        ) -> impl lro::Poller<crate::model::RejectSpokeUpdateResponse, crate::model::OperationMetadata>
4756        {
4757            type Operation = lro::internal::Operation<
4758                crate::model::RejectSpokeUpdateResponse,
4759                crate::model::OperationMetadata,
4760            >;
4761            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4762            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4763
4764            let stub = self.0.stub.clone();
4765            let mut options = self.0.options.clone();
4766            options.set_retry_policy(gax::retry_policy::NeverRetry);
4767            let query = move |name| {
4768                let stub = stub.clone();
4769                let options = options.clone();
4770                async {
4771                    let op = GetOperation::new(stub)
4772                        .set_name(name)
4773                        .with_options(options)
4774                        .send()
4775                        .await?;
4776                    Ok(Operation::new(op))
4777                }
4778            };
4779
4780            let start = move || async {
4781                let op = self.send().await?;
4782                Ok(Operation::new(op))
4783            };
4784
4785            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
4786        }
4787
4788        /// Sets the value of [name][crate::model::RejectSpokeUpdateRequest::name].
4789        ///
4790        /// This is a **required** field for requests.
4791        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4792            self.0.request.name = v.into();
4793            self
4794        }
4795
4796        /// Sets the value of [spoke_uri][crate::model::RejectSpokeUpdateRequest::spoke_uri].
4797        ///
4798        /// This is a **required** field for requests.
4799        pub fn set_spoke_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
4800            self.0.request.spoke_uri = v.into();
4801            self
4802        }
4803
4804        /// Sets the value of [spoke_etag][crate::model::RejectSpokeUpdateRequest::spoke_etag].
4805        ///
4806        /// This is a **required** field for requests.
4807        pub fn set_spoke_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
4808            self.0.request.spoke_etag = v.into();
4809            self
4810        }
4811
4812        /// Sets the value of [details][crate::model::RejectSpokeUpdateRequest::details].
4813        pub fn set_details<T: Into<std::string::String>>(mut self, v: T) -> Self {
4814            self.0.request.details = v.into();
4815            self
4816        }
4817
4818        /// Sets the value of [request_id][crate::model::RejectSpokeUpdateRequest::request_id].
4819        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4820            self.0.request.request_id = v.into();
4821            self
4822        }
4823    }
4824
4825    #[doc(hidden)]
4826    impl gax::options::internal::RequestBuilder for RejectSpokeUpdate {
4827        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4828            &mut self.0.options
4829        }
4830    }
4831
4832    /// The request builder for [HubService::delete_spoke][crate::client::HubService::delete_spoke] calls.
4833    ///
4834    /// # Example
4835    /// ```no_run
4836    /// # use google_cloud_networkconnectivity_v1::builder;
4837    /// use builder::hub_service::DeleteSpoke;
4838    /// # tokio_test::block_on(async {
4839    /// use lro::Poller;
4840    ///
4841    /// let builder = prepare_request_builder();
4842    /// let response = builder.poller().until_done().await?;
4843    /// # gax::Result::<()>::Ok(()) });
4844    ///
4845    /// fn prepare_request_builder() -> DeleteSpoke {
4846    ///   # panic!();
4847    ///   // ... details omitted ...
4848    /// }
4849    /// ```
4850    #[derive(Clone, Debug)]
4851    pub struct DeleteSpoke(RequestBuilder<crate::model::DeleteSpokeRequest>);
4852
4853    impl DeleteSpoke {
4854        pub(crate) fn new(
4855            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
4856        ) -> Self {
4857            Self(RequestBuilder::new(stub))
4858        }
4859
4860        /// Sets the full request, replacing any prior values.
4861        pub fn with_request<V: Into<crate::model::DeleteSpokeRequest>>(mut self, v: V) -> Self {
4862            self.0.request = v.into();
4863            self
4864        }
4865
4866        /// Sets all the options, replacing any prior values.
4867        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4868            self.0.options = v.into();
4869            self
4870        }
4871
4872        /// Sends the request.
4873        ///
4874        /// # Long running operations
4875        ///
4876        /// This starts, but does not poll, a longrunning operation. More information
4877        /// on [delete_spoke][crate::client::HubService::delete_spoke].
4878        pub async fn send(self) -> Result<longrunning::model::Operation> {
4879            (*self.0.stub)
4880                .delete_spoke(self.0.request, self.0.options)
4881                .await
4882                .map(gax::response::Response::into_body)
4883        }
4884
4885        /// Creates a [Poller][lro::Poller] to work with `delete_spoke`.
4886        pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
4887            type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
4888            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4889            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4890
4891            let stub = self.0.stub.clone();
4892            let mut options = self.0.options.clone();
4893            options.set_retry_policy(gax::retry_policy::NeverRetry);
4894            let query = move |name| {
4895                let stub = stub.clone();
4896                let options = options.clone();
4897                async {
4898                    let op = GetOperation::new(stub)
4899                        .set_name(name)
4900                        .with_options(options)
4901                        .send()
4902                        .await?;
4903                    Ok(Operation::new(op))
4904                }
4905            };
4906
4907            let start = move || async {
4908                let op = self.send().await?;
4909                Ok(Operation::new(op))
4910            };
4911
4912            lro::internal::new_unit_response_poller(
4913                polling_error_policy,
4914                polling_backoff_policy,
4915                start,
4916                query,
4917            )
4918        }
4919
4920        /// Sets the value of [name][crate::model::DeleteSpokeRequest::name].
4921        ///
4922        /// This is a **required** field for requests.
4923        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4924            self.0.request.name = v.into();
4925            self
4926        }
4927
4928        /// Sets the value of [request_id][crate::model::DeleteSpokeRequest::request_id].
4929        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4930            self.0.request.request_id = v.into();
4931            self
4932        }
4933    }
4934
4935    #[doc(hidden)]
4936    impl gax::options::internal::RequestBuilder for DeleteSpoke {
4937        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4938            &mut self.0.options
4939        }
4940    }
4941
4942    /// The request builder for [HubService::get_route_table][crate::client::HubService::get_route_table] calls.
4943    ///
4944    /// # Example
4945    /// ```no_run
4946    /// # use google_cloud_networkconnectivity_v1::builder;
4947    /// use builder::hub_service::GetRouteTable;
4948    /// # tokio_test::block_on(async {
4949    ///
4950    /// let builder = prepare_request_builder();
4951    /// let response = builder.send().await?;
4952    /// # gax::Result::<()>::Ok(()) });
4953    ///
4954    /// fn prepare_request_builder() -> GetRouteTable {
4955    ///   # panic!();
4956    ///   // ... details omitted ...
4957    /// }
4958    /// ```
4959    #[derive(Clone, Debug)]
4960    pub struct GetRouteTable(RequestBuilder<crate::model::GetRouteTableRequest>);
4961
4962    impl GetRouteTable {
4963        pub(crate) fn new(
4964            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
4965        ) -> Self {
4966            Self(RequestBuilder::new(stub))
4967        }
4968
4969        /// Sets the full request, replacing any prior values.
4970        pub fn with_request<V: Into<crate::model::GetRouteTableRequest>>(mut self, v: V) -> Self {
4971            self.0.request = v.into();
4972            self
4973        }
4974
4975        /// Sets all the options, replacing any prior values.
4976        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4977            self.0.options = v.into();
4978            self
4979        }
4980
4981        /// Sends the request.
4982        pub async fn send(self) -> Result<crate::model::RouteTable> {
4983            (*self.0.stub)
4984                .get_route_table(self.0.request, self.0.options)
4985                .await
4986                .map(gax::response::Response::into_body)
4987        }
4988
4989        /// Sets the value of [name][crate::model::GetRouteTableRequest::name].
4990        ///
4991        /// This is a **required** field for requests.
4992        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4993            self.0.request.name = v.into();
4994            self
4995        }
4996    }
4997
4998    #[doc(hidden)]
4999    impl gax::options::internal::RequestBuilder for GetRouteTable {
5000        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5001            &mut self.0.options
5002        }
5003    }
5004
5005    /// The request builder for [HubService::get_route][crate::client::HubService::get_route] calls.
5006    ///
5007    /// # Example
5008    /// ```no_run
5009    /// # use google_cloud_networkconnectivity_v1::builder;
5010    /// use builder::hub_service::GetRoute;
5011    /// # tokio_test::block_on(async {
5012    ///
5013    /// let builder = prepare_request_builder();
5014    /// let response = builder.send().await?;
5015    /// # gax::Result::<()>::Ok(()) });
5016    ///
5017    /// fn prepare_request_builder() -> GetRoute {
5018    ///   # panic!();
5019    ///   // ... details omitted ...
5020    /// }
5021    /// ```
5022    #[derive(Clone, Debug)]
5023    pub struct GetRoute(RequestBuilder<crate::model::GetRouteRequest>);
5024
5025    impl GetRoute {
5026        pub(crate) fn new(
5027            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5028        ) -> Self {
5029            Self(RequestBuilder::new(stub))
5030        }
5031
5032        /// Sets the full request, replacing any prior values.
5033        pub fn with_request<V: Into<crate::model::GetRouteRequest>>(mut self, v: V) -> Self {
5034            self.0.request = v.into();
5035            self
5036        }
5037
5038        /// Sets all the options, replacing any prior values.
5039        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5040            self.0.options = v.into();
5041            self
5042        }
5043
5044        /// Sends the request.
5045        pub async fn send(self) -> Result<crate::model::Route> {
5046            (*self.0.stub)
5047                .get_route(self.0.request, self.0.options)
5048                .await
5049                .map(gax::response::Response::into_body)
5050        }
5051
5052        /// Sets the value of [name][crate::model::GetRouteRequest::name].
5053        ///
5054        /// This is a **required** field for requests.
5055        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5056            self.0.request.name = v.into();
5057            self
5058        }
5059    }
5060
5061    #[doc(hidden)]
5062    impl gax::options::internal::RequestBuilder for GetRoute {
5063        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5064            &mut self.0.options
5065        }
5066    }
5067
5068    /// The request builder for [HubService::list_routes][crate::client::HubService::list_routes] calls.
5069    ///
5070    /// # Example
5071    /// ```no_run
5072    /// # use google_cloud_networkconnectivity_v1::builder;
5073    /// use builder::hub_service::ListRoutes;
5074    /// # tokio_test::block_on(async {
5075    /// use gax::paginator::ItemPaginator;
5076    ///
5077    /// let builder = prepare_request_builder();
5078    /// let mut items = builder.by_item();
5079    /// while let Some(result) = items.next().await {
5080    ///   let item = result?;
5081    /// }
5082    /// # gax::Result::<()>::Ok(()) });
5083    ///
5084    /// fn prepare_request_builder() -> ListRoutes {
5085    ///   # panic!();
5086    ///   // ... details omitted ...
5087    /// }
5088    /// ```
5089    #[derive(Clone, Debug)]
5090    pub struct ListRoutes(RequestBuilder<crate::model::ListRoutesRequest>);
5091
5092    impl ListRoutes {
5093        pub(crate) fn new(
5094            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5095        ) -> Self {
5096            Self(RequestBuilder::new(stub))
5097        }
5098
5099        /// Sets the full request, replacing any prior values.
5100        pub fn with_request<V: Into<crate::model::ListRoutesRequest>>(mut self, v: V) -> Self {
5101            self.0.request = v.into();
5102            self
5103        }
5104
5105        /// Sets all the options, replacing any prior values.
5106        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5107            self.0.options = v.into();
5108            self
5109        }
5110
5111        /// Sends the request.
5112        pub async fn send(self) -> Result<crate::model::ListRoutesResponse> {
5113            (*self.0.stub)
5114                .list_routes(self.0.request, self.0.options)
5115                .await
5116                .map(gax::response::Response::into_body)
5117        }
5118
5119        /// Streams each page in the collection.
5120        pub fn by_page(
5121            self,
5122        ) -> impl gax::paginator::Paginator<crate::model::ListRoutesResponse, gax::error::Error>
5123        {
5124            use std::clone::Clone;
5125            let token = self.0.request.page_token.clone();
5126            let execute = move |token: String| {
5127                let mut builder = self.clone();
5128                builder.0.request = builder.0.request.set_page_token(token);
5129                builder.send()
5130            };
5131            gax::paginator::internal::new_paginator(token, execute)
5132        }
5133
5134        /// Streams each item in the collection.
5135        pub fn by_item(
5136            self,
5137        ) -> impl gax::paginator::ItemPaginator<crate::model::ListRoutesResponse, gax::error::Error>
5138        {
5139            use gax::paginator::Paginator;
5140            self.by_page().items()
5141        }
5142
5143        /// Sets the value of [parent][crate::model::ListRoutesRequest::parent].
5144        ///
5145        /// This is a **required** field for requests.
5146        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5147            self.0.request.parent = v.into();
5148            self
5149        }
5150
5151        /// Sets the value of [page_size][crate::model::ListRoutesRequest::page_size].
5152        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5153            self.0.request.page_size = v.into();
5154            self
5155        }
5156
5157        /// Sets the value of [page_token][crate::model::ListRoutesRequest::page_token].
5158        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5159            self.0.request.page_token = v.into();
5160            self
5161        }
5162
5163        /// Sets the value of [filter][crate::model::ListRoutesRequest::filter].
5164        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5165            self.0.request.filter = v.into();
5166            self
5167        }
5168
5169        /// Sets the value of [order_by][crate::model::ListRoutesRequest::order_by].
5170        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
5171            self.0.request.order_by = v.into();
5172            self
5173        }
5174    }
5175
5176    #[doc(hidden)]
5177    impl gax::options::internal::RequestBuilder for ListRoutes {
5178        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5179            &mut self.0.options
5180        }
5181    }
5182
5183    /// The request builder for [HubService::list_route_tables][crate::client::HubService::list_route_tables] calls.
5184    ///
5185    /// # Example
5186    /// ```no_run
5187    /// # use google_cloud_networkconnectivity_v1::builder;
5188    /// use builder::hub_service::ListRouteTables;
5189    /// # tokio_test::block_on(async {
5190    /// use gax::paginator::ItemPaginator;
5191    ///
5192    /// let builder = prepare_request_builder();
5193    /// let mut items = builder.by_item();
5194    /// while let Some(result) = items.next().await {
5195    ///   let item = result?;
5196    /// }
5197    /// # gax::Result::<()>::Ok(()) });
5198    ///
5199    /// fn prepare_request_builder() -> ListRouteTables {
5200    ///   # panic!();
5201    ///   // ... details omitted ...
5202    /// }
5203    /// ```
5204    #[derive(Clone, Debug)]
5205    pub struct ListRouteTables(RequestBuilder<crate::model::ListRouteTablesRequest>);
5206
5207    impl ListRouteTables {
5208        pub(crate) fn new(
5209            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5210        ) -> Self {
5211            Self(RequestBuilder::new(stub))
5212        }
5213
5214        /// Sets the full request, replacing any prior values.
5215        pub fn with_request<V: Into<crate::model::ListRouteTablesRequest>>(mut self, v: V) -> Self {
5216            self.0.request = v.into();
5217            self
5218        }
5219
5220        /// Sets all the options, replacing any prior values.
5221        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5222            self.0.options = v.into();
5223            self
5224        }
5225
5226        /// Sends the request.
5227        pub async fn send(self) -> Result<crate::model::ListRouteTablesResponse> {
5228            (*self.0.stub)
5229                .list_route_tables(self.0.request, self.0.options)
5230                .await
5231                .map(gax::response::Response::into_body)
5232        }
5233
5234        /// Streams each page in the collection.
5235        pub fn by_page(
5236            self,
5237        ) -> impl gax::paginator::Paginator<crate::model::ListRouteTablesResponse, gax::error::Error>
5238        {
5239            use std::clone::Clone;
5240            let token = self.0.request.page_token.clone();
5241            let execute = move |token: String| {
5242                let mut builder = self.clone();
5243                builder.0.request = builder.0.request.set_page_token(token);
5244                builder.send()
5245            };
5246            gax::paginator::internal::new_paginator(token, execute)
5247        }
5248
5249        /// Streams each item in the collection.
5250        pub fn by_item(
5251            self,
5252        ) -> impl gax::paginator::ItemPaginator<crate::model::ListRouteTablesResponse, gax::error::Error>
5253        {
5254            use gax::paginator::Paginator;
5255            self.by_page().items()
5256        }
5257
5258        /// Sets the value of [parent][crate::model::ListRouteTablesRequest::parent].
5259        ///
5260        /// This is a **required** field for requests.
5261        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5262            self.0.request.parent = v.into();
5263            self
5264        }
5265
5266        /// Sets the value of [page_size][crate::model::ListRouteTablesRequest::page_size].
5267        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5268            self.0.request.page_size = v.into();
5269            self
5270        }
5271
5272        /// Sets the value of [page_token][crate::model::ListRouteTablesRequest::page_token].
5273        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5274            self.0.request.page_token = v.into();
5275            self
5276        }
5277
5278        /// Sets the value of [filter][crate::model::ListRouteTablesRequest::filter].
5279        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5280            self.0.request.filter = v.into();
5281            self
5282        }
5283
5284        /// Sets the value of [order_by][crate::model::ListRouteTablesRequest::order_by].
5285        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
5286            self.0.request.order_by = v.into();
5287            self
5288        }
5289    }
5290
5291    #[doc(hidden)]
5292    impl gax::options::internal::RequestBuilder for ListRouteTables {
5293        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5294            &mut self.0.options
5295        }
5296    }
5297
5298    /// The request builder for [HubService::get_group][crate::client::HubService::get_group] calls.
5299    ///
5300    /// # Example
5301    /// ```no_run
5302    /// # use google_cloud_networkconnectivity_v1::builder;
5303    /// use builder::hub_service::GetGroup;
5304    /// # tokio_test::block_on(async {
5305    ///
5306    /// let builder = prepare_request_builder();
5307    /// let response = builder.send().await?;
5308    /// # gax::Result::<()>::Ok(()) });
5309    ///
5310    /// fn prepare_request_builder() -> GetGroup {
5311    ///   # panic!();
5312    ///   // ... details omitted ...
5313    /// }
5314    /// ```
5315    #[derive(Clone, Debug)]
5316    pub struct GetGroup(RequestBuilder<crate::model::GetGroupRequest>);
5317
5318    impl GetGroup {
5319        pub(crate) fn new(
5320            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5321        ) -> Self {
5322            Self(RequestBuilder::new(stub))
5323        }
5324
5325        /// Sets the full request, replacing any prior values.
5326        pub fn with_request<V: Into<crate::model::GetGroupRequest>>(mut self, v: V) -> Self {
5327            self.0.request = v.into();
5328            self
5329        }
5330
5331        /// Sets all the options, replacing any prior values.
5332        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5333            self.0.options = v.into();
5334            self
5335        }
5336
5337        /// Sends the request.
5338        pub async fn send(self) -> Result<crate::model::Group> {
5339            (*self.0.stub)
5340                .get_group(self.0.request, self.0.options)
5341                .await
5342                .map(gax::response::Response::into_body)
5343        }
5344
5345        /// Sets the value of [name][crate::model::GetGroupRequest::name].
5346        ///
5347        /// This is a **required** field for requests.
5348        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5349            self.0.request.name = v.into();
5350            self
5351        }
5352    }
5353
5354    #[doc(hidden)]
5355    impl gax::options::internal::RequestBuilder for GetGroup {
5356        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5357            &mut self.0.options
5358        }
5359    }
5360
5361    /// The request builder for [HubService::list_groups][crate::client::HubService::list_groups] calls.
5362    ///
5363    /// # Example
5364    /// ```no_run
5365    /// # use google_cloud_networkconnectivity_v1::builder;
5366    /// use builder::hub_service::ListGroups;
5367    /// # tokio_test::block_on(async {
5368    /// use gax::paginator::ItemPaginator;
5369    ///
5370    /// let builder = prepare_request_builder();
5371    /// let mut items = builder.by_item();
5372    /// while let Some(result) = items.next().await {
5373    ///   let item = result?;
5374    /// }
5375    /// # gax::Result::<()>::Ok(()) });
5376    ///
5377    /// fn prepare_request_builder() -> ListGroups {
5378    ///   # panic!();
5379    ///   // ... details omitted ...
5380    /// }
5381    /// ```
5382    #[derive(Clone, Debug)]
5383    pub struct ListGroups(RequestBuilder<crate::model::ListGroupsRequest>);
5384
5385    impl ListGroups {
5386        pub(crate) fn new(
5387            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5388        ) -> Self {
5389            Self(RequestBuilder::new(stub))
5390        }
5391
5392        /// Sets the full request, replacing any prior values.
5393        pub fn with_request<V: Into<crate::model::ListGroupsRequest>>(mut self, v: V) -> Self {
5394            self.0.request = v.into();
5395            self
5396        }
5397
5398        /// Sets all the options, replacing any prior values.
5399        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5400            self.0.options = v.into();
5401            self
5402        }
5403
5404        /// Sends the request.
5405        pub async fn send(self) -> Result<crate::model::ListGroupsResponse> {
5406            (*self.0.stub)
5407                .list_groups(self.0.request, self.0.options)
5408                .await
5409                .map(gax::response::Response::into_body)
5410        }
5411
5412        /// Streams each page in the collection.
5413        pub fn by_page(
5414            self,
5415        ) -> impl gax::paginator::Paginator<crate::model::ListGroupsResponse, gax::error::Error>
5416        {
5417            use std::clone::Clone;
5418            let token = self.0.request.page_token.clone();
5419            let execute = move |token: String| {
5420                let mut builder = self.clone();
5421                builder.0.request = builder.0.request.set_page_token(token);
5422                builder.send()
5423            };
5424            gax::paginator::internal::new_paginator(token, execute)
5425        }
5426
5427        /// Streams each item in the collection.
5428        pub fn by_item(
5429            self,
5430        ) -> impl gax::paginator::ItemPaginator<crate::model::ListGroupsResponse, gax::error::Error>
5431        {
5432            use gax::paginator::Paginator;
5433            self.by_page().items()
5434        }
5435
5436        /// Sets the value of [parent][crate::model::ListGroupsRequest::parent].
5437        ///
5438        /// This is a **required** field for requests.
5439        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5440            self.0.request.parent = v.into();
5441            self
5442        }
5443
5444        /// Sets the value of [page_size][crate::model::ListGroupsRequest::page_size].
5445        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5446            self.0.request.page_size = v.into();
5447            self
5448        }
5449
5450        /// Sets the value of [page_token][crate::model::ListGroupsRequest::page_token].
5451        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5452            self.0.request.page_token = v.into();
5453            self
5454        }
5455
5456        /// Sets the value of [filter][crate::model::ListGroupsRequest::filter].
5457        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5458            self.0.request.filter = v.into();
5459            self
5460        }
5461
5462        /// Sets the value of [order_by][crate::model::ListGroupsRequest::order_by].
5463        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
5464            self.0.request.order_by = v.into();
5465            self
5466        }
5467    }
5468
5469    #[doc(hidden)]
5470    impl gax::options::internal::RequestBuilder for ListGroups {
5471        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5472            &mut self.0.options
5473        }
5474    }
5475
5476    /// The request builder for [HubService::update_group][crate::client::HubService::update_group] calls.
5477    ///
5478    /// # Example
5479    /// ```no_run
5480    /// # use google_cloud_networkconnectivity_v1::builder;
5481    /// use builder::hub_service::UpdateGroup;
5482    /// # tokio_test::block_on(async {
5483    /// use lro::Poller;
5484    ///
5485    /// let builder = prepare_request_builder();
5486    /// let response = builder.poller().until_done().await?;
5487    /// # gax::Result::<()>::Ok(()) });
5488    ///
5489    /// fn prepare_request_builder() -> UpdateGroup {
5490    ///   # panic!();
5491    ///   // ... details omitted ...
5492    /// }
5493    /// ```
5494    #[derive(Clone, Debug)]
5495    pub struct UpdateGroup(RequestBuilder<crate::model::UpdateGroupRequest>);
5496
5497    impl UpdateGroup {
5498        pub(crate) fn new(
5499            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5500        ) -> Self {
5501            Self(RequestBuilder::new(stub))
5502        }
5503
5504        /// Sets the full request, replacing any prior values.
5505        pub fn with_request<V: Into<crate::model::UpdateGroupRequest>>(mut self, v: V) -> Self {
5506            self.0.request = v.into();
5507            self
5508        }
5509
5510        /// Sets all the options, replacing any prior values.
5511        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5512            self.0.options = v.into();
5513            self
5514        }
5515
5516        /// Sends the request.
5517        ///
5518        /// # Long running operations
5519        ///
5520        /// This starts, but does not poll, a longrunning operation. More information
5521        /// on [update_group][crate::client::HubService::update_group].
5522        pub async fn send(self) -> Result<longrunning::model::Operation> {
5523            (*self.0.stub)
5524                .update_group(self.0.request, self.0.options)
5525                .await
5526                .map(gax::response::Response::into_body)
5527        }
5528
5529        /// Creates a [Poller][lro::Poller] to work with `update_group`.
5530        pub fn poller(
5531            self,
5532        ) -> impl lro::Poller<crate::model::Group, crate::model::OperationMetadata> {
5533            type Operation =
5534                lro::internal::Operation<crate::model::Group, crate::model::OperationMetadata>;
5535            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5536            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5537
5538            let stub = self.0.stub.clone();
5539            let mut options = self.0.options.clone();
5540            options.set_retry_policy(gax::retry_policy::NeverRetry);
5541            let query = move |name| {
5542                let stub = stub.clone();
5543                let options = options.clone();
5544                async {
5545                    let op = GetOperation::new(stub)
5546                        .set_name(name)
5547                        .with_options(options)
5548                        .send()
5549                        .await?;
5550                    Ok(Operation::new(op))
5551                }
5552            };
5553
5554            let start = move || async {
5555                let op = self.send().await?;
5556                Ok(Operation::new(op))
5557            };
5558
5559            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
5560        }
5561
5562        /// Sets the value of [update_mask][crate::model::UpdateGroupRequest::update_mask].
5563        pub fn set_update_mask<T>(mut self, v: T) -> Self
5564        where
5565            T: std::convert::Into<wkt::FieldMask>,
5566        {
5567            self.0.request.update_mask = std::option::Option::Some(v.into());
5568            self
5569        }
5570
5571        /// Sets or clears the value of [update_mask][crate::model::UpdateGroupRequest::update_mask].
5572        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5573        where
5574            T: std::convert::Into<wkt::FieldMask>,
5575        {
5576            self.0.request.update_mask = v.map(|x| x.into());
5577            self
5578        }
5579
5580        /// Sets the value of [group][crate::model::UpdateGroupRequest::group].
5581        ///
5582        /// This is a **required** field for requests.
5583        pub fn set_group<T>(mut self, v: T) -> Self
5584        where
5585            T: std::convert::Into<crate::model::Group>,
5586        {
5587            self.0.request.group = std::option::Option::Some(v.into());
5588            self
5589        }
5590
5591        /// Sets or clears the value of [group][crate::model::UpdateGroupRequest::group].
5592        ///
5593        /// This is a **required** field for requests.
5594        pub fn set_or_clear_group<T>(mut self, v: std::option::Option<T>) -> Self
5595        where
5596            T: std::convert::Into<crate::model::Group>,
5597        {
5598            self.0.request.group = v.map(|x| x.into());
5599            self
5600        }
5601
5602        /// Sets the value of [request_id][crate::model::UpdateGroupRequest::request_id].
5603        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5604            self.0.request.request_id = v.into();
5605            self
5606        }
5607    }
5608
5609    #[doc(hidden)]
5610    impl gax::options::internal::RequestBuilder for UpdateGroup {
5611        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5612            &mut self.0.options
5613        }
5614    }
5615
5616    /// The request builder for [HubService::list_locations][crate::client::HubService::list_locations] calls.
5617    ///
5618    /// # Example
5619    /// ```no_run
5620    /// # use google_cloud_networkconnectivity_v1::builder;
5621    /// use builder::hub_service::ListLocations;
5622    /// # tokio_test::block_on(async {
5623    /// use gax::paginator::ItemPaginator;
5624    ///
5625    /// let builder = prepare_request_builder();
5626    /// let mut items = builder.by_item();
5627    /// while let Some(result) = items.next().await {
5628    ///   let item = result?;
5629    /// }
5630    /// # gax::Result::<()>::Ok(()) });
5631    ///
5632    /// fn prepare_request_builder() -> ListLocations {
5633    ///   # panic!();
5634    ///   // ... details omitted ...
5635    /// }
5636    /// ```
5637    #[derive(Clone, Debug)]
5638    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
5639
5640    impl ListLocations {
5641        pub(crate) fn new(
5642            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5643        ) -> Self {
5644            Self(RequestBuilder::new(stub))
5645        }
5646
5647        /// Sets the full request, replacing any prior values.
5648        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
5649            mut self,
5650            v: V,
5651        ) -> Self {
5652            self.0.request = v.into();
5653            self
5654        }
5655
5656        /// Sets all the options, replacing any prior values.
5657        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5658            self.0.options = v.into();
5659            self
5660        }
5661
5662        /// Sends the request.
5663        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
5664            (*self.0.stub)
5665                .list_locations(self.0.request, self.0.options)
5666                .await
5667                .map(gax::response::Response::into_body)
5668        }
5669
5670        /// Streams each page in the collection.
5671        pub fn by_page(
5672            self,
5673        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
5674        {
5675            use std::clone::Clone;
5676            let token = self.0.request.page_token.clone();
5677            let execute = move |token: String| {
5678                let mut builder = self.clone();
5679                builder.0.request = builder.0.request.set_page_token(token);
5680                builder.send()
5681            };
5682            gax::paginator::internal::new_paginator(token, execute)
5683        }
5684
5685        /// Streams each item in the collection.
5686        pub fn by_item(
5687            self,
5688        ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
5689        {
5690            use gax::paginator::Paginator;
5691            self.by_page().items()
5692        }
5693
5694        /// Sets the value of [name][location::model::ListLocationsRequest::name].
5695        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5696            self.0.request.name = v.into();
5697            self
5698        }
5699
5700        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
5701        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5702            self.0.request.filter = v.into();
5703            self
5704        }
5705
5706        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
5707        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5708            self.0.request.page_size = v.into();
5709            self
5710        }
5711
5712        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
5713        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5714            self.0.request.page_token = v.into();
5715            self
5716        }
5717    }
5718
5719    #[doc(hidden)]
5720    impl gax::options::internal::RequestBuilder for ListLocations {
5721        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5722            &mut self.0.options
5723        }
5724    }
5725
5726    /// The request builder for [HubService::get_location][crate::client::HubService::get_location] calls.
5727    ///
5728    /// # Example
5729    /// ```no_run
5730    /// # use google_cloud_networkconnectivity_v1::builder;
5731    /// use builder::hub_service::GetLocation;
5732    /// # tokio_test::block_on(async {
5733    ///
5734    /// let builder = prepare_request_builder();
5735    /// let response = builder.send().await?;
5736    /// # gax::Result::<()>::Ok(()) });
5737    ///
5738    /// fn prepare_request_builder() -> GetLocation {
5739    ///   # panic!();
5740    ///   // ... details omitted ...
5741    /// }
5742    /// ```
5743    #[derive(Clone, Debug)]
5744    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
5745
5746    impl GetLocation {
5747        pub(crate) fn new(
5748            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5749        ) -> Self {
5750            Self(RequestBuilder::new(stub))
5751        }
5752
5753        /// Sets the full request, replacing any prior values.
5754        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
5755            self.0.request = v.into();
5756            self
5757        }
5758
5759        /// Sets all the options, replacing any prior values.
5760        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5761            self.0.options = v.into();
5762            self
5763        }
5764
5765        /// Sends the request.
5766        pub async fn send(self) -> Result<location::model::Location> {
5767            (*self.0.stub)
5768                .get_location(self.0.request, self.0.options)
5769                .await
5770                .map(gax::response::Response::into_body)
5771        }
5772
5773        /// Sets the value of [name][location::model::GetLocationRequest::name].
5774        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5775            self.0.request.name = v.into();
5776            self
5777        }
5778    }
5779
5780    #[doc(hidden)]
5781    impl gax::options::internal::RequestBuilder for GetLocation {
5782        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5783            &mut self.0.options
5784        }
5785    }
5786
5787    /// The request builder for [HubService::set_iam_policy][crate::client::HubService::set_iam_policy] calls.
5788    ///
5789    /// # Example
5790    /// ```no_run
5791    /// # use google_cloud_networkconnectivity_v1::builder;
5792    /// use builder::hub_service::SetIamPolicy;
5793    /// # tokio_test::block_on(async {
5794    ///
5795    /// let builder = prepare_request_builder();
5796    /// let response = builder.send().await?;
5797    /// # gax::Result::<()>::Ok(()) });
5798    ///
5799    /// fn prepare_request_builder() -> SetIamPolicy {
5800    ///   # panic!();
5801    ///   // ... details omitted ...
5802    /// }
5803    /// ```
5804    #[derive(Clone, Debug)]
5805    pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
5806
5807    impl SetIamPolicy {
5808        pub(crate) fn new(
5809            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5810        ) -> Self {
5811            Self(RequestBuilder::new(stub))
5812        }
5813
5814        /// Sets the full request, replacing any prior values.
5815        pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
5816            self.0.request = v.into();
5817            self
5818        }
5819
5820        /// Sets all the options, replacing any prior values.
5821        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5822            self.0.options = v.into();
5823            self
5824        }
5825
5826        /// Sends the request.
5827        pub async fn send(self) -> Result<iam_v1::model::Policy> {
5828            (*self.0.stub)
5829                .set_iam_policy(self.0.request, self.0.options)
5830                .await
5831                .map(gax::response::Response::into_body)
5832        }
5833
5834        /// Sets the value of [resource][iam_v1::model::SetIamPolicyRequest::resource].
5835        ///
5836        /// This is a **required** field for requests.
5837        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5838            self.0.request.resource = v.into();
5839            self
5840        }
5841
5842        /// Sets the value of [policy][iam_v1::model::SetIamPolicyRequest::policy].
5843        ///
5844        /// This is a **required** field for requests.
5845        pub fn set_policy<T>(mut self, v: T) -> Self
5846        where
5847            T: std::convert::Into<iam_v1::model::Policy>,
5848        {
5849            self.0.request.policy = std::option::Option::Some(v.into());
5850            self
5851        }
5852
5853        /// Sets or clears the value of [policy][iam_v1::model::SetIamPolicyRequest::policy].
5854        ///
5855        /// This is a **required** field for requests.
5856        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
5857        where
5858            T: std::convert::Into<iam_v1::model::Policy>,
5859        {
5860            self.0.request.policy = v.map(|x| x.into());
5861            self
5862        }
5863
5864        /// Sets the value of [update_mask][iam_v1::model::SetIamPolicyRequest::update_mask].
5865        pub fn set_update_mask<T>(mut self, v: T) -> Self
5866        where
5867            T: std::convert::Into<wkt::FieldMask>,
5868        {
5869            self.0.request.update_mask = std::option::Option::Some(v.into());
5870            self
5871        }
5872
5873        /// Sets or clears the value of [update_mask][iam_v1::model::SetIamPolicyRequest::update_mask].
5874        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5875        where
5876            T: std::convert::Into<wkt::FieldMask>,
5877        {
5878            self.0.request.update_mask = v.map(|x| x.into());
5879            self
5880        }
5881    }
5882
5883    #[doc(hidden)]
5884    impl gax::options::internal::RequestBuilder for SetIamPolicy {
5885        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5886            &mut self.0.options
5887        }
5888    }
5889
5890    /// The request builder for [HubService::get_iam_policy][crate::client::HubService::get_iam_policy] calls.
5891    ///
5892    /// # Example
5893    /// ```no_run
5894    /// # use google_cloud_networkconnectivity_v1::builder;
5895    /// use builder::hub_service::GetIamPolicy;
5896    /// # tokio_test::block_on(async {
5897    ///
5898    /// let builder = prepare_request_builder();
5899    /// let response = builder.send().await?;
5900    /// # gax::Result::<()>::Ok(()) });
5901    ///
5902    /// fn prepare_request_builder() -> GetIamPolicy {
5903    ///   # panic!();
5904    ///   // ... details omitted ...
5905    /// }
5906    /// ```
5907    #[derive(Clone, Debug)]
5908    pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
5909
5910    impl GetIamPolicy {
5911        pub(crate) fn new(
5912            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5913        ) -> Self {
5914            Self(RequestBuilder::new(stub))
5915        }
5916
5917        /// Sets the full request, replacing any prior values.
5918        pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
5919            self.0.request = v.into();
5920            self
5921        }
5922
5923        /// Sets all the options, replacing any prior values.
5924        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5925            self.0.options = v.into();
5926            self
5927        }
5928
5929        /// Sends the request.
5930        pub async fn send(self) -> Result<iam_v1::model::Policy> {
5931            (*self.0.stub)
5932                .get_iam_policy(self.0.request, self.0.options)
5933                .await
5934                .map(gax::response::Response::into_body)
5935        }
5936
5937        /// Sets the value of [resource][iam_v1::model::GetIamPolicyRequest::resource].
5938        ///
5939        /// This is a **required** field for requests.
5940        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5941            self.0.request.resource = v.into();
5942            self
5943        }
5944
5945        /// Sets the value of [options][iam_v1::model::GetIamPolicyRequest::options].
5946        pub fn set_options<T>(mut self, v: T) -> Self
5947        where
5948            T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
5949        {
5950            self.0.request.options = std::option::Option::Some(v.into());
5951            self
5952        }
5953
5954        /// Sets or clears the value of [options][iam_v1::model::GetIamPolicyRequest::options].
5955        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
5956        where
5957            T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
5958        {
5959            self.0.request.options = v.map(|x| x.into());
5960            self
5961        }
5962    }
5963
5964    #[doc(hidden)]
5965    impl gax::options::internal::RequestBuilder for GetIamPolicy {
5966        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5967            &mut self.0.options
5968        }
5969    }
5970
5971    /// The request builder for [HubService::test_iam_permissions][crate::client::HubService::test_iam_permissions] calls.
5972    ///
5973    /// # Example
5974    /// ```no_run
5975    /// # use google_cloud_networkconnectivity_v1::builder;
5976    /// use builder::hub_service::TestIamPermissions;
5977    /// # tokio_test::block_on(async {
5978    ///
5979    /// let builder = prepare_request_builder();
5980    /// let response = builder.send().await?;
5981    /// # gax::Result::<()>::Ok(()) });
5982    ///
5983    /// fn prepare_request_builder() -> TestIamPermissions {
5984    ///   # panic!();
5985    ///   // ... details omitted ...
5986    /// }
5987    /// ```
5988    #[derive(Clone, Debug)]
5989    pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
5990
5991    impl TestIamPermissions {
5992        pub(crate) fn new(
5993            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5994        ) -> Self {
5995            Self(RequestBuilder::new(stub))
5996        }
5997
5998        /// Sets the full request, replacing any prior values.
5999        pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
6000            mut self,
6001            v: V,
6002        ) -> Self {
6003            self.0.request = v.into();
6004            self
6005        }
6006
6007        /// Sets all the options, replacing any prior values.
6008        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6009            self.0.options = v.into();
6010            self
6011        }
6012
6013        /// Sends the request.
6014        pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
6015            (*self.0.stub)
6016                .test_iam_permissions(self.0.request, self.0.options)
6017                .await
6018                .map(gax::response::Response::into_body)
6019        }
6020
6021        /// Sets the value of [resource][iam_v1::model::TestIamPermissionsRequest::resource].
6022        ///
6023        /// This is a **required** field for requests.
6024        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
6025            self.0.request.resource = v.into();
6026            self
6027        }
6028
6029        /// Sets the value of [permissions][iam_v1::model::TestIamPermissionsRequest::permissions].
6030        ///
6031        /// This is a **required** field for requests.
6032        pub fn set_permissions<T, V>(mut self, v: T) -> Self
6033        where
6034            T: std::iter::IntoIterator<Item = V>,
6035            V: std::convert::Into<std::string::String>,
6036        {
6037            use std::iter::Iterator;
6038            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
6039            self
6040        }
6041    }
6042
6043    #[doc(hidden)]
6044    impl gax::options::internal::RequestBuilder for TestIamPermissions {
6045        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6046            &mut self.0.options
6047        }
6048    }
6049
6050    /// The request builder for [HubService::list_operations][crate::client::HubService::list_operations] calls.
6051    ///
6052    /// # Example
6053    /// ```no_run
6054    /// # use google_cloud_networkconnectivity_v1::builder;
6055    /// use builder::hub_service::ListOperations;
6056    /// # tokio_test::block_on(async {
6057    /// use gax::paginator::ItemPaginator;
6058    ///
6059    /// let builder = prepare_request_builder();
6060    /// let mut items = builder.by_item();
6061    /// while let Some(result) = items.next().await {
6062    ///   let item = result?;
6063    /// }
6064    /// # gax::Result::<()>::Ok(()) });
6065    ///
6066    /// fn prepare_request_builder() -> ListOperations {
6067    ///   # panic!();
6068    ///   // ... details omitted ...
6069    /// }
6070    /// ```
6071    #[derive(Clone, Debug)]
6072    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
6073
6074    impl ListOperations {
6075        pub(crate) fn new(
6076            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6077        ) -> Self {
6078            Self(RequestBuilder::new(stub))
6079        }
6080
6081        /// Sets the full request, replacing any prior values.
6082        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
6083            mut self,
6084            v: V,
6085        ) -> Self {
6086            self.0.request = v.into();
6087            self
6088        }
6089
6090        /// Sets all the options, replacing any prior values.
6091        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6092            self.0.options = v.into();
6093            self
6094        }
6095
6096        /// Sends the request.
6097        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
6098            (*self.0.stub)
6099                .list_operations(self.0.request, self.0.options)
6100                .await
6101                .map(gax::response::Response::into_body)
6102        }
6103
6104        /// Streams each page in the collection.
6105        pub fn by_page(
6106            self,
6107        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
6108        {
6109            use std::clone::Clone;
6110            let token = self.0.request.page_token.clone();
6111            let execute = move |token: String| {
6112                let mut builder = self.clone();
6113                builder.0.request = builder.0.request.set_page_token(token);
6114                builder.send()
6115            };
6116            gax::paginator::internal::new_paginator(token, execute)
6117        }
6118
6119        /// Streams each item in the collection.
6120        pub fn by_item(
6121            self,
6122        ) -> impl gax::paginator::ItemPaginator<
6123            longrunning::model::ListOperationsResponse,
6124            gax::error::Error,
6125        > {
6126            use gax::paginator::Paginator;
6127            self.by_page().items()
6128        }
6129
6130        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
6131        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6132            self.0.request.name = v.into();
6133            self
6134        }
6135
6136        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
6137        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6138            self.0.request.filter = v.into();
6139            self
6140        }
6141
6142        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
6143        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6144            self.0.request.page_size = v.into();
6145            self
6146        }
6147
6148        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
6149        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6150            self.0.request.page_token = v.into();
6151            self
6152        }
6153    }
6154
6155    #[doc(hidden)]
6156    impl gax::options::internal::RequestBuilder for ListOperations {
6157        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6158            &mut self.0.options
6159        }
6160    }
6161
6162    /// The request builder for [HubService::get_operation][crate::client::HubService::get_operation] calls.
6163    ///
6164    /// # Example
6165    /// ```no_run
6166    /// # use google_cloud_networkconnectivity_v1::builder;
6167    /// use builder::hub_service::GetOperation;
6168    /// # tokio_test::block_on(async {
6169    ///
6170    /// let builder = prepare_request_builder();
6171    /// let response = builder.send().await?;
6172    /// # gax::Result::<()>::Ok(()) });
6173    ///
6174    /// fn prepare_request_builder() -> GetOperation {
6175    ///   # panic!();
6176    ///   // ... details omitted ...
6177    /// }
6178    /// ```
6179    #[derive(Clone, Debug)]
6180    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
6181
6182    impl GetOperation {
6183        pub(crate) fn new(
6184            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6185        ) -> Self {
6186            Self(RequestBuilder::new(stub))
6187        }
6188
6189        /// Sets the full request, replacing any prior values.
6190        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
6191            mut self,
6192            v: V,
6193        ) -> Self {
6194            self.0.request = v.into();
6195            self
6196        }
6197
6198        /// Sets all the options, replacing any prior values.
6199        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6200            self.0.options = v.into();
6201            self
6202        }
6203
6204        /// Sends the request.
6205        pub async fn send(self) -> Result<longrunning::model::Operation> {
6206            (*self.0.stub)
6207                .get_operation(self.0.request, self.0.options)
6208                .await
6209                .map(gax::response::Response::into_body)
6210        }
6211
6212        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
6213        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6214            self.0.request.name = v.into();
6215            self
6216        }
6217    }
6218
6219    #[doc(hidden)]
6220    impl gax::options::internal::RequestBuilder for GetOperation {
6221        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6222            &mut self.0.options
6223        }
6224    }
6225
6226    /// The request builder for [HubService::delete_operation][crate::client::HubService::delete_operation] calls.
6227    ///
6228    /// # Example
6229    /// ```no_run
6230    /// # use google_cloud_networkconnectivity_v1::builder;
6231    /// use builder::hub_service::DeleteOperation;
6232    /// # tokio_test::block_on(async {
6233    ///
6234    /// let builder = prepare_request_builder();
6235    /// let response = builder.send().await?;
6236    /// # gax::Result::<()>::Ok(()) });
6237    ///
6238    /// fn prepare_request_builder() -> DeleteOperation {
6239    ///   # panic!();
6240    ///   // ... details omitted ...
6241    /// }
6242    /// ```
6243    #[derive(Clone, Debug)]
6244    pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
6245
6246    impl DeleteOperation {
6247        pub(crate) fn new(
6248            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6249        ) -> Self {
6250            Self(RequestBuilder::new(stub))
6251        }
6252
6253        /// Sets the full request, replacing any prior values.
6254        pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
6255            mut self,
6256            v: V,
6257        ) -> Self {
6258            self.0.request = v.into();
6259            self
6260        }
6261
6262        /// Sets all the options, replacing any prior values.
6263        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6264            self.0.options = v.into();
6265            self
6266        }
6267
6268        /// Sends the request.
6269        pub async fn send(self) -> Result<()> {
6270            (*self.0.stub)
6271                .delete_operation(self.0.request, self.0.options)
6272                .await
6273                .map(gax::response::Response::into_body)
6274        }
6275
6276        /// Sets the value of [name][longrunning::model::DeleteOperationRequest::name].
6277        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6278            self.0.request.name = v.into();
6279            self
6280        }
6281    }
6282
6283    #[doc(hidden)]
6284    impl gax::options::internal::RequestBuilder for DeleteOperation {
6285        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6286            &mut self.0.options
6287        }
6288    }
6289
6290    /// The request builder for [HubService::cancel_operation][crate::client::HubService::cancel_operation] calls.
6291    ///
6292    /// # Example
6293    /// ```no_run
6294    /// # use google_cloud_networkconnectivity_v1::builder;
6295    /// use builder::hub_service::CancelOperation;
6296    /// # tokio_test::block_on(async {
6297    ///
6298    /// let builder = prepare_request_builder();
6299    /// let response = builder.send().await?;
6300    /// # gax::Result::<()>::Ok(()) });
6301    ///
6302    /// fn prepare_request_builder() -> CancelOperation {
6303    ///   # panic!();
6304    ///   // ... details omitted ...
6305    /// }
6306    /// ```
6307    #[derive(Clone, Debug)]
6308    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
6309
6310    impl CancelOperation {
6311        pub(crate) fn new(
6312            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6313        ) -> Self {
6314            Self(RequestBuilder::new(stub))
6315        }
6316
6317        /// Sets the full request, replacing any prior values.
6318        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
6319            mut self,
6320            v: V,
6321        ) -> Self {
6322            self.0.request = v.into();
6323            self
6324        }
6325
6326        /// Sets all the options, replacing any prior values.
6327        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6328            self.0.options = v.into();
6329            self
6330        }
6331
6332        /// Sends the request.
6333        pub async fn send(self) -> Result<()> {
6334            (*self.0.stub)
6335                .cancel_operation(self.0.request, self.0.options)
6336                .await
6337                .map(gax::response::Response::into_body)
6338        }
6339
6340        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
6341        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6342            self.0.request.name = v.into();
6343            self
6344        }
6345    }
6346
6347    #[doc(hidden)]
6348    impl gax::options::internal::RequestBuilder for CancelOperation {
6349        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6350            &mut self.0.options
6351        }
6352    }
6353}
6354
6355pub mod internal_range_service {
6356    use crate::Result;
6357
6358    /// A builder for [InternalRangeService][crate::client::InternalRangeService].
6359    ///
6360    /// ```
6361    /// # tokio_test::block_on(async {
6362    /// # use google_cloud_networkconnectivity_v1::*;
6363    /// # use builder::internal_range_service::ClientBuilder;
6364    /// # use client::InternalRangeService;
6365    /// let builder : ClientBuilder = InternalRangeService::builder();
6366    /// let client = builder
6367    ///     .with_endpoint("https://networkconnectivity.googleapis.com")
6368    ///     .build().await?;
6369    /// # gax::client_builder::Result::<()>::Ok(()) });
6370    /// ```
6371    pub type ClientBuilder =
6372        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
6373
6374    pub(crate) mod client {
6375        use super::super::super::client::InternalRangeService;
6376        pub struct Factory;
6377        impl gax::client_builder::internal::ClientFactory for Factory {
6378            type Client = InternalRangeService;
6379            type Credentials = gaxi::options::Credentials;
6380            async fn build(
6381                self,
6382                config: gaxi::options::ClientConfig,
6383            ) -> gax::client_builder::Result<Self::Client> {
6384                Self::Client::new(config).await
6385            }
6386        }
6387    }
6388
6389    /// Common implementation for [crate::client::InternalRangeService] request builders.
6390    #[derive(Clone, Debug)]
6391    pub(crate) struct RequestBuilder<R: std::default::Default> {
6392        stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
6393        request: R,
6394        options: gax::options::RequestOptions,
6395    }
6396
6397    impl<R> RequestBuilder<R>
6398    where
6399        R: std::default::Default,
6400    {
6401        pub(crate) fn new(
6402            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
6403        ) -> Self {
6404            Self {
6405                stub,
6406                request: R::default(),
6407                options: gax::options::RequestOptions::default(),
6408            }
6409        }
6410    }
6411
6412    /// The request builder for [InternalRangeService::list_internal_ranges][crate::client::InternalRangeService::list_internal_ranges] calls.
6413    ///
6414    /// # Example
6415    /// ```no_run
6416    /// # use google_cloud_networkconnectivity_v1::builder;
6417    /// use builder::internal_range_service::ListInternalRanges;
6418    /// # tokio_test::block_on(async {
6419    /// use gax::paginator::ItemPaginator;
6420    ///
6421    /// let builder = prepare_request_builder();
6422    /// let mut items = builder.by_item();
6423    /// while let Some(result) = items.next().await {
6424    ///   let item = result?;
6425    /// }
6426    /// # gax::Result::<()>::Ok(()) });
6427    ///
6428    /// fn prepare_request_builder() -> ListInternalRanges {
6429    ///   # panic!();
6430    ///   // ... details omitted ...
6431    /// }
6432    /// ```
6433    #[derive(Clone, Debug)]
6434    pub struct ListInternalRanges(RequestBuilder<crate::model::ListInternalRangesRequest>);
6435
6436    impl ListInternalRanges {
6437        pub(crate) fn new(
6438            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
6439        ) -> Self {
6440            Self(RequestBuilder::new(stub))
6441        }
6442
6443        /// Sets the full request, replacing any prior values.
6444        pub fn with_request<V: Into<crate::model::ListInternalRangesRequest>>(
6445            mut self,
6446            v: V,
6447        ) -> Self {
6448            self.0.request = v.into();
6449            self
6450        }
6451
6452        /// Sets all the options, replacing any prior values.
6453        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6454            self.0.options = v.into();
6455            self
6456        }
6457
6458        /// Sends the request.
6459        pub async fn send(self) -> Result<crate::model::ListInternalRangesResponse> {
6460            (*self.0.stub)
6461                .list_internal_ranges(self.0.request, self.0.options)
6462                .await
6463                .map(gax::response::Response::into_body)
6464        }
6465
6466        /// Streams each page in the collection.
6467        pub fn by_page(
6468            self,
6469        ) -> impl gax::paginator::Paginator<crate::model::ListInternalRangesResponse, gax::error::Error>
6470        {
6471            use std::clone::Clone;
6472            let token = self.0.request.page_token.clone();
6473            let execute = move |token: String| {
6474                let mut builder = self.clone();
6475                builder.0.request = builder.0.request.set_page_token(token);
6476                builder.send()
6477            };
6478            gax::paginator::internal::new_paginator(token, execute)
6479        }
6480
6481        /// Streams each item in the collection.
6482        pub fn by_item(
6483            self,
6484        ) -> impl gax::paginator::ItemPaginator<
6485            crate::model::ListInternalRangesResponse,
6486            gax::error::Error,
6487        > {
6488            use gax::paginator::Paginator;
6489            self.by_page().items()
6490        }
6491
6492        /// Sets the value of [parent][crate::model::ListInternalRangesRequest::parent].
6493        ///
6494        /// This is a **required** field for requests.
6495        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6496            self.0.request.parent = v.into();
6497            self
6498        }
6499
6500        /// Sets the value of [page_size][crate::model::ListInternalRangesRequest::page_size].
6501        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6502            self.0.request.page_size = v.into();
6503            self
6504        }
6505
6506        /// Sets the value of [page_token][crate::model::ListInternalRangesRequest::page_token].
6507        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6508            self.0.request.page_token = v.into();
6509            self
6510        }
6511
6512        /// Sets the value of [filter][crate::model::ListInternalRangesRequest::filter].
6513        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6514            self.0.request.filter = v.into();
6515            self
6516        }
6517
6518        /// Sets the value of [order_by][crate::model::ListInternalRangesRequest::order_by].
6519        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
6520            self.0.request.order_by = v.into();
6521            self
6522        }
6523    }
6524
6525    #[doc(hidden)]
6526    impl gax::options::internal::RequestBuilder for ListInternalRanges {
6527        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6528            &mut self.0.options
6529        }
6530    }
6531
6532    /// The request builder for [InternalRangeService::get_internal_range][crate::client::InternalRangeService::get_internal_range] calls.
6533    ///
6534    /// # Example
6535    /// ```no_run
6536    /// # use google_cloud_networkconnectivity_v1::builder;
6537    /// use builder::internal_range_service::GetInternalRange;
6538    /// # tokio_test::block_on(async {
6539    ///
6540    /// let builder = prepare_request_builder();
6541    /// let response = builder.send().await?;
6542    /// # gax::Result::<()>::Ok(()) });
6543    ///
6544    /// fn prepare_request_builder() -> GetInternalRange {
6545    ///   # panic!();
6546    ///   // ... details omitted ...
6547    /// }
6548    /// ```
6549    #[derive(Clone, Debug)]
6550    pub struct GetInternalRange(RequestBuilder<crate::model::GetInternalRangeRequest>);
6551
6552    impl GetInternalRange {
6553        pub(crate) fn new(
6554            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
6555        ) -> Self {
6556            Self(RequestBuilder::new(stub))
6557        }
6558
6559        /// Sets the full request, replacing any prior values.
6560        pub fn with_request<V: Into<crate::model::GetInternalRangeRequest>>(
6561            mut self,
6562            v: V,
6563        ) -> Self {
6564            self.0.request = v.into();
6565            self
6566        }
6567
6568        /// Sets all the options, replacing any prior values.
6569        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6570            self.0.options = v.into();
6571            self
6572        }
6573
6574        /// Sends the request.
6575        pub async fn send(self) -> Result<crate::model::InternalRange> {
6576            (*self.0.stub)
6577                .get_internal_range(self.0.request, self.0.options)
6578                .await
6579                .map(gax::response::Response::into_body)
6580        }
6581
6582        /// Sets the value of [name][crate::model::GetInternalRangeRequest::name].
6583        ///
6584        /// This is a **required** field for requests.
6585        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6586            self.0.request.name = v.into();
6587            self
6588        }
6589    }
6590
6591    #[doc(hidden)]
6592    impl gax::options::internal::RequestBuilder for GetInternalRange {
6593        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6594            &mut self.0.options
6595        }
6596    }
6597
6598    /// The request builder for [InternalRangeService::create_internal_range][crate::client::InternalRangeService::create_internal_range] calls.
6599    ///
6600    /// # Example
6601    /// ```no_run
6602    /// # use google_cloud_networkconnectivity_v1::builder;
6603    /// use builder::internal_range_service::CreateInternalRange;
6604    /// # tokio_test::block_on(async {
6605    /// use lro::Poller;
6606    ///
6607    /// let builder = prepare_request_builder();
6608    /// let response = builder.poller().until_done().await?;
6609    /// # gax::Result::<()>::Ok(()) });
6610    ///
6611    /// fn prepare_request_builder() -> CreateInternalRange {
6612    ///   # panic!();
6613    ///   // ... details omitted ...
6614    /// }
6615    /// ```
6616    #[derive(Clone, Debug)]
6617    pub struct CreateInternalRange(RequestBuilder<crate::model::CreateInternalRangeRequest>);
6618
6619    impl CreateInternalRange {
6620        pub(crate) fn new(
6621            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
6622        ) -> Self {
6623            Self(RequestBuilder::new(stub))
6624        }
6625
6626        /// Sets the full request, replacing any prior values.
6627        pub fn with_request<V: Into<crate::model::CreateInternalRangeRequest>>(
6628            mut self,
6629            v: V,
6630        ) -> Self {
6631            self.0.request = v.into();
6632            self
6633        }
6634
6635        /// Sets all the options, replacing any prior values.
6636        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6637            self.0.options = v.into();
6638            self
6639        }
6640
6641        /// Sends the request.
6642        ///
6643        /// # Long running operations
6644        ///
6645        /// This starts, but does not poll, a longrunning operation. More information
6646        /// on [create_internal_range][crate::client::InternalRangeService::create_internal_range].
6647        pub async fn send(self) -> Result<longrunning::model::Operation> {
6648            (*self.0.stub)
6649                .create_internal_range(self.0.request, self.0.options)
6650                .await
6651                .map(gax::response::Response::into_body)
6652        }
6653
6654        /// Creates a [Poller][lro::Poller] to work with `create_internal_range`.
6655        pub fn poller(
6656            self,
6657        ) -> impl lro::Poller<crate::model::InternalRange, crate::model::OperationMetadata>
6658        {
6659            type Operation = lro::internal::Operation<
6660                crate::model::InternalRange,
6661                crate::model::OperationMetadata,
6662            >;
6663            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6664            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6665
6666            let stub = self.0.stub.clone();
6667            let mut options = self.0.options.clone();
6668            options.set_retry_policy(gax::retry_policy::NeverRetry);
6669            let query = move |name| {
6670                let stub = stub.clone();
6671                let options = options.clone();
6672                async {
6673                    let op = GetOperation::new(stub)
6674                        .set_name(name)
6675                        .with_options(options)
6676                        .send()
6677                        .await?;
6678                    Ok(Operation::new(op))
6679                }
6680            };
6681
6682            let start = move || async {
6683                let op = self.send().await?;
6684                Ok(Operation::new(op))
6685            };
6686
6687            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
6688        }
6689
6690        /// Sets the value of [parent][crate::model::CreateInternalRangeRequest::parent].
6691        ///
6692        /// This is a **required** field for requests.
6693        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6694            self.0.request.parent = v.into();
6695            self
6696        }
6697
6698        /// Sets the value of [internal_range_id][crate::model::CreateInternalRangeRequest::internal_range_id].
6699        pub fn set_internal_range_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6700            self.0.request.internal_range_id = v.into();
6701            self
6702        }
6703
6704        /// Sets the value of [internal_range][crate::model::CreateInternalRangeRequest::internal_range].
6705        ///
6706        /// This is a **required** field for requests.
6707        pub fn set_internal_range<T>(mut self, v: T) -> Self
6708        where
6709            T: std::convert::Into<crate::model::InternalRange>,
6710        {
6711            self.0.request.internal_range = std::option::Option::Some(v.into());
6712            self
6713        }
6714
6715        /// Sets or clears the value of [internal_range][crate::model::CreateInternalRangeRequest::internal_range].
6716        ///
6717        /// This is a **required** field for requests.
6718        pub fn set_or_clear_internal_range<T>(mut self, v: std::option::Option<T>) -> Self
6719        where
6720            T: std::convert::Into<crate::model::InternalRange>,
6721        {
6722            self.0.request.internal_range = v.map(|x| x.into());
6723            self
6724        }
6725
6726        /// Sets the value of [request_id][crate::model::CreateInternalRangeRequest::request_id].
6727        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6728            self.0.request.request_id = v.into();
6729            self
6730        }
6731    }
6732
6733    #[doc(hidden)]
6734    impl gax::options::internal::RequestBuilder for CreateInternalRange {
6735        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6736            &mut self.0.options
6737        }
6738    }
6739
6740    /// The request builder for [InternalRangeService::update_internal_range][crate::client::InternalRangeService::update_internal_range] calls.
6741    ///
6742    /// # Example
6743    /// ```no_run
6744    /// # use google_cloud_networkconnectivity_v1::builder;
6745    /// use builder::internal_range_service::UpdateInternalRange;
6746    /// # tokio_test::block_on(async {
6747    /// use lro::Poller;
6748    ///
6749    /// let builder = prepare_request_builder();
6750    /// let response = builder.poller().until_done().await?;
6751    /// # gax::Result::<()>::Ok(()) });
6752    ///
6753    /// fn prepare_request_builder() -> UpdateInternalRange {
6754    ///   # panic!();
6755    ///   // ... details omitted ...
6756    /// }
6757    /// ```
6758    #[derive(Clone, Debug)]
6759    pub struct UpdateInternalRange(RequestBuilder<crate::model::UpdateInternalRangeRequest>);
6760
6761    impl UpdateInternalRange {
6762        pub(crate) fn new(
6763            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
6764        ) -> Self {
6765            Self(RequestBuilder::new(stub))
6766        }
6767
6768        /// Sets the full request, replacing any prior values.
6769        pub fn with_request<V: Into<crate::model::UpdateInternalRangeRequest>>(
6770            mut self,
6771            v: V,
6772        ) -> Self {
6773            self.0.request = v.into();
6774            self
6775        }
6776
6777        /// Sets all the options, replacing any prior values.
6778        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6779            self.0.options = v.into();
6780            self
6781        }
6782
6783        /// Sends the request.
6784        ///
6785        /// # Long running operations
6786        ///
6787        /// This starts, but does not poll, a longrunning operation. More information
6788        /// on [update_internal_range][crate::client::InternalRangeService::update_internal_range].
6789        pub async fn send(self) -> Result<longrunning::model::Operation> {
6790            (*self.0.stub)
6791                .update_internal_range(self.0.request, self.0.options)
6792                .await
6793                .map(gax::response::Response::into_body)
6794        }
6795
6796        /// Creates a [Poller][lro::Poller] to work with `update_internal_range`.
6797        pub fn poller(
6798            self,
6799        ) -> impl lro::Poller<crate::model::InternalRange, crate::model::OperationMetadata>
6800        {
6801            type Operation = lro::internal::Operation<
6802                crate::model::InternalRange,
6803                crate::model::OperationMetadata,
6804            >;
6805            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6806            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6807
6808            let stub = self.0.stub.clone();
6809            let mut options = self.0.options.clone();
6810            options.set_retry_policy(gax::retry_policy::NeverRetry);
6811            let query = move |name| {
6812                let stub = stub.clone();
6813                let options = options.clone();
6814                async {
6815                    let op = GetOperation::new(stub)
6816                        .set_name(name)
6817                        .with_options(options)
6818                        .send()
6819                        .await?;
6820                    Ok(Operation::new(op))
6821                }
6822            };
6823
6824            let start = move || async {
6825                let op = self.send().await?;
6826                Ok(Operation::new(op))
6827            };
6828
6829            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
6830        }
6831
6832        /// Sets the value of [update_mask][crate::model::UpdateInternalRangeRequest::update_mask].
6833        pub fn set_update_mask<T>(mut self, v: T) -> Self
6834        where
6835            T: std::convert::Into<wkt::FieldMask>,
6836        {
6837            self.0.request.update_mask = std::option::Option::Some(v.into());
6838            self
6839        }
6840
6841        /// Sets or clears the value of [update_mask][crate::model::UpdateInternalRangeRequest::update_mask].
6842        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6843        where
6844            T: std::convert::Into<wkt::FieldMask>,
6845        {
6846            self.0.request.update_mask = v.map(|x| x.into());
6847            self
6848        }
6849
6850        /// Sets the value of [internal_range][crate::model::UpdateInternalRangeRequest::internal_range].
6851        ///
6852        /// This is a **required** field for requests.
6853        pub fn set_internal_range<T>(mut self, v: T) -> Self
6854        where
6855            T: std::convert::Into<crate::model::InternalRange>,
6856        {
6857            self.0.request.internal_range = std::option::Option::Some(v.into());
6858            self
6859        }
6860
6861        /// Sets or clears the value of [internal_range][crate::model::UpdateInternalRangeRequest::internal_range].
6862        ///
6863        /// This is a **required** field for requests.
6864        pub fn set_or_clear_internal_range<T>(mut self, v: std::option::Option<T>) -> Self
6865        where
6866            T: std::convert::Into<crate::model::InternalRange>,
6867        {
6868            self.0.request.internal_range = v.map(|x| x.into());
6869            self
6870        }
6871
6872        /// Sets the value of [request_id][crate::model::UpdateInternalRangeRequest::request_id].
6873        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6874            self.0.request.request_id = v.into();
6875            self
6876        }
6877    }
6878
6879    #[doc(hidden)]
6880    impl gax::options::internal::RequestBuilder for UpdateInternalRange {
6881        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6882            &mut self.0.options
6883        }
6884    }
6885
6886    /// The request builder for [InternalRangeService::delete_internal_range][crate::client::InternalRangeService::delete_internal_range] calls.
6887    ///
6888    /// # Example
6889    /// ```no_run
6890    /// # use google_cloud_networkconnectivity_v1::builder;
6891    /// use builder::internal_range_service::DeleteInternalRange;
6892    /// # tokio_test::block_on(async {
6893    /// use lro::Poller;
6894    ///
6895    /// let builder = prepare_request_builder();
6896    /// let response = builder.poller().until_done().await?;
6897    /// # gax::Result::<()>::Ok(()) });
6898    ///
6899    /// fn prepare_request_builder() -> DeleteInternalRange {
6900    ///   # panic!();
6901    ///   // ... details omitted ...
6902    /// }
6903    /// ```
6904    #[derive(Clone, Debug)]
6905    pub struct DeleteInternalRange(RequestBuilder<crate::model::DeleteInternalRangeRequest>);
6906
6907    impl DeleteInternalRange {
6908        pub(crate) fn new(
6909            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
6910        ) -> Self {
6911            Self(RequestBuilder::new(stub))
6912        }
6913
6914        /// Sets the full request, replacing any prior values.
6915        pub fn with_request<V: Into<crate::model::DeleteInternalRangeRequest>>(
6916            mut self,
6917            v: V,
6918        ) -> Self {
6919            self.0.request = v.into();
6920            self
6921        }
6922
6923        /// Sets all the options, replacing any prior values.
6924        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6925            self.0.options = v.into();
6926            self
6927        }
6928
6929        /// Sends the request.
6930        ///
6931        /// # Long running operations
6932        ///
6933        /// This starts, but does not poll, a longrunning operation. More information
6934        /// on [delete_internal_range][crate::client::InternalRangeService::delete_internal_range].
6935        pub async fn send(self) -> Result<longrunning::model::Operation> {
6936            (*self.0.stub)
6937                .delete_internal_range(self.0.request, self.0.options)
6938                .await
6939                .map(gax::response::Response::into_body)
6940        }
6941
6942        /// Creates a [Poller][lro::Poller] to work with `delete_internal_range`.
6943        pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
6944            type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
6945            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6946            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6947
6948            let stub = self.0.stub.clone();
6949            let mut options = self.0.options.clone();
6950            options.set_retry_policy(gax::retry_policy::NeverRetry);
6951            let query = move |name| {
6952                let stub = stub.clone();
6953                let options = options.clone();
6954                async {
6955                    let op = GetOperation::new(stub)
6956                        .set_name(name)
6957                        .with_options(options)
6958                        .send()
6959                        .await?;
6960                    Ok(Operation::new(op))
6961                }
6962            };
6963
6964            let start = move || async {
6965                let op = self.send().await?;
6966                Ok(Operation::new(op))
6967            };
6968
6969            lro::internal::new_unit_response_poller(
6970                polling_error_policy,
6971                polling_backoff_policy,
6972                start,
6973                query,
6974            )
6975        }
6976
6977        /// Sets the value of [name][crate::model::DeleteInternalRangeRequest::name].
6978        ///
6979        /// This is a **required** field for requests.
6980        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6981            self.0.request.name = v.into();
6982            self
6983        }
6984
6985        /// Sets the value of [request_id][crate::model::DeleteInternalRangeRequest::request_id].
6986        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6987            self.0.request.request_id = v.into();
6988            self
6989        }
6990    }
6991
6992    #[doc(hidden)]
6993    impl gax::options::internal::RequestBuilder for DeleteInternalRange {
6994        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6995            &mut self.0.options
6996        }
6997    }
6998
6999    /// The request builder for [InternalRangeService::list_locations][crate::client::InternalRangeService::list_locations] calls.
7000    ///
7001    /// # Example
7002    /// ```no_run
7003    /// # use google_cloud_networkconnectivity_v1::builder;
7004    /// use builder::internal_range_service::ListLocations;
7005    /// # tokio_test::block_on(async {
7006    /// use gax::paginator::ItemPaginator;
7007    ///
7008    /// let builder = prepare_request_builder();
7009    /// let mut items = builder.by_item();
7010    /// while let Some(result) = items.next().await {
7011    ///   let item = result?;
7012    /// }
7013    /// # gax::Result::<()>::Ok(()) });
7014    ///
7015    /// fn prepare_request_builder() -> ListLocations {
7016    ///   # panic!();
7017    ///   // ... details omitted ...
7018    /// }
7019    /// ```
7020    #[derive(Clone, Debug)]
7021    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
7022
7023    impl ListLocations {
7024        pub(crate) fn new(
7025            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
7026        ) -> Self {
7027            Self(RequestBuilder::new(stub))
7028        }
7029
7030        /// Sets the full request, replacing any prior values.
7031        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
7032            mut self,
7033            v: V,
7034        ) -> Self {
7035            self.0.request = v.into();
7036            self
7037        }
7038
7039        /// Sets all the options, replacing any prior values.
7040        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7041            self.0.options = v.into();
7042            self
7043        }
7044
7045        /// Sends the request.
7046        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
7047            (*self.0.stub)
7048                .list_locations(self.0.request, self.0.options)
7049                .await
7050                .map(gax::response::Response::into_body)
7051        }
7052
7053        /// Streams each page in the collection.
7054        pub fn by_page(
7055            self,
7056        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
7057        {
7058            use std::clone::Clone;
7059            let token = self.0.request.page_token.clone();
7060            let execute = move |token: String| {
7061                let mut builder = self.clone();
7062                builder.0.request = builder.0.request.set_page_token(token);
7063                builder.send()
7064            };
7065            gax::paginator::internal::new_paginator(token, execute)
7066        }
7067
7068        /// Streams each item in the collection.
7069        pub fn by_item(
7070            self,
7071        ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
7072        {
7073            use gax::paginator::Paginator;
7074            self.by_page().items()
7075        }
7076
7077        /// Sets the value of [name][location::model::ListLocationsRequest::name].
7078        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7079            self.0.request.name = v.into();
7080            self
7081        }
7082
7083        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
7084        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7085            self.0.request.filter = v.into();
7086            self
7087        }
7088
7089        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
7090        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7091            self.0.request.page_size = v.into();
7092            self
7093        }
7094
7095        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
7096        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7097            self.0.request.page_token = v.into();
7098            self
7099        }
7100    }
7101
7102    #[doc(hidden)]
7103    impl gax::options::internal::RequestBuilder for ListLocations {
7104        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7105            &mut self.0.options
7106        }
7107    }
7108
7109    /// The request builder for [InternalRangeService::get_location][crate::client::InternalRangeService::get_location] calls.
7110    ///
7111    /// # Example
7112    /// ```no_run
7113    /// # use google_cloud_networkconnectivity_v1::builder;
7114    /// use builder::internal_range_service::GetLocation;
7115    /// # tokio_test::block_on(async {
7116    ///
7117    /// let builder = prepare_request_builder();
7118    /// let response = builder.send().await?;
7119    /// # gax::Result::<()>::Ok(()) });
7120    ///
7121    /// fn prepare_request_builder() -> GetLocation {
7122    ///   # panic!();
7123    ///   // ... details omitted ...
7124    /// }
7125    /// ```
7126    #[derive(Clone, Debug)]
7127    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
7128
7129    impl GetLocation {
7130        pub(crate) fn new(
7131            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
7132        ) -> Self {
7133            Self(RequestBuilder::new(stub))
7134        }
7135
7136        /// Sets the full request, replacing any prior values.
7137        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
7138            self.0.request = v.into();
7139            self
7140        }
7141
7142        /// Sets all the options, replacing any prior values.
7143        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7144            self.0.options = v.into();
7145            self
7146        }
7147
7148        /// Sends the request.
7149        pub async fn send(self) -> Result<location::model::Location> {
7150            (*self.0.stub)
7151                .get_location(self.0.request, self.0.options)
7152                .await
7153                .map(gax::response::Response::into_body)
7154        }
7155
7156        /// Sets the value of [name][location::model::GetLocationRequest::name].
7157        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7158            self.0.request.name = v.into();
7159            self
7160        }
7161    }
7162
7163    #[doc(hidden)]
7164    impl gax::options::internal::RequestBuilder for GetLocation {
7165        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7166            &mut self.0.options
7167        }
7168    }
7169
7170    /// The request builder for [InternalRangeService::set_iam_policy][crate::client::InternalRangeService::set_iam_policy] calls.
7171    ///
7172    /// # Example
7173    /// ```no_run
7174    /// # use google_cloud_networkconnectivity_v1::builder;
7175    /// use builder::internal_range_service::SetIamPolicy;
7176    /// # tokio_test::block_on(async {
7177    ///
7178    /// let builder = prepare_request_builder();
7179    /// let response = builder.send().await?;
7180    /// # gax::Result::<()>::Ok(()) });
7181    ///
7182    /// fn prepare_request_builder() -> SetIamPolicy {
7183    ///   # panic!();
7184    ///   // ... details omitted ...
7185    /// }
7186    /// ```
7187    #[derive(Clone, Debug)]
7188    pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
7189
7190    impl SetIamPolicy {
7191        pub(crate) fn new(
7192            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
7193        ) -> Self {
7194            Self(RequestBuilder::new(stub))
7195        }
7196
7197        /// Sets the full request, replacing any prior values.
7198        pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
7199            self.0.request = v.into();
7200            self
7201        }
7202
7203        /// Sets all the options, replacing any prior values.
7204        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7205            self.0.options = v.into();
7206            self
7207        }
7208
7209        /// Sends the request.
7210        pub async fn send(self) -> Result<iam_v1::model::Policy> {
7211            (*self.0.stub)
7212                .set_iam_policy(self.0.request, self.0.options)
7213                .await
7214                .map(gax::response::Response::into_body)
7215        }
7216
7217        /// Sets the value of [resource][iam_v1::model::SetIamPolicyRequest::resource].
7218        ///
7219        /// This is a **required** field for requests.
7220        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
7221            self.0.request.resource = v.into();
7222            self
7223        }
7224
7225        /// Sets the value of [policy][iam_v1::model::SetIamPolicyRequest::policy].
7226        ///
7227        /// This is a **required** field for requests.
7228        pub fn set_policy<T>(mut self, v: T) -> Self
7229        where
7230            T: std::convert::Into<iam_v1::model::Policy>,
7231        {
7232            self.0.request.policy = std::option::Option::Some(v.into());
7233            self
7234        }
7235
7236        /// Sets or clears the value of [policy][iam_v1::model::SetIamPolicyRequest::policy].
7237        ///
7238        /// This is a **required** field for requests.
7239        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
7240        where
7241            T: std::convert::Into<iam_v1::model::Policy>,
7242        {
7243            self.0.request.policy = v.map(|x| x.into());
7244            self
7245        }
7246
7247        /// Sets the value of [update_mask][iam_v1::model::SetIamPolicyRequest::update_mask].
7248        pub fn set_update_mask<T>(mut self, v: T) -> Self
7249        where
7250            T: std::convert::Into<wkt::FieldMask>,
7251        {
7252            self.0.request.update_mask = std::option::Option::Some(v.into());
7253            self
7254        }
7255
7256        /// Sets or clears the value of [update_mask][iam_v1::model::SetIamPolicyRequest::update_mask].
7257        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7258        where
7259            T: std::convert::Into<wkt::FieldMask>,
7260        {
7261            self.0.request.update_mask = v.map(|x| x.into());
7262            self
7263        }
7264    }
7265
7266    #[doc(hidden)]
7267    impl gax::options::internal::RequestBuilder for SetIamPolicy {
7268        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7269            &mut self.0.options
7270        }
7271    }
7272
7273    /// The request builder for [InternalRangeService::get_iam_policy][crate::client::InternalRangeService::get_iam_policy] calls.
7274    ///
7275    /// # Example
7276    /// ```no_run
7277    /// # use google_cloud_networkconnectivity_v1::builder;
7278    /// use builder::internal_range_service::GetIamPolicy;
7279    /// # tokio_test::block_on(async {
7280    ///
7281    /// let builder = prepare_request_builder();
7282    /// let response = builder.send().await?;
7283    /// # gax::Result::<()>::Ok(()) });
7284    ///
7285    /// fn prepare_request_builder() -> GetIamPolicy {
7286    ///   # panic!();
7287    ///   // ... details omitted ...
7288    /// }
7289    /// ```
7290    #[derive(Clone, Debug)]
7291    pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
7292
7293    impl GetIamPolicy {
7294        pub(crate) fn new(
7295            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
7296        ) -> Self {
7297            Self(RequestBuilder::new(stub))
7298        }
7299
7300        /// Sets the full request, replacing any prior values.
7301        pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
7302            self.0.request = v.into();
7303            self
7304        }
7305
7306        /// Sets all the options, replacing any prior values.
7307        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7308            self.0.options = v.into();
7309            self
7310        }
7311
7312        /// Sends the request.
7313        pub async fn send(self) -> Result<iam_v1::model::Policy> {
7314            (*self.0.stub)
7315                .get_iam_policy(self.0.request, self.0.options)
7316                .await
7317                .map(gax::response::Response::into_body)
7318        }
7319
7320        /// Sets the value of [resource][iam_v1::model::GetIamPolicyRequest::resource].
7321        ///
7322        /// This is a **required** field for requests.
7323        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
7324            self.0.request.resource = v.into();
7325            self
7326        }
7327
7328        /// Sets the value of [options][iam_v1::model::GetIamPolicyRequest::options].
7329        pub fn set_options<T>(mut self, v: T) -> Self
7330        where
7331            T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
7332        {
7333            self.0.request.options = std::option::Option::Some(v.into());
7334            self
7335        }
7336
7337        /// Sets or clears the value of [options][iam_v1::model::GetIamPolicyRequest::options].
7338        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
7339        where
7340            T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
7341        {
7342            self.0.request.options = v.map(|x| x.into());
7343            self
7344        }
7345    }
7346
7347    #[doc(hidden)]
7348    impl gax::options::internal::RequestBuilder for GetIamPolicy {
7349        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7350            &mut self.0.options
7351        }
7352    }
7353
7354    /// The request builder for [InternalRangeService::test_iam_permissions][crate::client::InternalRangeService::test_iam_permissions] calls.
7355    ///
7356    /// # Example
7357    /// ```no_run
7358    /// # use google_cloud_networkconnectivity_v1::builder;
7359    /// use builder::internal_range_service::TestIamPermissions;
7360    /// # tokio_test::block_on(async {
7361    ///
7362    /// let builder = prepare_request_builder();
7363    /// let response = builder.send().await?;
7364    /// # gax::Result::<()>::Ok(()) });
7365    ///
7366    /// fn prepare_request_builder() -> TestIamPermissions {
7367    ///   # panic!();
7368    ///   // ... details omitted ...
7369    /// }
7370    /// ```
7371    #[derive(Clone, Debug)]
7372    pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
7373
7374    impl TestIamPermissions {
7375        pub(crate) fn new(
7376            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
7377        ) -> Self {
7378            Self(RequestBuilder::new(stub))
7379        }
7380
7381        /// Sets the full request, replacing any prior values.
7382        pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
7383            mut self,
7384            v: V,
7385        ) -> Self {
7386            self.0.request = v.into();
7387            self
7388        }
7389
7390        /// Sets all the options, replacing any prior values.
7391        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7392            self.0.options = v.into();
7393            self
7394        }
7395
7396        /// Sends the request.
7397        pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
7398            (*self.0.stub)
7399                .test_iam_permissions(self.0.request, self.0.options)
7400                .await
7401                .map(gax::response::Response::into_body)
7402        }
7403
7404        /// Sets the value of [resource][iam_v1::model::TestIamPermissionsRequest::resource].
7405        ///
7406        /// This is a **required** field for requests.
7407        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
7408            self.0.request.resource = v.into();
7409            self
7410        }
7411
7412        /// Sets the value of [permissions][iam_v1::model::TestIamPermissionsRequest::permissions].
7413        ///
7414        /// This is a **required** field for requests.
7415        pub fn set_permissions<T, V>(mut self, v: T) -> Self
7416        where
7417            T: std::iter::IntoIterator<Item = V>,
7418            V: std::convert::Into<std::string::String>,
7419        {
7420            use std::iter::Iterator;
7421            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
7422            self
7423        }
7424    }
7425
7426    #[doc(hidden)]
7427    impl gax::options::internal::RequestBuilder for TestIamPermissions {
7428        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7429            &mut self.0.options
7430        }
7431    }
7432
7433    /// The request builder for [InternalRangeService::list_operations][crate::client::InternalRangeService::list_operations] calls.
7434    ///
7435    /// # Example
7436    /// ```no_run
7437    /// # use google_cloud_networkconnectivity_v1::builder;
7438    /// use builder::internal_range_service::ListOperations;
7439    /// # tokio_test::block_on(async {
7440    /// use gax::paginator::ItemPaginator;
7441    ///
7442    /// let builder = prepare_request_builder();
7443    /// let mut items = builder.by_item();
7444    /// while let Some(result) = items.next().await {
7445    ///   let item = result?;
7446    /// }
7447    /// # gax::Result::<()>::Ok(()) });
7448    ///
7449    /// fn prepare_request_builder() -> ListOperations {
7450    ///   # panic!();
7451    ///   // ... details omitted ...
7452    /// }
7453    /// ```
7454    #[derive(Clone, Debug)]
7455    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
7456
7457    impl ListOperations {
7458        pub(crate) fn new(
7459            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
7460        ) -> Self {
7461            Self(RequestBuilder::new(stub))
7462        }
7463
7464        /// Sets the full request, replacing any prior values.
7465        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
7466            mut self,
7467            v: V,
7468        ) -> Self {
7469            self.0.request = v.into();
7470            self
7471        }
7472
7473        /// Sets all the options, replacing any prior values.
7474        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7475            self.0.options = v.into();
7476            self
7477        }
7478
7479        /// Sends the request.
7480        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
7481            (*self.0.stub)
7482                .list_operations(self.0.request, self.0.options)
7483                .await
7484                .map(gax::response::Response::into_body)
7485        }
7486
7487        /// Streams each page in the collection.
7488        pub fn by_page(
7489            self,
7490        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
7491        {
7492            use std::clone::Clone;
7493            let token = self.0.request.page_token.clone();
7494            let execute = move |token: String| {
7495                let mut builder = self.clone();
7496                builder.0.request = builder.0.request.set_page_token(token);
7497                builder.send()
7498            };
7499            gax::paginator::internal::new_paginator(token, execute)
7500        }
7501
7502        /// Streams each item in the collection.
7503        pub fn by_item(
7504            self,
7505        ) -> impl gax::paginator::ItemPaginator<
7506            longrunning::model::ListOperationsResponse,
7507            gax::error::Error,
7508        > {
7509            use gax::paginator::Paginator;
7510            self.by_page().items()
7511        }
7512
7513        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
7514        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7515            self.0.request.name = v.into();
7516            self
7517        }
7518
7519        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
7520        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7521            self.0.request.filter = v.into();
7522            self
7523        }
7524
7525        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
7526        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7527            self.0.request.page_size = v.into();
7528            self
7529        }
7530
7531        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
7532        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7533            self.0.request.page_token = v.into();
7534            self
7535        }
7536    }
7537
7538    #[doc(hidden)]
7539    impl gax::options::internal::RequestBuilder for ListOperations {
7540        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7541            &mut self.0.options
7542        }
7543    }
7544
7545    /// The request builder for [InternalRangeService::get_operation][crate::client::InternalRangeService::get_operation] calls.
7546    ///
7547    /// # Example
7548    /// ```no_run
7549    /// # use google_cloud_networkconnectivity_v1::builder;
7550    /// use builder::internal_range_service::GetOperation;
7551    /// # tokio_test::block_on(async {
7552    ///
7553    /// let builder = prepare_request_builder();
7554    /// let response = builder.send().await?;
7555    /// # gax::Result::<()>::Ok(()) });
7556    ///
7557    /// fn prepare_request_builder() -> GetOperation {
7558    ///   # panic!();
7559    ///   // ... details omitted ...
7560    /// }
7561    /// ```
7562    #[derive(Clone, Debug)]
7563    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
7564
7565    impl GetOperation {
7566        pub(crate) fn new(
7567            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
7568        ) -> Self {
7569            Self(RequestBuilder::new(stub))
7570        }
7571
7572        /// Sets the full request, replacing any prior values.
7573        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
7574            mut self,
7575            v: V,
7576        ) -> Self {
7577            self.0.request = v.into();
7578            self
7579        }
7580
7581        /// Sets all the options, replacing any prior values.
7582        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7583            self.0.options = v.into();
7584            self
7585        }
7586
7587        /// Sends the request.
7588        pub async fn send(self) -> Result<longrunning::model::Operation> {
7589            (*self.0.stub)
7590                .get_operation(self.0.request, self.0.options)
7591                .await
7592                .map(gax::response::Response::into_body)
7593        }
7594
7595        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
7596        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7597            self.0.request.name = v.into();
7598            self
7599        }
7600    }
7601
7602    #[doc(hidden)]
7603    impl gax::options::internal::RequestBuilder for GetOperation {
7604        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7605            &mut self.0.options
7606        }
7607    }
7608
7609    /// The request builder for [InternalRangeService::delete_operation][crate::client::InternalRangeService::delete_operation] calls.
7610    ///
7611    /// # Example
7612    /// ```no_run
7613    /// # use google_cloud_networkconnectivity_v1::builder;
7614    /// use builder::internal_range_service::DeleteOperation;
7615    /// # tokio_test::block_on(async {
7616    ///
7617    /// let builder = prepare_request_builder();
7618    /// let response = builder.send().await?;
7619    /// # gax::Result::<()>::Ok(()) });
7620    ///
7621    /// fn prepare_request_builder() -> DeleteOperation {
7622    ///   # panic!();
7623    ///   // ... details omitted ...
7624    /// }
7625    /// ```
7626    #[derive(Clone, Debug)]
7627    pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
7628
7629    impl DeleteOperation {
7630        pub(crate) fn new(
7631            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
7632        ) -> Self {
7633            Self(RequestBuilder::new(stub))
7634        }
7635
7636        /// Sets the full request, replacing any prior values.
7637        pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
7638            mut self,
7639            v: V,
7640        ) -> Self {
7641            self.0.request = v.into();
7642            self
7643        }
7644
7645        /// Sets all the options, replacing any prior values.
7646        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7647            self.0.options = v.into();
7648            self
7649        }
7650
7651        /// Sends the request.
7652        pub async fn send(self) -> Result<()> {
7653            (*self.0.stub)
7654                .delete_operation(self.0.request, self.0.options)
7655                .await
7656                .map(gax::response::Response::into_body)
7657        }
7658
7659        /// Sets the value of [name][longrunning::model::DeleteOperationRequest::name].
7660        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7661            self.0.request.name = v.into();
7662            self
7663        }
7664    }
7665
7666    #[doc(hidden)]
7667    impl gax::options::internal::RequestBuilder for DeleteOperation {
7668        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7669            &mut self.0.options
7670        }
7671    }
7672
7673    /// The request builder for [InternalRangeService::cancel_operation][crate::client::InternalRangeService::cancel_operation] calls.
7674    ///
7675    /// # Example
7676    /// ```no_run
7677    /// # use google_cloud_networkconnectivity_v1::builder;
7678    /// use builder::internal_range_service::CancelOperation;
7679    /// # tokio_test::block_on(async {
7680    ///
7681    /// let builder = prepare_request_builder();
7682    /// let response = builder.send().await?;
7683    /// # gax::Result::<()>::Ok(()) });
7684    ///
7685    /// fn prepare_request_builder() -> CancelOperation {
7686    ///   # panic!();
7687    ///   // ... details omitted ...
7688    /// }
7689    /// ```
7690    #[derive(Clone, Debug)]
7691    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
7692
7693    impl CancelOperation {
7694        pub(crate) fn new(
7695            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
7696        ) -> Self {
7697            Self(RequestBuilder::new(stub))
7698        }
7699
7700        /// Sets the full request, replacing any prior values.
7701        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
7702            mut self,
7703            v: V,
7704        ) -> Self {
7705            self.0.request = v.into();
7706            self
7707        }
7708
7709        /// Sets all the options, replacing any prior values.
7710        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7711            self.0.options = v.into();
7712            self
7713        }
7714
7715        /// Sends the request.
7716        pub async fn send(self) -> Result<()> {
7717            (*self.0.stub)
7718                .cancel_operation(self.0.request, self.0.options)
7719                .await
7720                .map(gax::response::Response::into_body)
7721        }
7722
7723        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
7724        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7725            self.0.request.name = v.into();
7726            self
7727        }
7728    }
7729
7730    #[doc(hidden)]
7731    impl gax::options::internal::RequestBuilder for CancelOperation {
7732        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7733            &mut self.0.options
7734        }
7735    }
7736}
7737
7738pub mod policy_based_routing_service {
7739    use crate::Result;
7740
7741    /// A builder for [PolicyBasedRoutingService][crate::client::PolicyBasedRoutingService].
7742    ///
7743    /// ```
7744    /// # tokio_test::block_on(async {
7745    /// # use google_cloud_networkconnectivity_v1::*;
7746    /// # use builder::policy_based_routing_service::ClientBuilder;
7747    /// # use client::PolicyBasedRoutingService;
7748    /// let builder : ClientBuilder = PolicyBasedRoutingService::builder();
7749    /// let client = builder
7750    ///     .with_endpoint("https://networkconnectivity.googleapis.com")
7751    ///     .build().await?;
7752    /// # gax::client_builder::Result::<()>::Ok(()) });
7753    /// ```
7754    pub type ClientBuilder =
7755        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
7756
7757    pub(crate) mod client {
7758        use super::super::super::client::PolicyBasedRoutingService;
7759        pub struct Factory;
7760        impl gax::client_builder::internal::ClientFactory for Factory {
7761            type Client = PolicyBasedRoutingService;
7762            type Credentials = gaxi::options::Credentials;
7763            async fn build(
7764                self,
7765                config: gaxi::options::ClientConfig,
7766            ) -> gax::client_builder::Result<Self::Client> {
7767                Self::Client::new(config).await
7768            }
7769        }
7770    }
7771
7772    /// Common implementation for [crate::client::PolicyBasedRoutingService] request builders.
7773    #[derive(Clone, Debug)]
7774    pub(crate) struct RequestBuilder<R: std::default::Default> {
7775        stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
7776        request: R,
7777        options: gax::options::RequestOptions,
7778    }
7779
7780    impl<R> RequestBuilder<R>
7781    where
7782        R: std::default::Default,
7783    {
7784        pub(crate) fn new(
7785            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
7786        ) -> Self {
7787            Self {
7788                stub,
7789                request: R::default(),
7790                options: gax::options::RequestOptions::default(),
7791            }
7792        }
7793    }
7794
7795    /// The request builder for [PolicyBasedRoutingService::list_policy_based_routes][crate::client::PolicyBasedRoutingService::list_policy_based_routes] calls.
7796    ///
7797    /// # Example
7798    /// ```no_run
7799    /// # use google_cloud_networkconnectivity_v1::builder;
7800    /// use builder::policy_based_routing_service::ListPolicyBasedRoutes;
7801    /// # tokio_test::block_on(async {
7802    /// use gax::paginator::ItemPaginator;
7803    ///
7804    /// let builder = prepare_request_builder();
7805    /// let mut items = builder.by_item();
7806    /// while let Some(result) = items.next().await {
7807    ///   let item = result?;
7808    /// }
7809    /// # gax::Result::<()>::Ok(()) });
7810    ///
7811    /// fn prepare_request_builder() -> ListPolicyBasedRoutes {
7812    ///   # panic!();
7813    ///   // ... details omitted ...
7814    /// }
7815    /// ```
7816    #[derive(Clone, Debug)]
7817    pub struct ListPolicyBasedRoutes(RequestBuilder<crate::model::ListPolicyBasedRoutesRequest>);
7818
7819    impl ListPolicyBasedRoutes {
7820        pub(crate) fn new(
7821            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
7822        ) -> Self {
7823            Self(RequestBuilder::new(stub))
7824        }
7825
7826        /// Sets the full request, replacing any prior values.
7827        pub fn with_request<V: Into<crate::model::ListPolicyBasedRoutesRequest>>(
7828            mut self,
7829            v: V,
7830        ) -> Self {
7831            self.0.request = v.into();
7832            self
7833        }
7834
7835        /// Sets all the options, replacing any prior values.
7836        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7837            self.0.options = v.into();
7838            self
7839        }
7840
7841        /// Sends the request.
7842        pub async fn send(self) -> Result<crate::model::ListPolicyBasedRoutesResponse> {
7843            (*self.0.stub)
7844                .list_policy_based_routes(self.0.request, self.0.options)
7845                .await
7846                .map(gax::response::Response::into_body)
7847        }
7848
7849        /// Streams each page in the collection.
7850        pub fn by_page(
7851            self,
7852        ) -> impl gax::paginator::Paginator<crate::model::ListPolicyBasedRoutesResponse, gax::error::Error>
7853        {
7854            use std::clone::Clone;
7855            let token = self.0.request.page_token.clone();
7856            let execute = move |token: String| {
7857                let mut builder = self.clone();
7858                builder.0.request = builder.0.request.set_page_token(token);
7859                builder.send()
7860            };
7861            gax::paginator::internal::new_paginator(token, execute)
7862        }
7863
7864        /// Streams each item in the collection.
7865        pub fn by_item(
7866            self,
7867        ) -> impl gax::paginator::ItemPaginator<
7868            crate::model::ListPolicyBasedRoutesResponse,
7869            gax::error::Error,
7870        > {
7871            use gax::paginator::Paginator;
7872            self.by_page().items()
7873        }
7874
7875        /// Sets the value of [parent][crate::model::ListPolicyBasedRoutesRequest::parent].
7876        ///
7877        /// This is a **required** field for requests.
7878        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7879            self.0.request.parent = v.into();
7880            self
7881        }
7882
7883        /// Sets the value of [page_size][crate::model::ListPolicyBasedRoutesRequest::page_size].
7884        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7885            self.0.request.page_size = v.into();
7886            self
7887        }
7888
7889        /// Sets the value of [page_token][crate::model::ListPolicyBasedRoutesRequest::page_token].
7890        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7891            self.0.request.page_token = v.into();
7892            self
7893        }
7894
7895        /// Sets the value of [filter][crate::model::ListPolicyBasedRoutesRequest::filter].
7896        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7897            self.0.request.filter = v.into();
7898            self
7899        }
7900
7901        /// Sets the value of [order_by][crate::model::ListPolicyBasedRoutesRequest::order_by].
7902        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
7903            self.0.request.order_by = v.into();
7904            self
7905        }
7906    }
7907
7908    #[doc(hidden)]
7909    impl gax::options::internal::RequestBuilder for ListPolicyBasedRoutes {
7910        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7911            &mut self.0.options
7912        }
7913    }
7914
7915    /// The request builder for [PolicyBasedRoutingService::get_policy_based_route][crate::client::PolicyBasedRoutingService::get_policy_based_route] calls.
7916    ///
7917    /// # Example
7918    /// ```no_run
7919    /// # use google_cloud_networkconnectivity_v1::builder;
7920    /// use builder::policy_based_routing_service::GetPolicyBasedRoute;
7921    /// # tokio_test::block_on(async {
7922    ///
7923    /// let builder = prepare_request_builder();
7924    /// let response = builder.send().await?;
7925    /// # gax::Result::<()>::Ok(()) });
7926    ///
7927    /// fn prepare_request_builder() -> GetPolicyBasedRoute {
7928    ///   # panic!();
7929    ///   // ... details omitted ...
7930    /// }
7931    /// ```
7932    #[derive(Clone, Debug)]
7933    pub struct GetPolicyBasedRoute(RequestBuilder<crate::model::GetPolicyBasedRouteRequest>);
7934
7935    impl GetPolicyBasedRoute {
7936        pub(crate) fn new(
7937            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
7938        ) -> Self {
7939            Self(RequestBuilder::new(stub))
7940        }
7941
7942        /// Sets the full request, replacing any prior values.
7943        pub fn with_request<V: Into<crate::model::GetPolicyBasedRouteRequest>>(
7944            mut self,
7945            v: V,
7946        ) -> Self {
7947            self.0.request = v.into();
7948            self
7949        }
7950
7951        /// Sets all the options, replacing any prior values.
7952        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7953            self.0.options = v.into();
7954            self
7955        }
7956
7957        /// Sends the request.
7958        pub async fn send(self) -> Result<crate::model::PolicyBasedRoute> {
7959            (*self.0.stub)
7960                .get_policy_based_route(self.0.request, self.0.options)
7961                .await
7962                .map(gax::response::Response::into_body)
7963        }
7964
7965        /// Sets the value of [name][crate::model::GetPolicyBasedRouteRequest::name].
7966        ///
7967        /// This is a **required** field for requests.
7968        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7969            self.0.request.name = v.into();
7970            self
7971        }
7972    }
7973
7974    #[doc(hidden)]
7975    impl gax::options::internal::RequestBuilder for GetPolicyBasedRoute {
7976        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7977            &mut self.0.options
7978        }
7979    }
7980
7981    /// The request builder for [PolicyBasedRoutingService::create_policy_based_route][crate::client::PolicyBasedRoutingService::create_policy_based_route] calls.
7982    ///
7983    /// # Example
7984    /// ```no_run
7985    /// # use google_cloud_networkconnectivity_v1::builder;
7986    /// use builder::policy_based_routing_service::CreatePolicyBasedRoute;
7987    /// # tokio_test::block_on(async {
7988    /// use lro::Poller;
7989    ///
7990    /// let builder = prepare_request_builder();
7991    /// let response = builder.poller().until_done().await?;
7992    /// # gax::Result::<()>::Ok(()) });
7993    ///
7994    /// fn prepare_request_builder() -> CreatePolicyBasedRoute {
7995    ///   # panic!();
7996    ///   // ... details omitted ...
7997    /// }
7998    /// ```
7999    #[derive(Clone, Debug)]
8000    pub struct CreatePolicyBasedRoute(RequestBuilder<crate::model::CreatePolicyBasedRouteRequest>);
8001
8002    impl CreatePolicyBasedRoute {
8003        pub(crate) fn new(
8004            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
8005        ) -> Self {
8006            Self(RequestBuilder::new(stub))
8007        }
8008
8009        /// Sets the full request, replacing any prior values.
8010        pub fn with_request<V: Into<crate::model::CreatePolicyBasedRouteRequest>>(
8011            mut self,
8012            v: V,
8013        ) -> Self {
8014            self.0.request = v.into();
8015            self
8016        }
8017
8018        /// Sets all the options, replacing any prior values.
8019        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8020            self.0.options = v.into();
8021            self
8022        }
8023
8024        /// Sends the request.
8025        ///
8026        /// # Long running operations
8027        ///
8028        /// This starts, but does not poll, a longrunning operation. More information
8029        /// on [create_policy_based_route][crate::client::PolicyBasedRoutingService::create_policy_based_route].
8030        pub async fn send(self) -> Result<longrunning::model::Operation> {
8031            (*self.0.stub)
8032                .create_policy_based_route(self.0.request, self.0.options)
8033                .await
8034                .map(gax::response::Response::into_body)
8035        }
8036
8037        /// Creates a [Poller][lro::Poller] to work with `create_policy_based_route`.
8038        pub fn poller(
8039            self,
8040        ) -> impl lro::Poller<crate::model::PolicyBasedRoute, crate::model::OperationMetadata>
8041        {
8042            type Operation = lro::internal::Operation<
8043                crate::model::PolicyBasedRoute,
8044                crate::model::OperationMetadata,
8045            >;
8046            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8047            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8048
8049            let stub = self.0.stub.clone();
8050            let mut options = self.0.options.clone();
8051            options.set_retry_policy(gax::retry_policy::NeverRetry);
8052            let query = move |name| {
8053                let stub = stub.clone();
8054                let options = options.clone();
8055                async {
8056                    let op = GetOperation::new(stub)
8057                        .set_name(name)
8058                        .with_options(options)
8059                        .send()
8060                        .await?;
8061                    Ok(Operation::new(op))
8062                }
8063            };
8064
8065            let start = move || async {
8066                let op = self.send().await?;
8067                Ok(Operation::new(op))
8068            };
8069
8070            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
8071        }
8072
8073        /// Sets the value of [parent][crate::model::CreatePolicyBasedRouteRequest::parent].
8074        ///
8075        /// This is a **required** field for requests.
8076        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
8077            self.0.request.parent = v.into();
8078            self
8079        }
8080
8081        /// Sets the value of [policy_based_route_id][crate::model::CreatePolicyBasedRouteRequest::policy_based_route_id].
8082        ///
8083        /// This is a **required** field for requests.
8084        pub fn set_policy_based_route_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
8085            self.0.request.policy_based_route_id = v.into();
8086            self
8087        }
8088
8089        /// Sets the value of [policy_based_route][crate::model::CreatePolicyBasedRouteRequest::policy_based_route].
8090        ///
8091        /// This is a **required** field for requests.
8092        pub fn set_policy_based_route<T>(mut self, v: T) -> Self
8093        where
8094            T: std::convert::Into<crate::model::PolicyBasedRoute>,
8095        {
8096            self.0.request.policy_based_route = std::option::Option::Some(v.into());
8097            self
8098        }
8099
8100        /// Sets or clears the value of [policy_based_route][crate::model::CreatePolicyBasedRouteRequest::policy_based_route].
8101        ///
8102        /// This is a **required** field for requests.
8103        pub fn set_or_clear_policy_based_route<T>(mut self, v: std::option::Option<T>) -> Self
8104        where
8105            T: std::convert::Into<crate::model::PolicyBasedRoute>,
8106        {
8107            self.0.request.policy_based_route = v.map(|x| x.into());
8108            self
8109        }
8110
8111        /// Sets the value of [request_id][crate::model::CreatePolicyBasedRouteRequest::request_id].
8112        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
8113            self.0.request.request_id = v.into();
8114            self
8115        }
8116    }
8117
8118    #[doc(hidden)]
8119    impl gax::options::internal::RequestBuilder for CreatePolicyBasedRoute {
8120        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8121            &mut self.0.options
8122        }
8123    }
8124
8125    /// The request builder for [PolicyBasedRoutingService::delete_policy_based_route][crate::client::PolicyBasedRoutingService::delete_policy_based_route] calls.
8126    ///
8127    /// # Example
8128    /// ```no_run
8129    /// # use google_cloud_networkconnectivity_v1::builder;
8130    /// use builder::policy_based_routing_service::DeletePolicyBasedRoute;
8131    /// # tokio_test::block_on(async {
8132    /// use lro::Poller;
8133    ///
8134    /// let builder = prepare_request_builder();
8135    /// let response = builder.poller().until_done().await?;
8136    /// # gax::Result::<()>::Ok(()) });
8137    ///
8138    /// fn prepare_request_builder() -> DeletePolicyBasedRoute {
8139    ///   # panic!();
8140    ///   // ... details omitted ...
8141    /// }
8142    /// ```
8143    #[derive(Clone, Debug)]
8144    pub struct DeletePolicyBasedRoute(RequestBuilder<crate::model::DeletePolicyBasedRouteRequest>);
8145
8146    impl DeletePolicyBasedRoute {
8147        pub(crate) fn new(
8148            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
8149        ) -> Self {
8150            Self(RequestBuilder::new(stub))
8151        }
8152
8153        /// Sets the full request, replacing any prior values.
8154        pub fn with_request<V: Into<crate::model::DeletePolicyBasedRouteRequest>>(
8155            mut self,
8156            v: V,
8157        ) -> Self {
8158            self.0.request = v.into();
8159            self
8160        }
8161
8162        /// Sets all the options, replacing any prior values.
8163        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8164            self.0.options = v.into();
8165            self
8166        }
8167
8168        /// Sends the request.
8169        ///
8170        /// # Long running operations
8171        ///
8172        /// This starts, but does not poll, a longrunning operation. More information
8173        /// on [delete_policy_based_route][crate::client::PolicyBasedRoutingService::delete_policy_based_route].
8174        pub async fn send(self) -> Result<longrunning::model::Operation> {
8175            (*self.0.stub)
8176                .delete_policy_based_route(self.0.request, self.0.options)
8177                .await
8178                .map(gax::response::Response::into_body)
8179        }
8180
8181        /// Creates a [Poller][lro::Poller] to work with `delete_policy_based_route`.
8182        pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
8183            type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
8184            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8185            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8186
8187            let stub = self.0.stub.clone();
8188            let mut options = self.0.options.clone();
8189            options.set_retry_policy(gax::retry_policy::NeverRetry);
8190            let query = move |name| {
8191                let stub = stub.clone();
8192                let options = options.clone();
8193                async {
8194                    let op = GetOperation::new(stub)
8195                        .set_name(name)
8196                        .with_options(options)
8197                        .send()
8198                        .await?;
8199                    Ok(Operation::new(op))
8200                }
8201            };
8202
8203            let start = move || async {
8204                let op = self.send().await?;
8205                Ok(Operation::new(op))
8206            };
8207
8208            lro::internal::new_unit_response_poller(
8209                polling_error_policy,
8210                polling_backoff_policy,
8211                start,
8212                query,
8213            )
8214        }
8215
8216        /// Sets the value of [name][crate::model::DeletePolicyBasedRouteRequest::name].
8217        ///
8218        /// This is a **required** field for requests.
8219        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8220            self.0.request.name = v.into();
8221            self
8222        }
8223
8224        /// Sets the value of [request_id][crate::model::DeletePolicyBasedRouteRequest::request_id].
8225        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
8226            self.0.request.request_id = v.into();
8227            self
8228        }
8229    }
8230
8231    #[doc(hidden)]
8232    impl gax::options::internal::RequestBuilder for DeletePolicyBasedRoute {
8233        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8234            &mut self.0.options
8235        }
8236    }
8237
8238    /// The request builder for [PolicyBasedRoutingService::list_locations][crate::client::PolicyBasedRoutingService::list_locations] calls.
8239    ///
8240    /// # Example
8241    /// ```no_run
8242    /// # use google_cloud_networkconnectivity_v1::builder;
8243    /// use builder::policy_based_routing_service::ListLocations;
8244    /// # tokio_test::block_on(async {
8245    /// use gax::paginator::ItemPaginator;
8246    ///
8247    /// let builder = prepare_request_builder();
8248    /// let mut items = builder.by_item();
8249    /// while let Some(result) = items.next().await {
8250    ///   let item = result?;
8251    /// }
8252    /// # gax::Result::<()>::Ok(()) });
8253    ///
8254    /// fn prepare_request_builder() -> ListLocations {
8255    ///   # panic!();
8256    ///   // ... details omitted ...
8257    /// }
8258    /// ```
8259    #[derive(Clone, Debug)]
8260    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
8261
8262    impl ListLocations {
8263        pub(crate) fn new(
8264            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
8265        ) -> Self {
8266            Self(RequestBuilder::new(stub))
8267        }
8268
8269        /// Sets the full request, replacing any prior values.
8270        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
8271            mut self,
8272            v: V,
8273        ) -> Self {
8274            self.0.request = v.into();
8275            self
8276        }
8277
8278        /// Sets all the options, replacing any prior values.
8279        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8280            self.0.options = v.into();
8281            self
8282        }
8283
8284        /// Sends the request.
8285        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
8286            (*self.0.stub)
8287                .list_locations(self.0.request, self.0.options)
8288                .await
8289                .map(gax::response::Response::into_body)
8290        }
8291
8292        /// Streams each page in the collection.
8293        pub fn by_page(
8294            self,
8295        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
8296        {
8297            use std::clone::Clone;
8298            let token = self.0.request.page_token.clone();
8299            let execute = move |token: String| {
8300                let mut builder = self.clone();
8301                builder.0.request = builder.0.request.set_page_token(token);
8302                builder.send()
8303            };
8304            gax::paginator::internal::new_paginator(token, execute)
8305        }
8306
8307        /// Streams each item in the collection.
8308        pub fn by_item(
8309            self,
8310        ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
8311        {
8312            use gax::paginator::Paginator;
8313            self.by_page().items()
8314        }
8315
8316        /// Sets the value of [name][location::model::ListLocationsRequest::name].
8317        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8318            self.0.request.name = v.into();
8319            self
8320        }
8321
8322        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
8323        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8324            self.0.request.filter = v.into();
8325            self
8326        }
8327
8328        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
8329        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8330            self.0.request.page_size = v.into();
8331            self
8332        }
8333
8334        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
8335        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8336            self.0.request.page_token = v.into();
8337            self
8338        }
8339    }
8340
8341    #[doc(hidden)]
8342    impl gax::options::internal::RequestBuilder for ListLocations {
8343        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8344            &mut self.0.options
8345        }
8346    }
8347
8348    /// The request builder for [PolicyBasedRoutingService::get_location][crate::client::PolicyBasedRoutingService::get_location] calls.
8349    ///
8350    /// # Example
8351    /// ```no_run
8352    /// # use google_cloud_networkconnectivity_v1::builder;
8353    /// use builder::policy_based_routing_service::GetLocation;
8354    /// # tokio_test::block_on(async {
8355    ///
8356    /// let builder = prepare_request_builder();
8357    /// let response = builder.send().await?;
8358    /// # gax::Result::<()>::Ok(()) });
8359    ///
8360    /// fn prepare_request_builder() -> GetLocation {
8361    ///   # panic!();
8362    ///   // ... details omitted ...
8363    /// }
8364    /// ```
8365    #[derive(Clone, Debug)]
8366    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
8367
8368    impl GetLocation {
8369        pub(crate) fn new(
8370            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
8371        ) -> Self {
8372            Self(RequestBuilder::new(stub))
8373        }
8374
8375        /// Sets the full request, replacing any prior values.
8376        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
8377            self.0.request = v.into();
8378            self
8379        }
8380
8381        /// Sets all the options, replacing any prior values.
8382        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8383            self.0.options = v.into();
8384            self
8385        }
8386
8387        /// Sends the request.
8388        pub async fn send(self) -> Result<location::model::Location> {
8389            (*self.0.stub)
8390                .get_location(self.0.request, self.0.options)
8391                .await
8392                .map(gax::response::Response::into_body)
8393        }
8394
8395        /// Sets the value of [name][location::model::GetLocationRequest::name].
8396        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8397            self.0.request.name = v.into();
8398            self
8399        }
8400    }
8401
8402    #[doc(hidden)]
8403    impl gax::options::internal::RequestBuilder for GetLocation {
8404        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8405            &mut self.0.options
8406        }
8407    }
8408
8409    /// The request builder for [PolicyBasedRoutingService::set_iam_policy][crate::client::PolicyBasedRoutingService::set_iam_policy] calls.
8410    ///
8411    /// # Example
8412    /// ```no_run
8413    /// # use google_cloud_networkconnectivity_v1::builder;
8414    /// use builder::policy_based_routing_service::SetIamPolicy;
8415    /// # tokio_test::block_on(async {
8416    ///
8417    /// let builder = prepare_request_builder();
8418    /// let response = builder.send().await?;
8419    /// # gax::Result::<()>::Ok(()) });
8420    ///
8421    /// fn prepare_request_builder() -> SetIamPolicy {
8422    ///   # panic!();
8423    ///   // ... details omitted ...
8424    /// }
8425    /// ```
8426    #[derive(Clone, Debug)]
8427    pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
8428
8429    impl SetIamPolicy {
8430        pub(crate) fn new(
8431            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
8432        ) -> Self {
8433            Self(RequestBuilder::new(stub))
8434        }
8435
8436        /// Sets the full request, replacing any prior values.
8437        pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
8438            self.0.request = v.into();
8439            self
8440        }
8441
8442        /// Sets all the options, replacing any prior values.
8443        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8444            self.0.options = v.into();
8445            self
8446        }
8447
8448        /// Sends the request.
8449        pub async fn send(self) -> Result<iam_v1::model::Policy> {
8450            (*self.0.stub)
8451                .set_iam_policy(self.0.request, self.0.options)
8452                .await
8453                .map(gax::response::Response::into_body)
8454        }
8455
8456        /// Sets the value of [resource][iam_v1::model::SetIamPolicyRequest::resource].
8457        ///
8458        /// This is a **required** field for requests.
8459        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
8460            self.0.request.resource = v.into();
8461            self
8462        }
8463
8464        /// Sets the value of [policy][iam_v1::model::SetIamPolicyRequest::policy].
8465        ///
8466        /// This is a **required** field for requests.
8467        pub fn set_policy<T>(mut self, v: T) -> Self
8468        where
8469            T: std::convert::Into<iam_v1::model::Policy>,
8470        {
8471            self.0.request.policy = std::option::Option::Some(v.into());
8472            self
8473        }
8474
8475        /// Sets or clears the value of [policy][iam_v1::model::SetIamPolicyRequest::policy].
8476        ///
8477        /// This is a **required** field for requests.
8478        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
8479        where
8480            T: std::convert::Into<iam_v1::model::Policy>,
8481        {
8482            self.0.request.policy = v.map(|x| x.into());
8483            self
8484        }
8485
8486        /// Sets the value of [update_mask][iam_v1::model::SetIamPolicyRequest::update_mask].
8487        pub fn set_update_mask<T>(mut self, v: T) -> Self
8488        where
8489            T: std::convert::Into<wkt::FieldMask>,
8490        {
8491            self.0.request.update_mask = std::option::Option::Some(v.into());
8492            self
8493        }
8494
8495        /// Sets or clears the value of [update_mask][iam_v1::model::SetIamPolicyRequest::update_mask].
8496        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
8497        where
8498            T: std::convert::Into<wkt::FieldMask>,
8499        {
8500            self.0.request.update_mask = v.map(|x| x.into());
8501            self
8502        }
8503    }
8504
8505    #[doc(hidden)]
8506    impl gax::options::internal::RequestBuilder for SetIamPolicy {
8507        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8508            &mut self.0.options
8509        }
8510    }
8511
8512    /// The request builder for [PolicyBasedRoutingService::get_iam_policy][crate::client::PolicyBasedRoutingService::get_iam_policy] calls.
8513    ///
8514    /// # Example
8515    /// ```no_run
8516    /// # use google_cloud_networkconnectivity_v1::builder;
8517    /// use builder::policy_based_routing_service::GetIamPolicy;
8518    /// # tokio_test::block_on(async {
8519    ///
8520    /// let builder = prepare_request_builder();
8521    /// let response = builder.send().await?;
8522    /// # gax::Result::<()>::Ok(()) });
8523    ///
8524    /// fn prepare_request_builder() -> GetIamPolicy {
8525    ///   # panic!();
8526    ///   // ... details omitted ...
8527    /// }
8528    /// ```
8529    #[derive(Clone, Debug)]
8530    pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
8531
8532    impl GetIamPolicy {
8533        pub(crate) fn new(
8534            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
8535        ) -> Self {
8536            Self(RequestBuilder::new(stub))
8537        }
8538
8539        /// Sets the full request, replacing any prior values.
8540        pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
8541            self.0.request = v.into();
8542            self
8543        }
8544
8545        /// Sets all the options, replacing any prior values.
8546        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8547            self.0.options = v.into();
8548            self
8549        }
8550
8551        /// Sends the request.
8552        pub async fn send(self) -> Result<iam_v1::model::Policy> {
8553            (*self.0.stub)
8554                .get_iam_policy(self.0.request, self.0.options)
8555                .await
8556                .map(gax::response::Response::into_body)
8557        }
8558
8559        /// Sets the value of [resource][iam_v1::model::GetIamPolicyRequest::resource].
8560        ///
8561        /// This is a **required** field for requests.
8562        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
8563            self.0.request.resource = v.into();
8564            self
8565        }
8566
8567        /// Sets the value of [options][iam_v1::model::GetIamPolicyRequest::options].
8568        pub fn set_options<T>(mut self, v: T) -> Self
8569        where
8570            T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
8571        {
8572            self.0.request.options = std::option::Option::Some(v.into());
8573            self
8574        }
8575
8576        /// Sets or clears the value of [options][iam_v1::model::GetIamPolicyRequest::options].
8577        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
8578        where
8579            T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
8580        {
8581            self.0.request.options = v.map(|x| x.into());
8582            self
8583        }
8584    }
8585
8586    #[doc(hidden)]
8587    impl gax::options::internal::RequestBuilder for GetIamPolicy {
8588        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8589            &mut self.0.options
8590        }
8591    }
8592
8593    /// The request builder for [PolicyBasedRoutingService::test_iam_permissions][crate::client::PolicyBasedRoutingService::test_iam_permissions] calls.
8594    ///
8595    /// # Example
8596    /// ```no_run
8597    /// # use google_cloud_networkconnectivity_v1::builder;
8598    /// use builder::policy_based_routing_service::TestIamPermissions;
8599    /// # tokio_test::block_on(async {
8600    ///
8601    /// let builder = prepare_request_builder();
8602    /// let response = builder.send().await?;
8603    /// # gax::Result::<()>::Ok(()) });
8604    ///
8605    /// fn prepare_request_builder() -> TestIamPermissions {
8606    ///   # panic!();
8607    ///   // ... details omitted ...
8608    /// }
8609    /// ```
8610    #[derive(Clone, Debug)]
8611    pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
8612
8613    impl TestIamPermissions {
8614        pub(crate) fn new(
8615            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
8616        ) -> Self {
8617            Self(RequestBuilder::new(stub))
8618        }
8619
8620        /// Sets the full request, replacing any prior values.
8621        pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
8622            mut self,
8623            v: V,
8624        ) -> Self {
8625            self.0.request = v.into();
8626            self
8627        }
8628
8629        /// Sets all the options, replacing any prior values.
8630        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8631            self.0.options = v.into();
8632            self
8633        }
8634
8635        /// Sends the request.
8636        pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
8637            (*self.0.stub)
8638                .test_iam_permissions(self.0.request, self.0.options)
8639                .await
8640                .map(gax::response::Response::into_body)
8641        }
8642
8643        /// Sets the value of [resource][iam_v1::model::TestIamPermissionsRequest::resource].
8644        ///
8645        /// This is a **required** field for requests.
8646        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
8647            self.0.request.resource = v.into();
8648            self
8649        }
8650
8651        /// Sets the value of [permissions][iam_v1::model::TestIamPermissionsRequest::permissions].
8652        ///
8653        /// This is a **required** field for requests.
8654        pub fn set_permissions<T, V>(mut self, v: T) -> Self
8655        where
8656            T: std::iter::IntoIterator<Item = V>,
8657            V: std::convert::Into<std::string::String>,
8658        {
8659            use std::iter::Iterator;
8660            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
8661            self
8662        }
8663    }
8664
8665    #[doc(hidden)]
8666    impl gax::options::internal::RequestBuilder for TestIamPermissions {
8667        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8668            &mut self.0.options
8669        }
8670    }
8671
8672    /// The request builder for [PolicyBasedRoutingService::list_operations][crate::client::PolicyBasedRoutingService::list_operations] calls.
8673    ///
8674    /// # Example
8675    /// ```no_run
8676    /// # use google_cloud_networkconnectivity_v1::builder;
8677    /// use builder::policy_based_routing_service::ListOperations;
8678    /// # tokio_test::block_on(async {
8679    /// use gax::paginator::ItemPaginator;
8680    ///
8681    /// let builder = prepare_request_builder();
8682    /// let mut items = builder.by_item();
8683    /// while let Some(result) = items.next().await {
8684    ///   let item = result?;
8685    /// }
8686    /// # gax::Result::<()>::Ok(()) });
8687    ///
8688    /// fn prepare_request_builder() -> ListOperations {
8689    ///   # panic!();
8690    ///   // ... details omitted ...
8691    /// }
8692    /// ```
8693    #[derive(Clone, Debug)]
8694    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
8695
8696    impl ListOperations {
8697        pub(crate) fn new(
8698            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
8699        ) -> Self {
8700            Self(RequestBuilder::new(stub))
8701        }
8702
8703        /// Sets the full request, replacing any prior values.
8704        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
8705            mut self,
8706            v: V,
8707        ) -> Self {
8708            self.0.request = v.into();
8709            self
8710        }
8711
8712        /// Sets all the options, replacing any prior values.
8713        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8714            self.0.options = v.into();
8715            self
8716        }
8717
8718        /// Sends the request.
8719        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
8720            (*self.0.stub)
8721                .list_operations(self.0.request, self.0.options)
8722                .await
8723                .map(gax::response::Response::into_body)
8724        }
8725
8726        /// Streams each page in the collection.
8727        pub fn by_page(
8728            self,
8729        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
8730        {
8731            use std::clone::Clone;
8732            let token = self.0.request.page_token.clone();
8733            let execute = move |token: String| {
8734                let mut builder = self.clone();
8735                builder.0.request = builder.0.request.set_page_token(token);
8736                builder.send()
8737            };
8738            gax::paginator::internal::new_paginator(token, execute)
8739        }
8740
8741        /// Streams each item in the collection.
8742        pub fn by_item(
8743            self,
8744        ) -> impl gax::paginator::ItemPaginator<
8745            longrunning::model::ListOperationsResponse,
8746            gax::error::Error,
8747        > {
8748            use gax::paginator::Paginator;
8749            self.by_page().items()
8750        }
8751
8752        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
8753        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8754            self.0.request.name = v.into();
8755            self
8756        }
8757
8758        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
8759        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8760            self.0.request.filter = v.into();
8761            self
8762        }
8763
8764        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
8765        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8766            self.0.request.page_size = v.into();
8767            self
8768        }
8769
8770        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
8771        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8772            self.0.request.page_token = v.into();
8773            self
8774        }
8775    }
8776
8777    #[doc(hidden)]
8778    impl gax::options::internal::RequestBuilder for ListOperations {
8779        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8780            &mut self.0.options
8781        }
8782    }
8783
8784    /// The request builder for [PolicyBasedRoutingService::get_operation][crate::client::PolicyBasedRoutingService::get_operation] calls.
8785    ///
8786    /// # Example
8787    /// ```no_run
8788    /// # use google_cloud_networkconnectivity_v1::builder;
8789    /// use builder::policy_based_routing_service::GetOperation;
8790    /// # tokio_test::block_on(async {
8791    ///
8792    /// let builder = prepare_request_builder();
8793    /// let response = builder.send().await?;
8794    /// # gax::Result::<()>::Ok(()) });
8795    ///
8796    /// fn prepare_request_builder() -> GetOperation {
8797    ///   # panic!();
8798    ///   // ... details omitted ...
8799    /// }
8800    /// ```
8801    #[derive(Clone, Debug)]
8802    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
8803
8804    impl GetOperation {
8805        pub(crate) fn new(
8806            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
8807        ) -> Self {
8808            Self(RequestBuilder::new(stub))
8809        }
8810
8811        /// Sets the full request, replacing any prior values.
8812        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
8813            mut self,
8814            v: V,
8815        ) -> Self {
8816            self.0.request = v.into();
8817            self
8818        }
8819
8820        /// Sets all the options, replacing any prior values.
8821        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8822            self.0.options = v.into();
8823            self
8824        }
8825
8826        /// Sends the request.
8827        pub async fn send(self) -> Result<longrunning::model::Operation> {
8828            (*self.0.stub)
8829                .get_operation(self.0.request, self.0.options)
8830                .await
8831                .map(gax::response::Response::into_body)
8832        }
8833
8834        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
8835        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8836            self.0.request.name = v.into();
8837            self
8838        }
8839    }
8840
8841    #[doc(hidden)]
8842    impl gax::options::internal::RequestBuilder for GetOperation {
8843        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8844            &mut self.0.options
8845        }
8846    }
8847
8848    /// The request builder for [PolicyBasedRoutingService::delete_operation][crate::client::PolicyBasedRoutingService::delete_operation] calls.
8849    ///
8850    /// # Example
8851    /// ```no_run
8852    /// # use google_cloud_networkconnectivity_v1::builder;
8853    /// use builder::policy_based_routing_service::DeleteOperation;
8854    /// # tokio_test::block_on(async {
8855    ///
8856    /// let builder = prepare_request_builder();
8857    /// let response = builder.send().await?;
8858    /// # gax::Result::<()>::Ok(()) });
8859    ///
8860    /// fn prepare_request_builder() -> DeleteOperation {
8861    ///   # panic!();
8862    ///   // ... details omitted ...
8863    /// }
8864    /// ```
8865    #[derive(Clone, Debug)]
8866    pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
8867
8868    impl DeleteOperation {
8869        pub(crate) fn new(
8870            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
8871        ) -> Self {
8872            Self(RequestBuilder::new(stub))
8873        }
8874
8875        /// Sets the full request, replacing any prior values.
8876        pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
8877            mut self,
8878            v: V,
8879        ) -> Self {
8880            self.0.request = v.into();
8881            self
8882        }
8883
8884        /// Sets all the options, replacing any prior values.
8885        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8886            self.0.options = v.into();
8887            self
8888        }
8889
8890        /// Sends the request.
8891        pub async fn send(self) -> Result<()> {
8892            (*self.0.stub)
8893                .delete_operation(self.0.request, self.0.options)
8894                .await
8895                .map(gax::response::Response::into_body)
8896        }
8897
8898        /// Sets the value of [name][longrunning::model::DeleteOperationRequest::name].
8899        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8900            self.0.request.name = v.into();
8901            self
8902        }
8903    }
8904
8905    #[doc(hidden)]
8906    impl gax::options::internal::RequestBuilder for DeleteOperation {
8907        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8908            &mut self.0.options
8909        }
8910    }
8911
8912    /// The request builder for [PolicyBasedRoutingService::cancel_operation][crate::client::PolicyBasedRoutingService::cancel_operation] calls.
8913    ///
8914    /// # Example
8915    /// ```no_run
8916    /// # use google_cloud_networkconnectivity_v1::builder;
8917    /// use builder::policy_based_routing_service::CancelOperation;
8918    /// # tokio_test::block_on(async {
8919    ///
8920    /// let builder = prepare_request_builder();
8921    /// let response = builder.send().await?;
8922    /// # gax::Result::<()>::Ok(()) });
8923    ///
8924    /// fn prepare_request_builder() -> CancelOperation {
8925    ///   # panic!();
8926    ///   // ... details omitted ...
8927    /// }
8928    /// ```
8929    #[derive(Clone, Debug)]
8930    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
8931
8932    impl CancelOperation {
8933        pub(crate) fn new(
8934            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
8935        ) -> Self {
8936            Self(RequestBuilder::new(stub))
8937        }
8938
8939        /// Sets the full request, replacing any prior values.
8940        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
8941            mut self,
8942            v: V,
8943        ) -> Self {
8944            self.0.request = v.into();
8945            self
8946        }
8947
8948        /// Sets all the options, replacing any prior values.
8949        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8950            self.0.options = v.into();
8951            self
8952        }
8953
8954        /// Sends the request.
8955        pub async fn send(self) -> Result<()> {
8956            (*self.0.stub)
8957                .cancel_operation(self.0.request, self.0.options)
8958                .await
8959                .map(gax::response::Response::into_body)
8960        }
8961
8962        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
8963        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8964            self.0.request.name = v.into();
8965            self
8966        }
8967    }
8968
8969    #[doc(hidden)]
8970    impl gax::options::internal::RequestBuilder for CancelOperation {
8971        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8972            &mut self.0.options
8973        }
8974    }
8975}