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 data_transfer_service {
2988    use crate::Result;
2989
2990    /// A builder for [DataTransferService][crate::client::DataTransferService].
2991    ///
2992    /// ```
2993    /// # tokio_test::block_on(async {
2994    /// # use google_cloud_networkconnectivity_v1::*;
2995    /// # use builder::data_transfer_service::ClientBuilder;
2996    /// # use client::DataTransferService;
2997    /// let builder : ClientBuilder = DataTransferService::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::DataTransferService;
3008        pub struct Factory;
3009        impl gax::client_builder::internal::ClientFactory for Factory {
3010            type Client = DataTransferService;
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::DataTransferService] 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::DataTransferService>,
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::DataTransferService>,
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 [DataTransferService::list_multicloud_data_transfer_configs][crate::client::DataTransferService::list_multicloud_data_transfer_configs] calls.
3045    ///
3046    /// # Example
3047    /// ```no_run
3048    /// # use google_cloud_networkconnectivity_v1::builder;
3049    /// use builder::data_transfer_service::ListMulticloudDataTransferConfigs;
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() -> ListMulticloudDataTransferConfigs {
3061    ///   # panic!();
3062    ///   // ... details omitted ...
3063    /// }
3064    /// ```
3065    #[derive(Clone, Debug)]
3066    pub struct ListMulticloudDataTransferConfigs(
3067        RequestBuilder<crate::model::ListMulticloudDataTransferConfigsRequest>,
3068    );
3069
3070    impl ListMulticloudDataTransferConfigs {
3071        pub(crate) fn new(
3072            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3073        ) -> Self {
3074            Self(RequestBuilder::new(stub))
3075        }
3076
3077        /// Sets the full request, replacing any prior values.
3078        pub fn with_request<V: Into<crate::model::ListMulticloudDataTransferConfigsRequest>>(
3079            mut self,
3080            v: V,
3081        ) -> Self {
3082            self.0.request = v.into();
3083            self
3084        }
3085
3086        /// Sets all the options, replacing any prior values.
3087        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3088            self.0.options = v.into();
3089            self
3090        }
3091
3092        /// Sends the request.
3093        pub async fn send(self) -> Result<crate::model::ListMulticloudDataTransferConfigsResponse> {
3094            (*self.0.stub)
3095                .list_multicloud_data_transfer_configs(self.0.request, self.0.options)
3096                .await
3097                .map(gax::response::Response::into_body)
3098        }
3099
3100        /// Streams each page in the collection.
3101        pub fn by_page(
3102            self,
3103        ) -> impl gax::paginator::Paginator<
3104            crate::model::ListMulticloudDataTransferConfigsResponse,
3105            gax::error::Error,
3106        > {
3107            use std::clone::Clone;
3108            let token = self.0.request.page_token.clone();
3109            let execute = move |token: String| {
3110                let mut builder = self.clone();
3111                builder.0.request = builder.0.request.set_page_token(token);
3112                builder.send()
3113            };
3114            gax::paginator::internal::new_paginator(token, execute)
3115        }
3116
3117        /// Streams each item in the collection.
3118        pub fn by_item(
3119            self,
3120        ) -> impl gax::paginator::ItemPaginator<
3121            crate::model::ListMulticloudDataTransferConfigsResponse,
3122            gax::error::Error,
3123        > {
3124            use gax::paginator::Paginator;
3125            self.by_page().items()
3126        }
3127
3128        /// Sets the value of [parent][crate::model::ListMulticloudDataTransferConfigsRequest::parent].
3129        ///
3130        /// This is a **required** field for requests.
3131        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3132            self.0.request.parent = v.into();
3133            self
3134        }
3135
3136        /// Sets the value of [page_size][crate::model::ListMulticloudDataTransferConfigsRequest::page_size].
3137        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3138            self.0.request.page_size = v.into();
3139            self
3140        }
3141
3142        /// Sets the value of [page_token][crate::model::ListMulticloudDataTransferConfigsRequest::page_token].
3143        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3144            self.0.request.page_token = v.into();
3145            self
3146        }
3147
3148        /// Sets the value of [filter][crate::model::ListMulticloudDataTransferConfigsRequest::filter].
3149        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3150            self.0.request.filter = v.into();
3151            self
3152        }
3153
3154        /// Sets the value of [order_by][crate::model::ListMulticloudDataTransferConfigsRequest::order_by].
3155        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3156            self.0.request.order_by = v.into();
3157            self
3158        }
3159
3160        /// Sets the value of [return_partial_success][crate::model::ListMulticloudDataTransferConfigsRequest::return_partial_success].
3161        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
3162            self.0.request.return_partial_success = v.into();
3163            self
3164        }
3165    }
3166
3167    #[doc(hidden)]
3168    impl gax::options::internal::RequestBuilder for ListMulticloudDataTransferConfigs {
3169        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3170            &mut self.0.options
3171        }
3172    }
3173
3174    /// The request builder for [DataTransferService::get_multicloud_data_transfer_config][crate::client::DataTransferService::get_multicloud_data_transfer_config] calls.
3175    ///
3176    /// # Example
3177    /// ```no_run
3178    /// # use google_cloud_networkconnectivity_v1::builder;
3179    /// use builder::data_transfer_service::GetMulticloudDataTransferConfig;
3180    /// # tokio_test::block_on(async {
3181    ///
3182    /// let builder = prepare_request_builder();
3183    /// let response = builder.send().await?;
3184    /// # gax::Result::<()>::Ok(()) });
3185    ///
3186    /// fn prepare_request_builder() -> GetMulticloudDataTransferConfig {
3187    ///   # panic!();
3188    ///   // ... details omitted ...
3189    /// }
3190    /// ```
3191    #[derive(Clone, Debug)]
3192    pub struct GetMulticloudDataTransferConfig(
3193        RequestBuilder<crate::model::GetMulticloudDataTransferConfigRequest>,
3194    );
3195
3196    impl GetMulticloudDataTransferConfig {
3197        pub(crate) fn new(
3198            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3199        ) -> Self {
3200            Self(RequestBuilder::new(stub))
3201        }
3202
3203        /// Sets the full request, replacing any prior values.
3204        pub fn with_request<V: Into<crate::model::GetMulticloudDataTransferConfigRequest>>(
3205            mut self,
3206            v: V,
3207        ) -> Self {
3208            self.0.request = v.into();
3209            self
3210        }
3211
3212        /// Sets all the options, replacing any prior values.
3213        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3214            self.0.options = v.into();
3215            self
3216        }
3217
3218        /// Sends the request.
3219        pub async fn send(self) -> Result<crate::model::MulticloudDataTransferConfig> {
3220            (*self.0.stub)
3221                .get_multicloud_data_transfer_config(self.0.request, self.0.options)
3222                .await
3223                .map(gax::response::Response::into_body)
3224        }
3225
3226        /// Sets the value of [name][crate::model::GetMulticloudDataTransferConfigRequest::name].
3227        ///
3228        /// This is a **required** field for requests.
3229        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3230            self.0.request.name = v.into();
3231            self
3232        }
3233    }
3234
3235    #[doc(hidden)]
3236    impl gax::options::internal::RequestBuilder for GetMulticloudDataTransferConfig {
3237        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3238            &mut self.0.options
3239        }
3240    }
3241
3242    /// The request builder for [DataTransferService::create_multicloud_data_transfer_config][crate::client::DataTransferService::create_multicloud_data_transfer_config] calls.
3243    ///
3244    /// # Example
3245    /// ```no_run
3246    /// # use google_cloud_networkconnectivity_v1::builder;
3247    /// use builder::data_transfer_service::CreateMulticloudDataTransferConfig;
3248    /// # tokio_test::block_on(async {
3249    /// use lro::Poller;
3250    ///
3251    /// let builder = prepare_request_builder();
3252    /// let response = builder.poller().until_done().await?;
3253    /// # gax::Result::<()>::Ok(()) });
3254    ///
3255    /// fn prepare_request_builder() -> CreateMulticloudDataTransferConfig {
3256    ///   # panic!();
3257    ///   // ... details omitted ...
3258    /// }
3259    /// ```
3260    #[derive(Clone, Debug)]
3261    pub struct CreateMulticloudDataTransferConfig(
3262        RequestBuilder<crate::model::CreateMulticloudDataTransferConfigRequest>,
3263    );
3264
3265    impl CreateMulticloudDataTransferConfig {
3266        pub(crate) fn new(
3267            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3268        ) -> Self {
3269            Self(RequestBuilder::new(stub))
3270        }
3271
3272        /// Sets the full request, replacing any prior values.
3273        pub fn with_request<V: Into<crate::model::CreateMulticloudDataTransferConfigRequest>>(
3274            mut self,
3275            v: V,
3276        ) -> Self {
3277            self.0.request = v.into();
3278            self
3279        }
3280
3281        /// Sets all the options, replacing any prior values.
3282        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3283            self.0.options = v.into();
3284            self
3285        }
3286
3287        /// Sends the request.
3288        ///
3289        /// # Long running operations
3290        ///
3291        /// This starts, but does not poll, a longrunning operation. More information
3292        /// on [create_multicloud_data_transfer_config][crate::client::DataTransferService::create_multicloud_data_transfer_config].
3293        pub async fn send(self) -> Result<longrunning::model::Operation> {
3294            (*self.0.stub)
3295                .create_multicloud_data_transfer_config(self.0.request, self.0.options)
3296                .await
3297                .map(gax::response::Response::into_body)
3298        }
3299
3300        /// Creates a [Poller][lro::Poller] to work with `create_multicloud_data_transfer_config`.
3301        pub fn poller(
3302            self,
3303        ) -> impl lro::Poller<crate::model::MulticloudDataTransferConfig, crate::model::OperationMetadata>
3304        {
3305            type Operation = lro::internal::Operation<
3306                crate::model::MulticloudDataTransferConfig,
3307                crate::model::OperationMetadata,
3308            >;
3309            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3310            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3311
3312            let stub = self.0.stub.clone();
3313            let mut options = self.0.options.clone();
3314            options.set_retry_policy(gax::retry_policy::NeverRetry);
3315            let query = move |name| {
3316                let stub = stub.clone();
3317                let options = options.clone();
3318                async {
3319                    let op = GetOperation::new(stub)
3320                        .set_name(name)
3321                        .with_options(options)
3322                        .send()
3323                        .await?;
3324                    Ok(Operation::new(op))
3325                }
3326            };
3327
3328            let start = move || async {
3329                let op = self.send().await?;
3330                Ok(Operation::new(op))
3331            };
3332
3333            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3334        }
3335
3336        /// Sets the value of [parent][crate::model::CreateMulticloudDataTransferConfigRequest::parent].
3337        ///
3338        /// This is a **required** field for requests.
3339        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3340            self.0.request.parent = v.into();
3341            self
3342        }
3343
3344        /// Sets the value of [multicloud_data_transfer_config_id][crate::model::CreateMulticloudDataTransferConfigRequest::multicloud_data_transfer_config_id].
3345        ///
3346        /// This is a **required** field for requests.
3347        pub fn set_multicloud_data_transfer_config_id<T: Into<std::string::String>>(
3348            mut self,
3349            v: T,
3350        ) -> Self {
3351            self.0.request.multicloud_data_transfer_config_id = v.into();
3352            self
3353        }
3354
3355        /// Sets the value of [multicloud_data_transfer_config][crate::model::CreateMulticloudDataTransferConfigRequest::multicloud_data_transfer_config].
3356        ///
3357        /// This is a **required** field for requests.
3358        pub fn set_multicloud_data_transfer_config<T>(mut self, v: T) -> Self
3359        where
3360            T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
3361        {
3362            self.0.request.multicloud_data_transfer_config = std::option::Option::Some(v.into());
3363            self
3364        }
3365
3366        /// Sets or clears the value of [multicloud_data_transfer_config][crate::model::CreateMulticloudDataTransferConfigRequest::multicloud_data_transfer_config].
3367        ///
3368        /// This is a **required** field for requests.
3369        pub fn set_or_clear_multicloud_data_transfer_config<T>(
3370            mut self,
3371            v: std::option::Option<T>,
3372        ) -> Self
3373        where
3374            T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
3375        {
3376            self.0.request.multicloud_data_transfer_config = v.map(|x| x.into());
3377            self
3378        }
3379
3380        /// Sets the value of [request_id][crate::model::CreateMulticloudDataTransferConfigRequest::request_id].
3381        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3382            self.0.request.request_id = v.into();
3383            self
3384        }
3385    }
3386
3387    #[doc(hidden)]
3388    impl gax::options::internal::RequestBuilder for CreateMulticloudDataTransferConfig {
3389        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3390            &mut self.0.options
3391        }
3392    }
3393
3394    /// The request builder for [DataTransferService::update_multicloud_data_transfer_config][crate::client::DataTransferService::update_multicloud_data_transfer_config] calls.
3395    ///
3396    /// # Example
3397    /// ```no_run
3398    /// # use google_cloud_networkconnectivity_v1::builder;
3399    /// use builder::data_transfer_service::UpdateMulticloudDataTransferConfig;
3400    /// # tokio_test::block_on(async {
3401    /// use lro::Poller;
3402    ///
3403    /// let builder = prepare_request_builder();
3404    /// let response = builder.poller().until_done().await?;
3405    /// # gax::Result::<()>::Ok(()) });
3406    ///
3407    /// fn prepare_request_builder() -> UpdateMulticloudDataTransferConfig {
3408    ///   # panic!();
3409    ///   // ... details omitted ...
3410    /// }
3411    /// ```
3412    #[derive(Clone, Debug)]
3413    pub struct UpdateMulticloudDataTransferConfig(
3414        RequestBuilder<crate::model::UpdateMulticloudDataTransferConfigRequest>,
3415    );
3416
3417    impl UpdateMulticloudDataTransferConfig {
3418        pub(crate) fn new(
3419            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3420        ) -> Self {
3421            Self(RequestBuilder::new(stub))
3422        }
3423
3424        /// Sets the full request, replacing any prior values.
3425        pub fn with_request<V: Into<crate::model::UpdateMulticloudDataTransferConfigRequest>>(
3426            mut self,
3427            v: V,
3428        ) -> Self {
3429            self.0.request = v.into();
3430            self
3431        }
3432
3433        /// Sets all the options, replacing any prior values.
3434        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3435            self.0.options = v.into();
3436            self
3437        }
3438
3439        /// Sends the request.
3440        ///
3441        /// # Long running operations
3442        ///
3443        /// This starts, but does not poll, a longrunning operation. More information
3444        /// on [update_multicloud_data_transfer_config][crate::client::DataTransferService::update_multicloud_data_transfer_config].
3445        pub async fn send(self) -> Result<longrunning::model::Operation> {
3446            (*self.0.stub)
3447                .update_multicloud_data_transfer_config(self.0.request, self.0.options)
3448                .await
3449                .map(gax::response::Response::into_body)
3450        }
3451
3452        /// Creates a [Poller][lro::Poller] to work with `update_multicloud_data_transfer_config`.
3453        pub fn poller(
3454            self,
3455        ) -> impl lro::Poller<crate::model::MulticloudDataTransferConfig, crate::model::OperationMetadata>
3456        {
3457            type Operation = lro::internal::Operation<
3458                crate::model::MulticloudDataTransferConfig,
3459                crate::model::OperationMetadata,
3460            >;
3461            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3462            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3463
3464            let stub = self.0.stub.clone();
3465            let mut options = self.0.options.clone();
3466            options.set_retry_policy(gax::retry_policy::NeverRetry);
3467            let query = move |name| {
3468                let stub = stub.clone();
3469                let options = options.clone();
3470                async {
3471                    let op = GetOperation::new(stub)
3472                        .set_name(name)
3473                        .with_options(options)
3474                        .send()
3475                        .await?;
3476                    Ok(Operation::new(op))
3477                }
3478            };
3479
3480            let start = move || async {
3481                let op = self.send().await?;
3482                Ok(Operation::new(op))
3483            };
3484
3485            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3486        }
3487
3488        /// Sets the value of [update_mask][crate::model::UpdateMulticloudDataTransferConfigRequest::update_mask].
3489        pub fn set_update_mask<T>(mut self, v: T) -> Self
3490        where
3491            T: std::convert::Into<wkt::FieldMask>,
3492        {
3493            self.0.request.update_mask = std::option::Option::Some(v.into());
3494            self
3495        }
3496
3497        /// Sets or clears the value of [update_mask][crate::model::UpdateMulticloudDataTransferConfigRequest::update_mask].
3498        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3499        where
3500            T: std::convert::Into<wkt::FieldMask>,
3501        {
3502            self.0.request.update_mask = v.map(|x| x.into());
3503            self
3504        }
3505
3506        /// Sets the value of [multicloud_data_transfer_config][crate::model::UpdateMulticloudDataTransferConfigRequest::multicloud_data_transfer_config].
3507        ///
3508        /// This is a **required** field for requests.
3509        pub fn set_multicloud_data_transfer_config<T>(mut self, v: T) -> Self
3510        where
3511            T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
3512        {
3513            self.0.request.multicloud_data_transfer_config = std::option::Option::Some(v.into());
3514            self
3515        }
3516
3517        /// Sets or clears the value of [multicloud_data_transfer_config][crate::model::UpdateMulticloudDataTransferConfigRequest::multicloud_data_transfer_config].
3518        ///
3519        /// This is a **required** field for requests.
3520        pub fn set_or_clear_multicloud_data_transfer_config<T>(
3521            mut self,
3522            v: std::option::Option<T>,
3523        ) -> Self
3524        where
3525            T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
3526        {
3527            self.0.request.multicloud_data_transfer_config = v.map(|x| x.into());
3528            self
3529        }
3530
3531        /// Sets the value of [request_id][crate::model::UpdateMulticloudDataTransferConfigRequest::request_id].
3532        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3533            self.0.request.request_id = v.into();
3534            self
3535        }
3536    }
3537
3538    #[doc(hidden)]
3539    impl gax::options::internal::RequestBuilder for UpdateMulticloudDataTransferConfig {
3540        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3541            &mut self.0.options
3542        }
3543    }
3544
3545    /// The request builder for [DataTransferService::delete_multicloud_data_transfer_config][crate::client::DataTransferService::delete_multicloud_data_transfer_config] calls.
3546    ///
3547    /// # Example
3548    /// ```no_run
3549    /// # use google_cloud_networkconnectivity_v1::builder;
3550    /// use builder::data_transfer_service::DeleteMulticloudDataTransferConfig;
3551    /// # tokio_test::block_on(async {
3552    /// use lro::Poller;
3553    ///
3554    /// let builder = prepare_request_builder();
3555    /// let response = builder.poller().until_done().await?;
3556    /// # gax::Result::<()>::Ok(()) });
3557    ///
3558    /// fn prepare_request_builder() -> DeleteMulticloudDataTransferConfig {
3559    ///   # panic!();
3560    ///   // ... details omitted ...
3561    /// }
3562    /// ```
3563    #[derive(Clone, Debug)]
3564    pub struct DeleteMulticloudDataTransferConfig(
3565        RequestBuilder<crate::model::DeleteMulticloudDataTransferConfigRequest>,
3566    );
3567
3568    impl DeleteMulticloudDataTransferConfig {
3569        pub(crate) fn new(
3570            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3571        ) -> Self {
3572            Self(RequestBuilder::new(stub))
3573        }
3574
3575        /// Sets the full request, replacing any prior values.
3576        pub fn with_request<V: Into<crate::model::DeleteMulticloudDataTransferConfigRequest>>(
3577            mut self,
3578            v: V,
3579        ) -> Self {
3580            self.0.request = v.into();
3581            self
3582        }
3583
3584        /// Sets all the options, replacing any prior values.
3585        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3586            self.0.options = v.into();
3587            self
3588        }
3589
3590        /// Sends the request.
3591        ///
3592        /// # Long running operations
3593        ///
3594        /// This starts, but does not poll, a longrunning operation. More information
3595        /// on [delete_multicloud_data_transfer_config][crate::client::DataTransferService::delete_multicloud_data_transfer_config].
3596        pub async fn send(self) -> Result<longrunning::model::Operation> {
3597            (*self.0.stub)
3598                .delete_multicloud_data_transfer_config(self.0.request, self.0.options)
3599                .await
3600                .map(gax::response::Response::into_body)
3601        }
3602
3603        /// Creates a [Poller][lro::Poller] to work with `delete_multicloud_data_transfer_config`.
3604        pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
3605            type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
3606            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3607            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3608
3609            let stub = self.0.stub.clone();
3610            let mut options = self.0.options.clone();
3611            options.set_retry_policy(gax::retry_policy::NeverRetry);
3612            let query = move |name| {
3613                let stub = stub.clone();
3614                let options = options.clone();
3615                async {
3616                    let op = GetOperation::new(stub)
3617                        .set_name(name)
3618                        .with_options(options)
3619                        .send()
3620                        .await?;
3621                    Ok(Operation::new(op))
3622                }
3623            };
3624
3625            let start = move || async {
3626                let op = self.send().await?;
3627                Ok(Operation::new(op))
3628            };
3629
3630            lro::internal::new_unit_response_poller(
3631                polling_error_policy,
3632                polling_backoff_policy,
3633                start,
3634                query,
3635            )
3636        }
3637
3638        /// Sets the value of [name][crate::model::DeleteMulticloudDataTransferConfigRequest::name].
3639        ///
3640        /// This is a **required** field for requests.
3641        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3642            self.0.request.name = v.into();
3643            self
3644        }
3645
3646        /// Sets the value of [request_id][crate::model::DeleteMulticloudDataTransferConfigRequest::request_id].
3647        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3648            self.0.request.request_id = v.into();
3649            self
3650        }
3651
3652        /// Sets the value of [etag][crate::model::DeleteMulticloudDataTransferConfigRequest::etag].
3653        pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
3654            self.0.request.etag = v.into();
3655            self
3656        }
3657    }
3658
3659    #[doc(hidden)]
3660    impl gax::options::internal::RequestBuilder for DeleteMulticloudDataTransferConfig {
3661        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3662            &mut self.0.options
3663        }
3664    }
3665
3666    /// The request builder for [DataTransferService::list_destinations][crate::client::DataTransferService::list_destinations] calls.
3667    ///
3668    /// # Example
3669    /// ```no_run
3670    /// # use google_cloud_networkconnectivity_v1::builder;
3671    /// use builder::data_transfer_service::ListDestinations;
3672    /// # tokio_test::block_on(async {
3673    /// use gax::paginator::ItemPaginator;
3674    ///
3675    /// let builder = prepare_request_builder();
3676    /// let mut items = builder.by_item();
3677    /// while let Some(result) = items.next().await {
3678    ///   let item = result?;
3679    /// }
3680    /// # gax::Result::<()>::Ok(()) });
3681    ///
3682    /// fn prepare_request_builder() -> ListDestinations {
3683    ///   # panic!();
3684    ///   // ... details omitted ...
3685    /// }
3686    /// ```
3687    #[derive(Clone, Debug)]
3688    pub struct ListDestinations(RequestBuilder<crate::model::ListDestinationsRequest>);
3689
3690    impl ListDestinations {
3691        pub(crate) fn new(
3692            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3693        ) -> Self {
3694            Self(RequestBuilder::new(stub))
3695        }
3696
3697        /// Sets the full request, replacing any prior values.
3698        pub fn with_request<V: Into<crate::model::ListDestinationsRequest>>(
3699            mut self,
3700            v: V,
3701        ) -> Self {
3702            self.0.request = v.into();
3703            self
3704        }
3705
3706        /// Sets all the options, replacing any prior values.
3707        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3708            self.0.options = v.into();
3709            self
3710        }
3711
3712        /// Sends the request.
3713        pub async fn send(self) -> Result<crate::model::ListDestinationsResponse> {
3714            (*self.0.stub)
3715                .list_destinations(self.0.request, self.0.options)
3716                .await
3717                .map(gax::response::Response::into_body)
3718        }
3719
3720        /// Streams each page in the collection.
3721        pub fn by_page(
3722            self,
3723        ) -> impl gax::paginator::Paginator<crate::model::ListDestinationsResponse, gax::error::Error>
3724        {
3725            use std::clone::Clone;
3726            let token = self.0.request.page_token.clone();
3727            let execute = move |token: String| {
3728                let mut builder = self.clone();
3729                builder.0.request = builder.0.request.set_page_token(token);
3730                builder.send()
3731            };
3732            gax::paginator::internal::new_paginator(token, execute)
3733        }
3734
3735        /// Streams each item in the collection.
3736        pub fn by_item(
3737            self,
3738        ) -> impl gax::paginator::ItemPaginator<crate::model::ListDestinationsResponse, gax::error::Error>
3739        {
3740            use gax::paginator::Paginator;
3741            self.by_page().items()
3742        }
3743
3744        /// Sets the value of [parent][crate::model::ListDestinationsRequest::parent].
3745        ///
3746        /// This is a **required** field for requests.
3747        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3748            self.0.request.parent = v.into();
3749            self
3750        }
3751
3752        /// Sets the value of [page_size][crate::model::ListDestinationsRequest::page_size].
3753        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3754            self.0.request.page_size = v.into();
3755            self
3756        }
3757
3758        /// Sets the value of [page_token][crate::model::ListDestinationsRequest::page_token].
3759        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3760            self.0.request.page_token = v.into();
3761            self
3762        }
3763
3764        /// Sets the value of [filter][crate::model::ListDestinationsRequest::filter].
3765        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3766            self.0.request.filter = v.into();
3767            self
3768        }
3769
3770        /// Sets the value of [order_by][crate::model::ListDestinationsRequest::order_by].
3771        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3772            self.0.request.order_by = v.into();
3773            self
3774        }
3775
3776        /// Sets the value of [return_partial_success][crate::model::ListDestinationsRequest::return_partial_success].
3777        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
3778            self.0.request.return_partial_success = v.into();
3779            self
3780        }
3781    }
3782
3783    #[doc(hidden)]
3784    impl gax::options::internal::RequestBuilder for ListDestinations {
3785        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3786            &mut self.0.options
3787        }
3788    }
3789
3790    /// The request builder for [DataTransferService::get_destination][crate::client::DataTransferService::get_destination] calls.
3791    ///
3792    /// # Example
3793    /// ```no_run
3794    /// # use google_cloud_networkconnectivity_v1::builder;
3795    /// use builder::data_transfer_service::GetDestination;
3796    /// # tokio_test::block_on(async {
3797    ///
3798    /// let builder = prepare_request_builder();
3799    /// let response = builder.send().await?;
3800    /// # gax::Result::<()>::Ok(()) });
3801    ///
3802    /// fn prepare_request_builder() -> GetDestination {
3803    ///   # panic!();
3804    ///   // ... details omitted ...
3805    /// }
3806    /// ```
3807    #[derive(Clone, Debug)]
3808    pub struct GetDestination(RequestBuilder<crate::model::GetDestinationRequest>);
3809
3810    impl GetDestination {
3811        pub(crate) fn new(
3812            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3813        ) -> Self {
3814            Self(RequestBuilder::new(stub))
3815        }
3816
3817        /// Sets the full request, replacing any prior values.
3818        pub fn with_request<V: Into<crate::model::GetDestinationRequest>>(mut self, v: V) -> Self {
3819            self.0.request = v.into();
3820            self
3821        }
3822
3823        /// Sets all the options, replacing any prior values.
3824        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3825            self.0.options = v.into();
3826            self
3827        }
3828
3829        /// Sends the request.
3830        pub async fn send(self) -> Result<crate::model::Destination> {
3831            (*self.0.stub)
3832                .get_destination(self.0.request, self.0.options)
3833                .await
3834                .map(gax::response::Response::into_body)
3835        }
3836
3837        /// Sets the value of [name][crate::model::GetDestinationRequest::name].
3838        ///
3839        /// This is a **required** field for requests.
3840        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3841            self.0.request.name = v.into();
3842            self
3843        }
3844    }
3845
3846    #[doc(hidden)]
3847    impl gax::options::internal::RequestBuilder for GetDestination {
3848        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3849            &mut self.0.options
3850        }
3851    }
3852
3853    /// The request builder for [DataTransferService::create_destination][crate::client::DataTransferService::create_destination] calls.
3854    ///
3855    /// # Example
3856    /// ```no_run
3857    /// # use google_cloud_networkconnectivity_v1::builder;
3858    /// use builder::data_transfer_service::CreateDestination;
3859    /// # tokio_test::block_on(async {
3860    /// use lro::Poller;
3861    ///
3862    /// let builder = prepare_request_builder();
3863    /// let response = builder.poller().until_done().await?;
3864    /// # gax::Result::<()>::Ok(()) });
3865    ///
3866    /// fn prepare_request_builder() -> CreateDestination {
3867    ///   # panic!();
3868    ///   // ... details omitted ...
3869    /// }
3870    /// ```
3871    #[derive(Clone, Debug)]
3872    pub struct CreateDestination(RequestBuilder<crate::model::CreateDestinationRequest>);
3873
3874    impl CreateDestination {
3875        pub(crate) fn new(
3876            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3877        ) -> Self {
3878            Self(RequestBuilder::new(stub))
3879        }
3880
3881        /// Sets the full request, replacing any prior values.
3882        pub fn with_request<V: Into<crate::model::CreateDestinationRequest>>(
3883            mut self,
3884            v: V,
3885        ) -> Self {
3886            self.0.request = v.into();
3887            self
3888        }
3889
3890        /// Sets all the options, replacing any prior values.
3891        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3892            self.0.options = v.into();
3893            self
3894        }
3895
3896        /// Sends the request.
3897        ///
3898        /// # Long running operations
3899        ///
3900        /// This starts, but does not poll, a longrunning operation. More information
3901        /// on [create_destination][crate::client::DataTransferService::create_destination].
3902        pub async fn send(self) -> Result<longrunning::model::Operation> {
3903            (*self.0.stub)
3904                .create_destination(self.0.request, self.0.options)
3905                .await
3906                .map(gax::response::Response::into_body)
3907        }
3908
3909        /// Creates a [Poller][lro::Poller] to work with `create_destination`.
3910        pub fn poller(
3911            self,
3912        ) -> impl lro::Poller<crate::model::Destination, crate::model::OperationMetadata> {
3913            type Operation = lro::internal::Operation<
3914                crate::model::Destination,
3915                crate::model::OperationMetadata,
3916            >;
3917            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3918            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3919
3920            let stub = self.0.stub.clone();
3921            let mut options = self.0.options.clone();
3922            options.set_retry_policy(gax::retry_policy::NeverRetry);
3923            let query = move |name| {
3924                let stub = stub.clone();
3925                let options = options.clone();
3926                async {
3927                    let op = GetOperation::new(stub)
3928                        .set_name(name)
3929                        .with_options(options)
3930                        .send()
3931                        .await?;
3932                    Ok(Operation::new(op))
3933                }
3934            };
3935
3936            let start = move || async {
3937                let op = self.send().await?;
3938                Ok(Operation::new(op))
3939            };
3940
3941            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3942        }
3943
3944        /// Sets the value of [parent][crate::model::CreateDestinationRequest::parent].
3945        ///
3946        /// This is a **required** field for requests.
3947        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3948            self.0.request.parent = v.into();
3949            self
3950        }
3951
3952        /// Sets the value of [destination_id][crate::model::CreateDestinationRequest::destination_id].
3953        ///
3954        /// This is a **required** field for requests.
3955        pub fn set_destination_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3956            self.0.request.destination_id = v.into();
3957            self
3958        }
3959
3960        /// Sets the value of [destination][crate::model::CreateDestinationRequest::destination].
3961        ///
3962        /// This is a **required** field for requests.
3963        pub fn set_destination<T>(mut self, v: T) -> Self
3964        where
3965            T: std::convert::Into<crate::model::Destination>,
3966        {
3967            self.0.request.destination = std::option::Option::Some(v.into());
3968            self
3969        }
3970
3971        /// Sets or clears the value of [destination][crate::model::CreateDestinationRequest::destination].
3972        ///
3973        /// This is a **required** field for requests.
3974        pub fn set_or_clear_destination<T>(mut self, v: std::option::Option<T>) -> Self
3975        where
3976            T: std::convert::Into<crate::model::Destination>,
3977        {
3978            self.0.request.destination = v.map(|x| x.into());
3979            self
3980        }
3981
3982        /// Sets the value of [request_id][crate::model::CreateDestinationRequest::request_id].
3983        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3984            self.0.request.request_id = v.into();
3985            self
3986        }
3987    }
3988
3989    #[doc(hidden)]
3990    impl gax::options::internal::RequestBuilder for CreateDestination {
3991        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3992            &mut self.0.options
3993        }
3994    }
3995
3996    /// The request builder for [DataTransferService::update_destination][crate::client::DataTransferService::update_destination] calls.
3997    ///
3998    /// # Example
3999    /// ```no_run
4000    /// # use google_cloud_networkconnectivity_v1::builder;
4001    /// use builder::data_transfer_service::UpdateDestination;
4002    /// # tokio_test::block_on(async {
4003    /// use lro::Poller;
4004    ///
4005    /// let builder = prepare_request_builder();
4006    /// let response = builder.poller().until_done().await?;
4007    /// # gax::Result::<()>::Ok(()) });
4008    ///
4009    /// fn prepare_request_builder() -> UpdateDestination {
4010    ///   # panic!();
4011    ///   // ... details omitted ...
4012    /// }
4013    /// ```
4014    #[derive(Clone, Debug)]
4015    pub struct UpdateDestination(RequestBuilder<crate::model::UpdateDestinationRequest>);
4016
4017    impl UpdateDestination {
4018        pub(crate) fn new(
4019            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4020        ) -> Self {
4021            Self(RequestBuilder::new(stub))
4022        }
4023
4024        /// Sets the full request, replacing any prior values.
4025        pub fn with_request<V: Into<crate::model::UpdateDestinationRequest>>(
4026            mut self,
4027            v: V,
4028        ) -> Self {
4029            self.0.request = v.into();
4030            self
4031        }
4032
4033        /// Sets all the options, replacing any prior values.
4034        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4035            self.0.options = v.into();
4036            self
4037        }
4038
4039        /// Sends the request.
4040        ///
4041        /// # Long running operations
4042        ///
4043        /// This starts, but does not poll, a longrunning operation. More information
4044        /// on [update_destination][crate::client::DataTransferService::update_destination].
4045        pub async fn send(self) -> Result<longrunning::model::Operation> {
4046            (*self.0.stub)
4047                .update_destination(self.0.request, self.0.options)
4048                .await
4049                .map(gax::response::Response::into_body)
4050        }
4051
4052        /// Creates a [Poller][lro::Poller] to work with `update_destination`.
4053        pub fn poller(
4054            self,
4055        ) -> impl lro::Poller<crate::model::Destination, crate::model::OperationMetadata> {
4056            type Operation = lro::internal::Operation<
4057                crate::model::Destination,
4058                crate::model::OperationMetadata,
4059            >;
4060            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4061            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4062
4063            let stub = self.0.stub.clone();
4064            let mut options = self.0.options.clone();
4065            options.set_retry_policy(gax::retry_policy::NeverRetry);
4066            let query = move |name| {
4067                let stub = stub.clone();
4068                let options = options.clone();
4069                async {
4070                    let op = GetOperation::new(stub)
4071                        .set_name(name)
4072                        .with_options(options)
4073                        .send()
4074                        .await?;
4075                    Ok(Operation::new(op))
4076                }
4077            };
4078
4079            let start = move || async {
4080                let op = self.send().await?;
4081                Ok(Operation::new(op))
4082            };
4083
4084            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
4085        }
4086
4087        /// Sets the value of [update_mask][crate::model::UpdateDestinationRequest::update_mask].
4088        pub fn set_update_mask<T>(mut self, v: T) -> Self
4089        where
4090            T: std::convert::Into<wkt::FieldMask>,
4091        {
4092            self.0.request.update_mask = std::option::Option::Some(v.into());
4093            self
4094        }
4095
4096        /// Sets or clears the value of [update_mask][crate::model::UpdateDestinationRequest::update_mask].
4097        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4098        where
4099            T: std::convert::Into<wkt::FieldMask>,
4100        {
4101            self.0.request.update_mask = v.map(|x| x.into());
4102            self
4103        }
4104
4105        /// Sets the value of [destination][crate::model::UpdateDestinationRequest::destination].
4106        ///
4107        /// This is a **required** field for requests.
4108        pub fn set_destination<T>(mut self, v: T) -> Self
4109        where
4110            T: std::convert::Into<crate::model::Destination>,
4111        {
4112            self.0.request.destination = std::option::Option::Some(v.into());
4113            self
4114        }
4115
4116        /// Sets or clears the value of [destination][crate::model::UpdateDestinationRequest::destination].
4117        ///
4118        /// This is a **required** field for requests.
4119        pub fn set_or_clear_destination<T>(mut self, v: std::option::Option<T>) -> Self
4120        where
4121            T: std::convert::Into<crate::model::Destination>,
4122        {
4123            self.0.request.destination = v.map(|x| x.into());
4124            self
4125        }
4126
4127        /// Sets the value of [request_id][crate::model::UpdateDestinationRequest::request_id].
4128        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4129            self.0.request.request_id = v.into();
4130            self
4131        }
4132    }
4133
4134    #[doc(hidden)]
4135    impl gax::options::internal::RequestBuilder for UpdateDestination {
4136        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4137            &mut self.0.options
4138        }
4139    }
4140
4141    /// The request builder for [DataTransferService::delete_destination][crate::client::DataTransferService::delete_destination] calls.
4142    ///
4143    /// # Example
4144    /// ```no_run
4145    /// # use google_cloud_networkconnectivity_v1::builder;
4146    /// use builder::data_transfer_service::DeleteDestination;
4147    /// # tokio_test::block_on(async {
4148    /// use lro::Poller;
4149    ///
4150    /// let builder = prepare_request_builder();
4151    /// let response = builder.poller().until_done().await?;
4152    /// # gax::Result::<()>::Ok(()) });
4153    ///
4154    /// fn prepare_request_builder() -> DeleteDestination {
4155    ///   # panic!();
4156    ///   // ... details omitted ...
4157    /// }
4158    /// ```
4159    #[derive(Clone, Debug)]
4160    pub struct DeleteDestination(RequestBuilder<crate::model::DeleteDestinationRequest>);
4161
4162    impl DeleteDestination {
4163        pub(crate) fn new(
4164            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4165        ) -> Self {
4166            Self(RequestBuilder::new(stub))
4167        }
4168
4169        /// Sets the full request, replacing any prior values.
4170        pub fn with_request<V: Into<crate::model::DeleteDestinationRequest>>(
4171            mut self,
4172            v: V,
4173        ) -> Self {
4174            self.0.request = v.into();
4175            self
4176        }
4177
4178        /// Sets all the options, replacing any prior values.
4179        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4180            self.0.options = v.into();
4181            self
4182        }
4183
4184        /// Sends the request.
4185        ///
4186        /// # Long running operations
4187        ///
4188        /// This starts, but does not poll, a longrunning operation. More information
4189        /// on [delete_destination][crate::client::DataTransferService::delete_destination].
4190        pub async fn send(self) -> Result<longrunning::model::Operation> {
4191            (*self.0.stub)
4192                .delete_destination(self.0.request, self.0.options)
4193                .await
4194                .map(gax::response::Response::into_body)
4195        }
4196
4197        /// Creates a [Poller][lro::Poller] to work with `delete_destination`.
4198        pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
4199            type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
4200            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4201            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4202
4203            let stub = self.0.stub.clone();
4204            let mut options = self.0.options.clone();
4205            options.set_retry_policy(gax::retry_policy::NeverRetry);
4206            let query = move |name| {
4207                let stub = stub.clone();
4208                let options = options.clone();
4209                async {
4210                    let op = GetOperation::new(stub)
4211                        .set_name(name)
4212                        .with_options(options)
4213                        .send()
4214                        .await?;
4215                    Ok(Operation::new(op))
4216                }
4217            };
4218
4219            let start = move || async {
4220                let op = self.send().await?;
4221                Ok(Operation::new(op))
4222            };
4223
4224            lro::internal::new_unit_response_poller(
4225                polling_error_policy,
4226                polling_backoff_policy,
4227                start,
4228                query,
4229            )
4230        }
4231
4232        /// Sets the value of [name][crate::model::DeleteDestinationRequest::name].
4233        ///
4234        /// This is a **required** field for requests.
4235        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4236            self.0.request.name = v.into();
4237            self
4238        }
4239
4240        /// Sets the value of [request_id][crate::model::DeleteDestinationRequest::request_id].
4241        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4242            self.0.request.request_id = v.into();
4243            self
4244        }
4245
4246        /// Sets the value of [etag][crate::model::DeleteDestinationRequest::etag].
4247        pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
4248            self.0.request.etag = v.into();
4249            self
4250        }
4251    }
4252
4253    #[doc(hidden)]
4254    impl gax::options::internal::RequestBuilder for DeleteDestination {
4255        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4256            &mut self.0.options
4257        }
4258    }
4259
4260    /// The request builder for [DataTransferService::get_multicloud_data_transfer_supported_service][crate::client::DataTransferService::get_multicloud_data_transfer_supported_service] calls.
4261    ///
4262    /// # Example
4263    /// ```no_run
4264    /// # use google_cloud_networkconnectivity_v1::builder;
4265    /// use builder::data_transfer_service::GetMulticloudDataTransferSupportedService;
4266    /// # tokio_test::block_on(async {
4267    ///
4268    /// let builder = prepare_request_builder();
4269    /// let response = builder.send().await?;
4270    /// # gax::Result::<()>::Ok(()) });
4271    ///
4272    /// fn prepare_request_builder() -> GetMulticloudDataTransferSupportedService {
4273    ///   # panic!();
4274    ///   // ... details omitted ...
4275    /// }
4276    /// ```
4277    #[derive(Clone, Debug)]
4278    pub struct GetMulticloudDataTransferSupportedService(
4279        RequestBuilder<crate::model::GetMulticloudDataTransferSupportedServiceRequest>,
4280    );
4281
4282    impl GetMulticloudDataTransferSupportedService {
4283        pub(crate) fn new(
4284            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4285        ) -> Self {
4286            Self(RequestBuilder::new(stub))
4287        }
4288
4289        /// Sets the full request, replacing any prior values.
4290        pub fn with_request<
4291            V: Into<crate::model::GetMulticloudDataTransferSupportedServiceRequest>,
4292        >(
4293            mut self,
4294            v: V,
4295        ) -> Self {
4296            self.0.request = v.into();
4297            self
4298        }
4299
4300        /// Sets all the options, replacing any prior values.
4301        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4302            self.0.options = v.into();
4303            self
4304        }
4305
4306        /// Sends the request.
4307        pub async fn send(self) -> Result<crate::model::MulticloudDataTransferSupportedService> {
4308            (*self.0.stub)
4309                .get_multicloud_data_transfer_supported_service(self.0.request, self.0.options)
4310                .await
4311                .map(gax::response::Response::into_body)
4312        }
4313
4314        /// Sets the value of [name][crate::model::GetMulticloudDataTransferSupportedServiceRequest::name].
4315        ///
4316        /// This is a **required** field for requests.
4317        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4318            self.0.request.name = v.into();
4319            self
4320        }
4321    }
4322
4323    #[doc(hidden)]
4324    impl gax::options::internal::RequestBuilder for GetMulticloudDataTransferSupportedService {
4325        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4326            &mut self.0.options
4327        }
4328    }
4329
4330    /// The request builder for [DataTransferService::list_multicloud_data_transfer_supported_services][crate::client::DataTransferService::list_multicloud_data_transfer_supported_services] calls.
4331    ///
4332    /// # Example
4333    /// ```no_run
4334    /// # use google_cloud_networkconnectivity_v1::builder;
4335    /// use builder::data_transfer_service::ListMulticloudDataTransferSupportedServices;
4336    /// # tokio_test::block_on(async {
4337    /// use gax::paginator::ItemPaginator;
4338    ///
4339    /// let builder = prepare_request_builder();
4340    /// let mut items = builder.by_item();
4341    /// while let Some(result) = items.next().await {
4342    ///   let item = result?;
4343    /// }
4344    /// # gax::Result::<()>::Ok(()) });
4345    ///
4346    /// fn prepare_request_builder() -> ListMulticloudDataTransferSupportedServices {
4347    ///   # panic!();
4348    ///   // ... details omitted ...
4349    /// }
4350    /// ```
4351    #[derive(Clone, Debug)]
4352    pub struct ListMulticloudDataTransferSupportedServices(
4353        RequestBuilder<crate::model::ListMulticloudDataTransferSupportedServicesRequest>,
4354    );
4355
4356    impl ListMulticloudDataTransferSupportedServices {
4357        pub(crate) fn new(
4358            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4359        ) -> Self {
4360            Self(RequestBuilder::new(stub))
4361        }
4362
4363        /// Sets the full request, replacing any prior values.
4364        pub fn with_request<
4365            V: Into<crate::model::ListMulticloudDataTransferSupportedServicesRequest>,
4366        >(
4367            mut self,
4368            v: V,
4369        ) -> Self {
4370            self.0.request = v.into();
4371            self
4372        }
4373
4374        /// Sets all the options, replacing any prior values.
4375        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4376            self.0.options = v.into();
4377            self
4378        }
4379
4380        /// Sends the request.
4381        pub async fn send(
4382            self,
4383        ) -> Result<crate::model::ListMulticloudDataTransferSupportedServicesResponse> {
4384            (*self.0.stub)
4385                .list_multicloud_data_transfer_supported_services(self.0.request, self.0.options)
4386                .await
4387                .map(gax::response::Response::into_body)
4388        }
4389
4390        /// Streams each page in the collection.
4391        pub fn by_page(
4392            self,
4393        ) -> impl gax::paginator::Paginator<
4394            crate::model::ListMulticloudDataTransferSupportedServicesResponse,
4395            gax::error::Error,
4396        > {
4397            use std::clone::Clone;
4398            let token = self.0.request.page_token.clone();
4399            let execute = move |token: String| {
4400                let mut builder = self.clone();
4401                builder.0.request = builder.0.request.set_page_token(token);
4402                builder.send()
4403            };
4404            gax::paginator::internal::new_paginator(token, execute)
4405        }
4406
4407        /// Streams each item in the collection.
4408        pub fn by_item(
4409            self,
4410        ) -> impl gax::paginator::ItemPaginator<
4411            crate::model::ListMulticloudDataTransferSupportedServicesResponse,
4412            gax::error::Error,
4413        > {
4414            use gax::paginator::Paginator;
4415            self.by_page().items()
4416        }
4417
4418        /// Sets the value of [parent][crate::model::ListMulticloudDataTransferSupportedServicesRequest::parent].
4419        ///
4420        /// This is a **required** field for requests.
4421        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4422            self.0.request.parent = v.into();
4423            self
4424        }
4425
4426        /// Sets the value of [page_size][crate::model::ListMulticloudDataTransferSupportedServicesRequest::page_size].
4427        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4428            self.0.request.page_size = v.into();
4429            self
4430        }
4431
4432        /// Sets the value of [page_token][crate::model::ListMulticloudDataTransferSupportedServicesRequest::page_token].
4433        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4434            self.0.request.page_token = v.into();
4435            self
4436        }
4437    }
4438
4439    #[doc(hidden)]
4440    impl gax::options::internal::RequestBuilder for ListMulticloudDataTransferSupportedServices {
4441        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4442            &mut self.0.options
4443        }
4444    }
4445
4446    /// The request builder for [DataTransferService::list_locations][crate::client::DataTransferService::list_locations] calls.
4447    ///
4448    /// # Example
4449    /// ```no_run
4450    /// # use google_cloud_networkconnectivity_v1::builder;
4451    /// use builder::data_transfer_service::ListLocations;
4452    /// # tokio_test::block_on(async {
4453    /// use gax::paginator::ItemPaginator;
4454    ///
4455    /// let builder = prepare_request_builder();
4456    /// let mut items = builder.by_item();
4457    /// while let Some(result) = items.next().await {
4458    ///   let item = result?;
4459    /// }
4460    /// # gax::Result::<()>::Ok(()) });
4461    ///
4462    /// fn prepare_request_builder() -> ListLocations {
4463    ///   # panic!();
4464    ///   // ... details omitted ...
4465    /// }
4466    /// ```
4467    #[derive(Clone, Debug)]
4468    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
4469
4470    impl ListLocations {
4471        pub(crate) fn new(
4472            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4473        ) -> Self {
4474            Self(RequestBuilder::new(stub))
4475        }
4476
4477        /// Sets the full request, replacing any prior values.
4478        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
4479            mut self,
4480            v: V,
4481        ) -> Self {
4482            self.0.request = v.into();
4483            self
4484        }
4485
4486        /// Sets all the options, replacing any prior values.
4487        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4488            self.0.options = v.into();
4489            self
4490        }
4491
4492        /// Sends the request.
4493        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
4494            (*self.0.stub)
4495                .list_locations(self.0.request, self.0.options)
4496                .await
4497                .map(gax::response::Response::into_body)
4498        }
4499
4500        /// Streams each page in the collection.
4501        pub fn by_page(
4502            self,
4503        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
4504        {
4505            use std::clone::Clone;
4506            let token = self.0.request.page_token.clone();
4507            let execute = move |token: String| {
4508                let mut builder = self.clone();
4509                builder.0.request = builder.0.request.set_page_token(token);
4510                builder.send()
4511            };
4512            gax::paginator::internal::new_paginator(token, execute)
4513        }
4514
4515        /// Streams each item in the collection.
4516        pub fn by_item(
4517            self,
4518        ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
4519        {
4520            use gax::paginator::Paginator;
4521            self.by_page().items()
4522        }
4523
4524        /// Sets the value of [name][location::model::ListLocationsRequest::name].
4525        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4526            self.0.request.name = v.into();
4527            self
4528        }
4529
4530        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
4531        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4532            self.0.request.filter = v.into();
4533            self
4534        }
4535
4536        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
4537        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4538            self.0.request.page_size = v.into();
4539            self
4540        }
4541
4542        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
4543        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4544            self.0.request.page_token = v.into();
4545            self
4546        }
4547    }
4548
4549    #[doc(hidden)]
4550    impl gax::options::internal::RequestBuilder for ListLocations {
4551        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4552            &mut self.0.options
4553        }
4554    }
4555
4556    /// The request builder for [DataTransferService::get_location][crate::client::DataTransferService::get_location] calls.
4557    ///
4558    /// # Example
4559    /// ```no_run
4560    /// # use google_cloud_networkconnectivity_v1::builder;
4561    /// use builder::data_transfer_service::GetLocation;
4562    /// # tokio_test::block_on(async {
4563    ///
4564    /// let builder = prepare_request_builder();
4565    /// let response = builder.send().await?;
4566    /// # gax::Result::<()>::Ok(()) });
4567    ///
4568    /// fn prepare_request_builder() -> GetLocation {
4569    ///   # panic!();
4570    ///   // ... details omitted ...
4571    /// }
4572    /// ```
4573    #[derive(Clone, Debug)]
4574    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
4575
4576    impl GetLocation {
4577        pub(crate) fn new(
4578            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4579        ) -> Self {
4580            Self(RequestBuilder::new(stub))
4581        }
4582
4583        /// Sets the full request, replacing any prior values.
4584        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
4585            self.0.request = v.into();
4586            self
4587        }
4588
4589        /// Sets all the options, replacing any prior values.
4590        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4591            self.0.options = v.into();
4592            self
4593        }
4594
4595        /// Sends the request.
4596        pub async fn send(self) -> Result<location::model::Location> {
4597            (*self.0.stub)
4598                .get_location(self.0.request, self.0.options)
4599                .await
4600                .map(gax::response::Response::into_body)
4601        }
4602
4603        /// Sets the value of [name][location::model::GetLocationRequest::name].
4604        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4605            self.0.request.name = v.into();
4606            self
4607        }
4608    }
4609
4610    #[doc(hidden)]
4611    impl gax::options::internal::RequestBuilder for GetLocation {
4612        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4613            &mut self.0.options
4614        }
4615    }
4616
4617    /// The request builder for [DataTransferService::set_iam_policy][crate::client::DataTransferService::set_iam_policy] calls.
4618    ///
4619    /// # Example
4620    /// ```no_run
4621    /// # use google_cloud_networkconnectivity_v1::builder;
4622    /// use builder::data_transfer_service::SetIamPolicy;
4623    /// # tokio_test::block_on(async {
4624    ///
4625    /// let builder = prepare_request_builder();
4626    /// let response = builder.send().await?;
4627    /// # gax::Result::<()>::Ok(()) });
4628    ///
4629    /// fn prepare_request_builder() -> SetIamPolicy {
4630    ///   # panic!();
4631    ///   // ... details omitted ...
4632    /// }
4633    /// ```
4634    #[derive(Clone, Debug)]
4635    pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
4636
4637    impl SetIamPolicy {
4638        pub(crate) fn new(
4639            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4640        ) -> Self {
4641            Self(RequestBuilder::new(stub))
4642        }
4643
4644        /// Sets the full request, replacing any prior values.
4645        pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
4646            self.0.request = v.into();
4647            self
4648        }
4649
4650        /// Sets all the options, replacing any prior values.
4651        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4652            self.0.options = v.into();
4653            self
4654        }
4655
4656        /// Sends the request.
4657        pub async fn send(self) -> Result<iam_v1::model::Policy> {
4658            (*self.0.stub)
4659                .set_iam_policy(self.0.request, self.0.options)
4660                .await
4661                .map(gax::response::Response::into_body)
4662        }
4663
4664        /// Sets the value of [resource][iam_v1::model::SetIamPolicyRequest::resource].
4665        ///
4666        /// This is a **required** field for requests.
4667        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4668            self.0.request.resource = v.into();
4669            self
4670        }
4671
4672        /// Sets the value of [policy][iam_v1::model::SetIamPolicyRequest::policy].
4673        ///
4674        /// This is a **required** field for requests.
4675        pub fn set_policy<T>(mut self, v: T) -> Self
4676        where
4677            T: std::convert::Into<iam_v1::model::Policy>,
4678        {
4679            self.0.request.policy = std::option::Option::Some(v.into());
4680            self
4681        }
4682
4683        /// Sets or clears the value of [policy][iam_v1::model::SetIamPolicyRequest::policy].
4684        ///
4685        /// This is a **required** field for requests.
4686        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
4687        where
4688            T: std::convert::Into<iam_v1::model::Policy>,
4689        {
4690            self.0.request.policy = v.map(|x| x.into());
4691            self
4692        }
4693
4694        /// Sets the value of [update_mask][iam_v1::model::SetIamPolicyRequest::update_mask].
4695        pub fn set_update_mask<T>(mut self, v: T) -> Self
4696        where
4697            T: std::convert::Into<wkt::FieldMask>,
4698        {
4699            self.0.request.update_mask = std::option::Option::Some(v.into());
4700            self
4701        }
4702
4703        /// Sets or clears the value of [update_mask][iam_v1::model::SetIamPolicyRequest::update_mask].
4704        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4705        where
4706            T: std::convert::Into<wkt::FieldMask>,
4707        {
4708            self.0.request.update_mask = v.map(|x| x.into());
4709            self
4710        }
4711    }
4712
4713    #[doc(hidden)]
4714    impl gax::options::internal::RequestBuilder for SetIamPolicy {
4715        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4716            &mut self.0.options
4717        }
4718    }
4719
4720    /// The request builder for [DataTransferService::get_iam_policy][crate::client::DataTransferService::get_iam_policy] calls.
4721    ///
4722    /// # Example
4723    /// ```no_run
4724    /// # use google_cloud_networkconnectivity_v1::builder;
4725    /// use builder::data_transfer_service::GetIamPolicy;
4726    /// # tokio_test::block_on(async {
4727    ///
4728    /// let builder = prepare_request_builder();
4729    /// let response = builder.send().await?;
4730    /// # gax::Result::<()>::Ok(()) });
4731    ///
4732    /// fn prepare_request_builder() -> GetIamPolicy {
4733    ///   # panic!();
4734    ///   // ... details omitted ...
4735    /// }
4736    /// ```
4737    #[derive(Clone, Debug)]
4738    pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
4739
4740    impl GetIamPolicy {
4741        pub(crate) fn new(
4742            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4743        ) -> Self {
4744            Self(RequestBuilder::new(stub))
4745        }
4746
4747        /// Sets the full request, replacing any prior values.
4748        pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
4749            self.0.request = v.into();
4750            self
4751        }
4752
4753        /// Sets all the options, replacing any prior values.
4754        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4755            self.0.options = v.into();
4756            self
4757        }
4758
4759        /// Sends the request.
4760        pub async fn send(self) -> Result<iam_v1::model::Policy> {
4761            (*self.0.stub)
4762                .get_iam_policy(self.0.request, self.0.options)
4763                .await
4764                .map(gax::response::Response::into_body)
4765        }
4766
4767        /// Sets the value of [resource][iam_v1::model::GetIamPolicyRequest::resource].
4768        ///
4769        /// This is a **required** field for requests.
4770        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4771            self.0.request.resource = v.into();
4772            self
4773        }
4774
4775        /// Sets the value of [options][iam_v1::model::GetIamPolicyRequest::options].
4776        pub fn set_options<T>(mut self, v: T) -> Self
4777        where
4778            T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
4779        {
4780            self.0.request.options = std::option::Option::Some(v.into());
4781            self
4782        }
4783
4784        /// Sets or clears the value of [options][iam_v1::model::GetIamPolicyRequest::options].
4785        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
4786        where
4787            T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
4788        {
4789            self.0.request.options = v.map(|x| x.into());
4790            self
4791        }
4792    }
4793
4794    #[doc(hidden)]
4795    impl gax::options::internal::RequestBuilder for GetIamPolicy {
4796        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4797            &mut self.0.options
4798        }
4799    }
4800
4801    /// The request builder for [DataTransferService::test_iam_permissions][crate::client::DataTransferService::test_iam_permissions] calls.
4802    ///
4803    /// # Example
4804    /// ```no_run
4805    /// # use google_cloud_networkconnectivity_v1::builder;
4806    /// use builder::data_transfer_service::TestIamPermissions;
4807    /// # tokio_test::block_on(async {
4808    ///
4809    /// let builder = prepare_request_builder();
4810    /// let response = builder.send().await?;
4811    /// # gax::Result::<()>::Ok(()) });
4812    ///
4813    /// fn prepare_request_builder() -> TestIamPermissions {
4814    ///   # panic!();
4815    ///   // ... details omitted ...
4816    /// }
4817    /// ```
4818    #[derive(Clone, Debug)]
4819    pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
4820
4821    impl TestIamPermissions {
4822        pub(crate) fn new(
4823            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4824        ) -> Self {
4825            Self(RequestBuilder::new(stub))
4826        }
4827
4828        /// Sets the full request, replacing any prior values.
4829        pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
4830            mut self,
4831            v: V,
4832        ) -> Self {
4833            self.0.request = v.into();
4834            self
4835        }
4836
4837        /// Sets all the options, replacing any prior values.
4838        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4839            self.0.options = v.into();
4840            self
4841        }
4842
4843        /// Sends the request.
4844        pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
4845            (*self.0.stub)
4846                .test_iam_permissions(self.0.request, self.0.options)
4847                .await
4848                .map(gax::response::Response::into_body)
4849        }
4850
4851        /// Sets the value of [resource][iam_v1::model::TestIamPermissionsRequest::resource].
4852        ///
4853        /// This is a **required** field for requests.
4854        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4855            self.0.request.resource = v.into();
4856            self
4857        }
4858
4859        /// Sets the value of [permissions][iam_v1::model::TestIamPermissionsRequest::permissions].
4860        ///
4861        /// This is a **required** field for requests.
4862        pub fn set_permissions<T, V>(mut self, v: T) -> Self
4863        where
4864            T: std::iter::IntoIterator<Item = V>,
4865            V: std::convert::Into<std::string::String>,
4866        {
4867            use std::iter::Iterator;
4868            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
4869            self
4870        }
4871    }
4872
4873    #[doc(hidden)]
4874    impl gax::options::internal::RequestBuilder for TestIamPermissions {
4875        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4876            &mut self.0.options
4877        }
4878    }
4879
4880    /// The request builder for [DataTransferService::list_operations][crate::client::DataTransferService::list_operations] calls.
4881    ///
4882    /// # Example
4883    /// ```no_run
4884    /// # use google_cloud_networkconnectivity_v1::builder;
4885    /// use builder::data_transfer_service::ListOperations;
4886    /// # tokio_test::block_on(async {
4887    /// use gax::paginator::ItemPaginator;
4888    ///
4889    /// let builder = prepare_request_builder();
4890    /// let mut items = builder.by_item();
4891    /// while let Some(result) = items.next().await {
4892    ///   let item = result?;
4893    /// }
4894    /// # gax::Result::<()>::Ok(()) });
4895    ///
4896    /// fn prepare_request_builder() -> ListOperations {
4897    ///   # panic!();
4898    ///   // ... details omitted ...
4899    /// }
4900    /// ```
4901    #[derive(Clone, Debug)]
4902    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
4903
4904    impl ListOperations {
4905        pub(crate) fn new(
4906            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4907        ) -> Self {
4908            Self(RequestBuilder::new(stub))
4909        }
4910
4911        /// Sets the full request, replacing any prior values.
4912        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
4913            mut self,
4914            v: V,
4915        ) -> Self {
4916            self.0.request = v.into();
4917            self
4918        }
4919
4920        /// Sets all the options, replacing any prior values.
4921        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4922            self.0.options = v.into();
4923            self
4924        }
4925
4926        /// Sends the request.
4927        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
4928            (*self.0.stub)
4929                .list_operations(self.0.request, self.0.options)
4930                .await
4931                .map(gax::response::Response::into_body)
4932        }
4933
4934        /// Streams each page in the collection.
4935        pub fn by_page(
4936            self,
4937        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
4938        {
4939            use std::clone::Clone;
4940            let token = self.0.request.page_token.clone();
4941            let execute = move |token: String| {
4942                let mut builder = self.clone();
4943                builder.0.request = builder.0.request.set_page_token(token);
4944                builder.send()
4945            };
4946            gax::paginator::internal::new_paginator(token, execute)
4947        }
4948
4949        /// Streams each item in the collection.
4950        pub fn by_item(
4951            self,
4952        ) -> impl gax::paginator::ItemPaginator<
4953            longrunning::model::ListOperationsResponse,
4954            gax::error::Error,
4955        > {
4956            use gax::paginator::Paginator;
4957            self.by_page().items()
4958        }
4959
4960        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
4961        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4962            self.0.request.name = v.into();
4963            self
4964        }
4965
4966        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
4967        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4968            self.0.request.filter = v.into();
4969            self
4970        }
4971
4972        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
4973        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4974            self.0.request.page_size = v.into();
4975            self
4976        }
4977
4978        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
4979        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4980            self.0.request.page_token = v.into();
4981            self
4982        }
4983    }
4984
4985    #[doc(hidden)]
4986    impl gax::options::internal::RequestBuilder for ListOperations {
4987        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4988            &mut self.0.options
4989        }
4990    }
4991
4992    /// The request builder for [DataTransferService::get_operation][crate::client::DataTransferService::get_operation] calls.
4993    ///
4994    /// # Example
4995    /// ```no_run
4996    /// # use google_cloud_networkconnectivity_v1::builder;
4997    /// use builder::data_transfer_service::GetOperation;
4998    /// # tokio_test::block_on(async {
4999    ///
5000    /// let builder = prepare_request_builder();
5001    /// let response = builder.send().await?;
5002    /// # gax::Result::<()>::Ok(()) });
5003    ///
5004    /// fn prepare_request_builder() -> GetOperation {
5005    ///   # panic!();
5006    ///   // ... details omitted ...
5007    /// }
5008    /// ```
5009    #[derive(Clone, Debug)]
5010    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
5011
5012    impl GetOperation {
5013        pub(crate) fn new(
5014            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
5015        ) -> Self {
5016            Self(RequestBuilder::new(stub))
5017        }
5018
5019        /// Sets the full request, replacing any prior values.
5020        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
5021            mut self,
5022            v: V,
5023        ) -> Self {
5024            self.0.request = v.into();
5025            self
5026        }
5027
5028        /// Sets all the options, replacing any prior values.
5029        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5030            self.0.options = v.into();
5031            self
5032        }
5033
5034        /// Sends the request.
5035        pub async fn send(self) -> Result<longrunning::model::Operation> {
5036            (*self.0.stub)
5037                .get_operation(self.0.request, self.0.options)
5038                .await
5039                .map(gax::response::Response::into_body)
5040        }
5041
5042        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
5043        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5044            self.0.request.name = v.into();
5045            self
5046        }
5047    }
5048
5049    #[doc(hidden)]
5050    impl gax::options::internal::RequestBuilder for GetOperation {
5051        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5052            &mut self.0.options
5053        }
5054    }
5055
5056    /// The request builder for [DataTransferService::delete_operation][crate::client::DataTransferService::delete_operation] calls.
5057    ///
5058    /// # Example
5059    /// ```no_run
5060    /// # use google_cloud_networkconnectivity_v1::builder;
5061    /// use builder::data_transfer_service::DeleteOperation;
5062    /// # tokio_test::block_on(async {
5063    ///
5064    /// let builder = prepare_request_builder();
5065    /// let response = builder.send().await?;
5066    /// # gax::Result::<()>::Ok(()) });
5067    ///
5068    /// fn prepare_request_builder() -> DeleteOperation {
5069    ///   # panic!();
5070    ///   // ... details omitted ...
5071    /// }
5072    /// ```
5073    #[derive(Clone, Debug)]
5074    pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
5075
5076    impl DeleteOperation {
5077        pub(crate) fn new(
5078            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
5079        ) -> Self {
5080            Self(RequestBuilder::new(stub))
5081        }
5082
5083        /// Sets the full request, replacing any prior values.
5084        pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
5085            mut self,
5086            v: V,
5087        ) -> Self {
5088            self.0.request = v.into();
5089            self
5090        }
5091
5092        /// Sets all the options, replacing any prior values.
5093        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5094            self.0.options = v.into();
5095            self
5096        }
5097
5098        /// Sends the request.
5099        pub async fn send(self) -> Result<()> {
5100            (*self.0.stub)
5101                .delete_operation(self.0.request, self.0.options)
5102                .await
5103                .map(gax::response::Response::into_body)
5104        }
5105
5106        /// Sets the value of [name][longrunning::model::DeleteOperationRequest::name].
5107        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5108            self.0.request.name = v.into();
5109            self
5110        }
5111    }
5112
5113    #[doc(hidden)]
5114    impl gax::options::internal::RequestBuilder for DeleteOperation {
5115        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5116            &mut self.0.options
5117        }
5118    }
5119
5120    /// The request builder for [DataTransferService::cancel_operation][crate::client::DataTransferService::cancel_operation] calls.
5121    ///
5122    /// # Example
5123    /// ```no_run
5124    /// # use google_cloud_networkconnectivity_v1::builder;
5125    /// use builder::data_transfer_service::CancelOperation;
5126    /// # tokio_test::block_on(async {
5127    ///
5128    /// let builder = prepare_request_builder();
5129    /// let response = builder.send().await?;
5130    /// # gax::Result::<()>::Ok(()) });
5131    ///
5132    /// fn prepare_request_builder() -> CancelOperation {
5133    ///   # panic!();
5134    ///   // ... details omitted ...
5135    /// }
5136    /// ```
5137    #[derive(Clone, Debug)]
5138    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
5139
5140    impl CancelOperation {
5141        pub(crate) fn new(
5142            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
5143        ) -> Self {
5144            Self(RequestBuilder::new(stub))
5145        }
5146
5147        /// Sets the full request, replacing any prior values.
5148        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
5149            mut self,
5150            v: V,
5151        ) -> Self {
5152            self.0.request = v.into();
5153            self
5154        }
5155
5156        /// Sets all the options, replacing any prior values.
5157        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5158            self.0.options = v.into();
5159            self
5160        }
5161
5162        /// Sends the request.
5163        pub async fn send(self) -> Result<()> {
5164            (*self.0.stub)
5165                .cancel_operation(self.0.request, self.0.options)
5166                .await
5167                .map(gax::response::Response::into_body)
5168        }
5169
5170        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
5171        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5172            self.0.request.name = v.into();
5173            self
5174        }
5175    }
5176
5177    #[doc(hidden)]
5178    impl gax::options::internal::RequestBuilder for CancelOperation {
5179        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5180            &mut self.0.options
5181        }
5182    }
5183}
5184
5185pub mod hub_service {
5186    use crate::Result;
5187
5188    /// A builder for [HubService][crate::client::HubService].
5189    ///
5190    /// ```
5191    /// # tokio_test::block_on(async {
5192    /// # use google_cloud_networkconnectivity_v1::*;
5193    /// # use builder::hub_service::ClientBuilder;
5194    /// # use client::HubService;
5195    /// let builder : ClientBuilder = HubService::builder();
5196    /// let client = builder
5197    ///     .with_endpoint("https://networkconnectivity.googleapis.com")
5198    ///     .build().await?;
5199    /// # gax::client_builder::Result::<()>::Ok(()) });
5200    /// ```
5201    pub type ClientBuilder =
5202        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
5203
5204    pub(crate) mod client {
5205        use super::super::super::client::HubService;
5206        pub struct Factory;
5207        impl gax::client_builder::internal::ClientFactory for Factory {
5208            type Client = HubService;
5209            type Credentials = gaxi::options::Credentials;
5210            async fn build(
5211                self,
5212                config: gaxi::options::ClientConfig,
5213            ) -> gax::client_builder::Result<Self::Client> {
5214                Self::Client::new(config).await
5215            }
5216        }
5217    }
5218
5219    /// Common implementation for [crate::client::HubService] request builders.
5220    #[derive(Clone, Debug)]
5221    pub(crate) struct RequestBuilder<R: std::default::Default> {
5222        stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5223        request: R,
5224        options: gax::options::RequestOptions,
5225    }
5226
5227    impl<R> RequestBuilder<R>
5228    where
5229        R: std::default::Default,
5230    {
5231        pub(crate) fn new(
5232            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5233        ) -> Self {
5234            Self {
5235                stub,
5236                request: R::default(),
5237                options: gax::options::RequestOptions::default(),
5238            }
5239        }
5240    }
5241
5242    /// The request builder for [HubService::list_hubs][crate::client::HubService::list_hubs] calls.
5243    ///
5244    /// # Example
5245    /// ```no_run
5246    /// # use google_cloud_networkconnectivity_v1::builder;
5247    /// use builder::hub_service::ListHubs;
5248    /// # tokio_test::block_on(async {
5249    /// use gax::paginator::ItemPaginator;
5250    ///
5251    /// let builder = prepare_request_builder();
5252    /// let mut items = builder.by_item();
5253    /// while let Some(result) = items.next().await {
5254    ///   let item = result?;
5255    /// }
5256    /// # gax::Result::<()>::Ok(()) });
5257    ///
5258    /// fn prepare_request_builder() -> ListHubs {
5259    ///   # panic!();
5260    ///   // ... details omitted ...
5261    /// }
5262    /// ```
5263    #[derive(Clone, Debug)]
5264    pub struct ListHubs(RequestBuilder<crate::model::ListHubsRequest>);
5265
5266    impl ListHubs {
5267        pub(crate) fn new(
5268            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5269        ) -> Self {
5270            Self(RequestBuilder::new(stub))
5271        }
5272
5273        /// Sets the full request, replacing any prior values.
5274        pub fn with_request<V: Into<crate::model::ListHubsRequest>>(mut self, v: V) -> Self {
5275            self.0.request = v.into();
5276            self
5277        }
5278
5279        /// Sets all the options, replacing any prior values.
5280        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5281            self.0.options = v.into();
5282            self
5283        }
5284
5285        /// Sends the request.
5286        pub async fn send(self) -> Result<crate::model::ListHubsResponse> {
5287            (*self.0.stub)
5288                .list_hubs(self.0.request, self.0.options)
5289                .await
5290                .map(gax::response::Response::into_body)
5291        }
5292
5293        /// Streams each page in the collection.
5294        pub fn by_page(
5295            self,
5296        ) -> impl gax::paginator::Paginator<crate::model::ListHubsResponse, gax::error::Error>
5297        {
5298            use std::clone::Clone;
5299            let token = self.0.request.page_token.clone();
5300            let execute = move |token: String| {
5301                let mut builder = self.clone();
5302                builder.0.request = builder.0.request.set_page_token(token);
5303                builder.send()
5304            };
5305            gax::paginator::internal::new_paginator(token, execute)
5306        }
5307
5308        /// Streams each item in the collection.
5309        pub fn by_item(
5310            self,
5311        ) -> impl gax::paginator::ItemPaginator<crate::model::ListHubsResponse, gax::error::Error>
5312        {
5313            use gax::paginator::Paginator;
5314            self.by_page().items()
5315        }
5316
5317        /// Sets the value of [parent][crate::model::ListHubsRequest::parent].
5318        ///
5319        /// This is a **required** field for requests.
5320        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5321            self.0.request.parent = v.into();
5322            self
5323        }
5324
5325        /// Sets the value of [page_size][crate::model::ListHubsRequest::page_size].
5326        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5327            self.0.request.page_size = v.into();
5328            self
5329        }
5330
5331        /// Sets the value of [page_token][crate::model::ListHubsRequest::page_token].
5332        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5333            self.0.request.page_token = v.into();
5334            self
5335        }
5336
5337        /// Sets the value of [filter][crate::model::ListHubsRequest::filter].
5338        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5339            self.0.request.filter = v.into();
5340            self
5341        }
5342
5343        /// Sets the value of [order_by][crate::model::ListHubsRequest::order_by].
5344        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
5345            self.0.request.order_by = v.into();
5346            self
5347        }
5348    }
5349
5350    #[doc(hidden)]
5351    impl gax::options::internal::RequestBuilder for ListHubs {
5352        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5353            &mut self.0.options
5354        }
5355    }
5356
5357    /// The request builder for [HubService::get_hub][crate::client::HubService::get_hub] calls.
5358    ///
5359    /// # Example
5360    /// ```no_run
5361    /// # use google_cloud_networkconnectivity_v1::builder;
5362    /// use builder::hub_service::GetHub;
5363    /// # tokio_test::block_on(async {
5364    ///
5365    /// let builder = prepare_request_builder();
5366    /// let response = builder.send().await?;
5367    /// # gax::Result::<()>::Ok(()) });
5368    ///
5369    /// fn prepare_request_builder() -> GetHub {
5370    ///   # panic!();
5371    ///   // ... details omitted ...
5372    /// }
5373    /// ```
5374    #[derive(Clone, Debug)]
5375    pub struct GetHub(RequestBuilder<crate::model::GetHubRequest>);
5376
5377    impl GetHub {
5378        pub(crate) fn new(
5379            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5380        ) -> Self {
5381            Self(RequestBuilder::new(stub))
5382        }
5383
5384        /// Sets the full request, replacing any prior values.
5385        pub fn with_request<V: Into<crate::model::GetHubRequest>>(mut self, v: V) -> Self {
5386            self.0.request = v.into();
5387            self
5388        }
5389
5390        /// Sets all the options, replacing any prior values.
5391        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5392            self.0.options = v.into();
5393            self
5394        }
5395
5396        /// Sends the request.
5397        pub async fn send(self) -> Result<crate::model::Hub> {
5398            (*self.0.stub)
5399                .get_hub(self.0.request, self.0.options)
5400                .await
5401                .map(gax::response::Response::into_body)
5402        }
5403
5404        /// Sets the value of [name][crate::model::GetHubRequest::name].
5405        ///
5406        /// This is a **required** field for requests.
5407        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5408            self.0.request.name = v.into();
5409            self
5410        }
5411    }
5412
5413    #[doc(hidden)]
5414    impl gax::options::internal::RequestBuilder for GetHub {
5415        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5416            &mut self.0.options
5417        }
5418    }
5419
5420    /// The request builder for [HubService::create_hub][crate::client::HubService::create_hub] calls.
5421    ///
5422    /// # Example
5423    /// ```no_run
5424    /// # use google_cloud_networkconnectivity_v1::builder;
5425    /// use builder::hub_service::CreateHub;
5426    /// # tokio_test::block_on(async {
5427    /// use lro::Poller;
5428    ///
5429    /// let builder = prepare_request_builder();
5430    /// let response = builder.poller().until_done().await?;
5431    /// # gax::Result::<()>::Ok(()) });
5432    ///
5433    /// fn prepare_request_builder() -> CreateHub {
5434    ///   # panic!();
5435    ///   // ... details omitted ...
5436    /// }
5437    /// ```
5438    #[derive(Clone, Debug)]
5439    pub struct CreateHub(RequestBuilder<crate::model::CreateHubRequest>);
5440
5441    impl CreateHub {
5442        pub(crate) fn new(
5443            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5444        ) -> Self {
5445            Self(RequestBuilder::new(stub))
5446        }
5447
5448        /// Sets the full request, replacing any prior values.
5449        pub fn with_request<V: Into<crate::model::CreateHubRequest>>(mut self, v: V) -> Self {
5450            self.0.request = v.into();
5451            self
5452        }
5453
5454        /// Sets all the options, replacing any prior values.
5455        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5456            self.0.options = v.into();
5457            self
5458        }
5459
5460        /// Sends the request.
5461        ///
5462        /// # Long running operations
5463        ///
5464        /// This starts, but does not poll, a longrunning operation. More information
5465        /// on [create_hub][crate::client::HubService::create_hub].
5466        pub async fn send(self) -> Result<longrunning::model::Operation> {
5467            (*self.0.stub)
5468                .create_hub(self.0.request, self.0.options)
5469                .await
5470                .map(gax::response::Response::into_body)
5471        }
5472
5473        /// Creates a [Poller][lro::Poller] to work with `create_hub`.
5474        pub fn poller(
5475            self,
5476        ) -> impl lro::Poller<crate::model::Hub, crate::model::OperationMetadata> {
5477            type Operation =
5478                lro::internal::Operation<crate::model::Hub, crate::model::OperationMetadata>;
5479            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5480            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5481
5482            let stub = self.0.stub.clone();
5483            let mut options = self.0.options.clone();
5484            options.set_retry_policy(gax::retry_policy::NeverRetry);
5485            let query = move |name| {
5486                let stub = stub.clone();
5487                let options = options.clone();
5488                async {
5489                    let op = GetOperation::new(stub)
5490                        .set_name(name)
5491                        .with_options(options)
5492                        .send()
5493                        .await?;
5494                    Ok(Operation::new(op))
5495                }
5496            };
5497
5498            let start = move || async {
5499                let op = self.send().await?;
5500                Ok(Operation::new(op))
5501            };
5502
5503            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
5504        }
5505
5506        /// Sets the value of [parent][crate::model::CreateHubRequest::parent].
5507        ///
5508        /// This is a **required** field for requests.
5509        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5510            self.0.request.parent = v.into();
5511            self
5512        }
5513
5514        /// Sets the value of [hub_id][crate::model::CreateHubRequest::hub_id].
5515        ///
5516        /// This is a **required** field for requests.
5517        pub fn set_hub_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5518            self.0.request.hub_id = v.into();
5519            self
5520        }
5521
5522        /// Sets the value of [hub][crate::model::CreateHubRequest::hub].
5523        ///
5524        /// This is a **required** field for requests.
5525        pub fn set_hub<T>(mut self, v: T) -> Self
5526        where
5527            T: std::convert::Into<crate::model::Hub>,
5528        {
5529            self.0.request.hub = std::option::Option::Some(v.into());
5530            self
5531        }
5532
5533        /// Sets or clears the value of [hub][crate::model::CreateHubRequest::hub].
5534        ///
5535        /// This is a **required** field for requests.
5536        pub fn set_or_clear_hub<T>(mut self, v: std::option::Option<T>) -> Self
5537        where
5538            T: std::convert::Into<crate::model::Hub>,
5539        {
5540            self.0.request.hub = v.map(|x| x.into());
5541            self
5542        }
5543
5544        /// Sets the value of [request_id][crate::model::CreateHubRequest::request_id].
5545        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5546            self.0.request.request_id = v.into();
5547            self
5548        }
5549    }
5550
5551    #[doc(hidden)]
5552    impl gax::options::internal::RequestBuilder for CreateHub {
5553        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5554            &mut self.0.options
5555        }
5556    }
5557
5558    /// The request builder for [HubService::update_hub][crate::client::HubService::update_hub] calls.
5559    ///
5560    /// # Example
5561    /// ```no_run
5562    /// # use google_cloud_networkconnectivity_v1::builder;
5563    /// use builder::hub_service::UpdateHub;
5564    /// # tokio_test::block_on(async {
5565    /// use lro::Poller;
5566    ///
5567    /// let builder = prepare_request_builder();
5568    /// let response = builder.poller().until_done().await?;
5569    /// # gax::Result::<()>::Ok(()) });
5570    ///
5571    /// fn prepare_request_builder() -> UpdateHub {
5572    ///   # panic!();
5573    ///   // ... details omitted ...
5574    /// }
5575    /// ```
5576    #[derive(Clone, Debug)]
5577    pub struct UpdateHub(RequestBuilder<crate::model::UpdateHubRequest>);
5578
5579    impl UpdateHub {
5580        pub(crate) fn new(
5581            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5582        ) -> Self {
5583            Self(RequestBuilder::new(stub))
5584        }
5585
5586        /// Sets the full request, replacing any prior values.
5587        pub fn with_request<V: Into<crate::model::UpdateHubRequest>>(mut self, v: V) -> Self {
5588            self.0.request = v.into();
5589            self
5590        }
5591
5592        /// Sets all the options, replacing any prior values.
5593        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5594            self.0.options = v.into();
5595            self
5596        }
5597
5598        /// Sends the request.
5599        ///
5600        /// # Long running operations
5601        ///
5602        /// This starts, but does not poll, a longrunning operation. More information
5603        /// on [update_hub][crate::client::HubService::update_hub].
5604        pub async fn send(self) -> Result<longrunning::model::Operation> {
5605            (*self.0.stub)
5606                .update_hub(self.0.request, self.0.options)
5607                .await
5608                .map(gax::response::Response::into_body)
5609        }
5610
5611        /// Creates a [Poller][lro::Poller] to work with `update_hub`.
5612        pub fn poller(
5613            self,
5614        ) -> impl lro::Poller<crate::model::Hub, crate::model::OperationMetadata> {
5615            type Operation =
5616                lro::internal::Operation<crate::model::Hub, crate::model::OperationMetadata>;
5617            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5618            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5619
5620            let stub = self.0.stub.clone();
5621            let mut options = self.0.options.clone();
5622            options.set_retry_policy(gax::retry_policy::NeverRetry);
5623            let query = move |name| {
5624                let stub = stub.clone();
5625                let options = options.clone();
5626                async {
5627                    let op = GetOperation::new(stub)
5628                        .set_name(name)
5629                        .with_options(options)
5630                        .send()
5631                        .await?;
5632                    Ok(Operation::new(op))
5633                }
5634            };
5635
5636            let start = move || async {
5637                let op = self.send().await?;
5638                Ok(Operation::new(op))
5639            };
5640
5641            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
5642        }
5643
5644        /// Sets the value of [update_mask][crate::model::UpdateHubRequest::update_mask].
5645        pub fn set_update_mask<T>(mut self, v: T) -> Self
5646        where
5647            T: std::convert::Into<wkt::FieldMask>,
5648        {
5649            self.0.request.update_mask = std::option::Option::Some(v.into());
5650            self
5651        }
5652
5653        /// Sets or clears the value of [update_mask][crate::model::UpdateHubRequest::update_mask].
5654        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5655        where
5656            T: std::convert::Into<wkt::FieldMask>,
5657        {
5658            self.0.request.update_mask = v.map(|x| x.into());
5659            self
5660        }
5661
5662        /// Sets the value of [hub][crate::model::UpdateHubRequest::hub].
5663        ///
5664        /// This is a **required** field for requests.
5665        pub fn set_hub<T>(mut self, v: T) -> Self
5666        where
5667            T: std::convert::Into<crate::model::Hub>,
5668        {
5669            self.0.request.hub = std::option::Option::Some(v.into());
5670            self
5671        }
5672
5673        /// Sets or clears the value of [hub][crate::model::UpdateHubRequest::hub].
5674        ///
5675        /// This is a **required** field for requests.
5676        pub fn set_or_clear_hub<T>(mut self, v: std::option::Option<T>) -> Self
5677        where
5678            T: std::convert::Into<crate::model::Hub>,
5679        {
5680            self.0.request.hub = v.map(|x| x.into());
5681            self
5682        }
5683
5684        /// Sets the value of [request_id][crate::model::UpdateHubRequest::request_id].
5685        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5686            self.0.request.request_id = v.into();
5687            self
5688        }
5689    }
5690
5691    #[doc(hidden)]
5692    impl gax::options::internal::RequestBuilder for UpdateHub {
5693        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5694            &mut self.0.options
5695        }
5696    }
5697
5698    /// The request builder for [HubService::delete_hub][crate::client::HubService::delete_hub] calls.
5699    ///
5700    /// # Example
5701    /// ```no_run
5702    /// # use google_cloud_networkconnectivity_v1::builder;
5703    /// use builder::hub_service::DeleteHub;
5704    /// # tokio_test::block_on(async {
5705    /// use lro::Poller;
5706    ///
5707    /// let builder = prepare_request_builder();
5708    /// let response = builder.poller().until_done().await?;
5709    /// # gax::Result::<()>::Ok(()) });
5710    ///
5711    /// fn prepare_request_builder() -> DeleteHub {
5712    ///   # panic!();
5713    ///   // ... details omitted ...
5714    /// }
5715    /// ```
5716    #[derive(Clone, Debug)]
5717    pub struct DeleteHub(RequestBuilder<crate::model::DeleteHubRequest>);
5718
5719    impl DeleteHub {
5720        pub(crate) fn new(
5721            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5722        ) -> Self {
5723            Self(RequestBuilder::new(stub))
5724        }
5725
5726        /// Sets the full request, replacing any prior values.
5727        pub fn with_request<V: Into<crate::model::DeleteHubRequest>>(mut self, v: V) -> Self {
5728            self.0.request = v.into();
5729            self
5730        }
5731
5732        /// Sets all the options, replacing any prior values.
5733        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5734            self.0.options = v.into();
5735            self
5736        }
5737
5738        /// Sends the request.
5739        ///
5740        /// # Long running operations
5741        ///
5742        /// This starts, but does not poll, a longrunning operation. More information
5743        /// on [delete_hub][crate::client::HubService::delete_hub].
5744        pub async fn send(self) -> Result<longrunning::model::Operation> {
5745            (*self.0.stub)
5746                .delete_hub(self.0.request, self.0.options)
5747                .await
5748                .map(gax::response::Response::into_body)
5749        }
5750
5751        /// Creates a [Poller][lro::Poller] to work with `delete_hub`.
5752        pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
5753            type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
5754            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5755            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5756
5757            let stub = self.0.stub.clone();
5758            let mut options = self.0.options.clone();
5759            options.set_retry_policy(gax::retry_policy::NeverRetry);
5760            let query = move |name| {
5761                let stub = stub.clone();
5762                let options = options.clone();
5763                async {
5764                    let op = GetOperation::new(stub)
5765                        .set_name(name)
5766                        .with_options(options)
5767                        .send()
5768                        .await?;
5769                    Ok(Operation::new(op))
5770                }
5771            };
5772
5773            let start = move || async {
5774                let op = self.send().await?;
5775                Ok(Operation::new(op))
5776            };
5777
5778            lro::internal::new_unit_response_poller(
5779                polling_error_policy,
5780                polling_backoff_policy,
5781                start,
5782                query,
5783            )
5784        }
5785
5786        /// Sets the value of [name][crate::model::DeleteHubRequest::name].
5787        ///
5788        /// This is a **required** field for requests.
5789        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5790            self.0.request.name = v.into();
5791            self
5792        }
5793
5794        /// Sets the value of [request_id][crate::model::DeleteHubRequest::request_id].
5795        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5796            self.0.request.request_id = v.into();
5797            self
5798        }
5799    }
5800
5801    #[doc(hidden)]
5802    impl gax::options::internal::RequestBuilder for DeleteHub {
5803        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5804            &mut self.0.options
5805        }
5806    }
5807
5808    /// The request builder for [HubService::list_hub_spokes][crate::client::HubService::list_hub_spokes] calls.
5809    ///
5810    /// # Example
5811    /// ```no_run
5812    /// # use google_cloud_networkconnectivity_v1::builder;
5813    /// use builder::hub_service::ListHubSpokes;
5814    /// # tokio_test::block_on(async {
5815    /// use gax::paginator::ItemPaginator;
5816    ///
5817    /// let builder = prepare_request_builder();
5818    /// let mut items = builder.by_item();
5819    /// while let Some(result) = items.next().await {
5820    ///   let item = result?;
5821    /// }
5822    /// # gax::Result::<()>::Ok(()) });
5823    ///
5824    /// fn prepare_request_builder() -> ListHubSpokes {
5825    ///   # panic!();
5826    ///   // ... details omitted ...
5827    /// }
5828    /// ```
5829    #[derive(Clone, Debug)]
5830    pub struct ListHubSpokes(RequestBuilder<crate::model::ListHubSpokesRequest>);
5831
5832    impl ListHubSpokes {
5833        pub(crate) fn new(
5834            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5835        ) -> Self {
5836            Self(RequestBuilder::new(stub))
5837        }
5838
5839        /// Sets the full request, replacing any prior values.
5840        pub fn with_request<V: Into<crate::model::ListHubSpokesRequest>>(mut self, v: V) -> Self {
5841            self.0.request = v.into();
5842            self
5843        }
5844
5845        /// Sets all the options, replacing any prior values.
5846        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5847            self.0.options = v.into();
5848            self
5849        }
5850
5851        /// Sends the request.
5852        pub async fn send(self) -> Result<crate::model::ListHubSpokesResponse> {
5853            (*self.0.stub)
5854                .list_hub_spokes(self.0.request, self.0.options)
5855                .await
5856                .map(gax::response::Response::into_body)
5857        }
5858
5859        /// Streams each page in the collection.
5860        pub fn by_page(
5861            self,
5862        ) -> impl gax::paginator::Paginator<crate::model::ListHubSpokesResponse, gax::error::Error>
5863        {
5864            use std::clone::Clone;
5865            let token = self.0.request.page_token.clone();
5866            let execute = move |token: String| {
5867                let mut builder = self.clone();
5868                builder.0.request = builder.0.request.set_page_token(token);
5869                builder.send()
5870            };
5871            gax::paginator::internal::new_paginator(token, execute)
5872        }
5873
5874        /// Streams each item in the collection.
5875        pub fn by_item(
5876            self,
5877        ) -> impl gax::paginator::ItemPaginator<crate::model::ListHubSpokesResponse, gax::error::Error>
5878        {
5879            use gax::paginator::Paginator;
5880            self.by_page().items()
5881        }
5882
5883        /// Sets the value of [name][crate::model::ListHubSpokesRequest::name].
5884        ///
5885        /// This is a **required** field for requests.
5886        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5887            self.0.request.name = v.into();
5888            self
5889        }
5890
5891        /// Sets the value of [spoke_locations][crate::model::ListHubSpokesRequest::spoke_locations].
5892        pub fn set_spoke_locations<T, V>(mut self, v: T) -> Self
5893        where
5894            T: std::iter::IntoIterator<Item = V>,
5895            V: std::convert::Into<std::string::String>,
5896        {
5897            use std::iter::Iterator;
5898            self.0.request.spoke_locations = v.into_iter().map(|i| i.into()).collect();
5899            self
5900        }
5901
5902        /// Sets the value of [page_size][crate::model::ListHubSpokesRequest::page_size].
5903        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5904            self.0.request.page_size = v.into();
5905            self
5906        }
5907
5908        /// Sets the value of [page_token][crate::model::ListHubSpokesRequest::page_token].
5909        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5910            self.0.request.page_token = v.into();
5911            self
5912        }
5913
5914        /// Sets the value of [filter][crate::model::ListHubSpokesRequest::filter].
5915        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5916            self.0.request.filter = v.into();
5917            self
5918        }
5919
5920        /// Sets the value of [order_by][crate::model::ListHubSpokesRequest::order_by].
5921        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
5922            self.0.request.order_by = v.into();
5923            self
5924        }
5925
5926        /// Sets the value of [view][crate::model::ListHubSpokesRequest::view].
5927        pub fn set_view<T: Into<crate::model::list_hub_spokes_request::SpokeView>>(
5928            mut self,
5929            v: T,
5930        ) -> Self {
5931            self.0.request.view = v.into();
5932            self
5933        }
5934    }
5935
5936    #[doc(hidden)]
5937    impl gax::options::internal::RequestBuilder for ListHubSpokes {
5938        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5939            &mut self.0.options
5940        }
5941    }
5942
5943    /// The request builder for [HubService::query_hub_status][crate::client::HubService::query_hub_status] calls.
5944    ///
5945    /// # Example
5946    /// ```no_run
5947    /// # use google_cloud_networkconnectivity_v1::builder;
5948    /// use builder::hub_service::QueryHubStatus;
5949    /// # tokio_test::block_on(async {
5950    /// use gax::paginator::ItemPaginator;
5951    ///
5952    /// let builder = prepare_request_builder();
5953    /// let mut items = builder.by_item();
5954    /// while let Some(result) = items.next().await {
5955    ///   let item = result?;
5956    /// }
5957    /// # gax::Result::<()>::Ok(()) });
5958    ///
5959    /// fn prepare_request_builder() -> QueryHubStatus {
5960    ///   # panic!();
5961    ///   // ... details omitted ...
5962    /// }
5963    /// ```
5964    #[derive(Clone, Debug)]
5965    pub struct QueryHubStatus(RequestBuilder<crate::model::QueryHubStatusRequest>);
5966
5967    impl QueryHubStatus {
5968        pub(crate) fn new(
5969            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5970        ) -> Self {
5971            Self(RequestBuilder::new(stub))
5972        }
5973
5974        /// Sets the full request, replacing any prior values.
5975        pub fn with_request<V: Into<crate::model::QueryHubStatusRequest>>(mut self, v: V) -> Self {
5976            self.0.request = v.into();
5977            self
5978        }
5979
5980        /// Sets all the options, replacing any prior values.
5981        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5982            self.0.options = v.into();
5983            self
5984        }
5985
5986        /// Sends the request.
5987        pub async fn send(self) -> Result<crate::model::QueryHubStatusResponse> {
5988            (*self.0.stub)
5989                .query_hub_status(self.0.request, self.0.options)
5990                .await
5991                .map(gax::response::Response::into_body)
5992        }
5993
5994        /// Streams each page in the collection.
5995        pub fn by_page(
5996            self,
5997        ) -> impl gax::paginator::Paginator<crate::model::QueryHubStatusResponse, gax::error::Error>
5998        {
5999            use std::clone::Clone;
6000            let token = self.0.request.page_token.clone();
6001            let execute = move |token: String| {
6002                let mut builder = self.clone();
6003                builder.0.request = builder.0.request.set_page_token(token);
6004                builder.send()
6005            };
6006            gax::paginator::internal::new_paginator(token, execute)
6007        }
6008
6009        /// Streams each item in the collection.
6010        pub fn by_item(
6011            self,
6012        ) -> impl gax::paginator::ItemPaginator<crate::model::QueryHubStatusResponse, gax::error::Error>
6013        {
6014            use gax::paginator::Paginator;
6015            self.by_page().items()
6016        }
6017
6018        /// Sets the value of [name][crate::model::QueryHubStatusRequest::name].
6019        ///
6020        /// This is a **required** field for requests.
6021        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6022            self.0.request.name = v.into();
6023            self
6024        }
6025
6026        /// Sets the value of [page_size][crate::model::QueryHubStatusRequest::page_size].
6027        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6028            self.0.request.page_size = v.into();
6029            self
6030        }
6031
6032        /// Sets the value of [page_token][crate::model::QueryHubStatusRequest::page_token].
6033        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6034            self.0.request.page_token = v.into();
6035            self
6036        }
6037
6038        /// Sets the value of [filter][crate::model::QueryHubStatusRequest::filter].
6039        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6040            self.0.request.filter = v.into();
6041            self
6042        }
6043
6044        /// Sets the value of [order_by][crate::model::QueryHubStatusRequest::order_by].
6045        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
6046            self.0.request.order_by = v.into();
6047            self
6048        }
6049
6050        /// Sets the value of [group_by][crate::model::QueryHubStatusRequest::group_by].
6051        pub fn set_group_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
6052            self.0.request.group_by = v.into();
6053            self
6054        }
6055    }
6056
6057    #[doc(hidden)]
6058    impl gax::options::internal::RequestBuilder for QueryHubStatus {
6059        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6060            &mut self.0.options
6061        }
6062    }
6063
6064    /// The request builder for [HubService::list_spokes][crate::client::HubService::list_spokes] calls.
6065    ///
6066    /// # Example
6067    /// ```no_run
6068    /// # use google_cloud_networkconnectivity_v1::builder;
6069    /// use builder::hub_service::ListSpokes;
6070    /// # tokio_test::block_on(async {
6071    /// use gax::paginator::ItemPaginator;
6072    ///
6073    /// let builder = prepare_request_builder();
6074    /// let mut items = builder.by_item();
6075    /// while let Some(result) = items.next().await {
6076    ///   let item = result?;
6077    /// }
6078    /// # gax::Result::<()>::Ok(()) });
6079    ///
6080    /// fn prepare_request_builder() -> ListSpokes {
6081    ///   # panic!();
6082    ///   // ... details omitted ...
6083    /// }
6084    /// ```
6085    #[derive(Clone, Debug)]
6086    pub struct ListSpokes(RequestBuilder<crate::model::ListSpokesRequest>);
6087
6088    impl ListSpokes {
6089        pub(crate) fn new(
6090            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6091        ) -> Self {
6092            Self(RequestBuilder::new(stub))
6093        }
6094
6095        /// Sets the full request, replacing any prior values.
6096        pub fn with_request<V: Into<crate::model::ListSpokesRequest>>(mut self, v: V) -> Self {
6097            self.0.request = v.into();
6098            self
6099        }
6100
6101        /// Sets all the options, replacing any prior values.
6102        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6103            self.0.options = v.into();
6104            self
6105        }
6106
6107        /// Sends the request.
6108        pub async fn send(self) -> Result<crate::model::ListSpokesResponse> {
6109            (*self.0.stub)
6110                .list_spokes(self.0.request, self.0.options)
6111                .await
6112                .map(gax::response::Response::into_body)
6113        }
6114
6115        /// Streams each page in the collection.
6116        pub fn by_page(
6117            self,
6118        ) -> impl gax::paginator::Paginator<crate::model::ListSpokesResponse, gax::error::Error>
6119        {
6120            use std::clone::Clone;
6121            let token = self.0.request.page_token.clone();
6122            let execute = move |token: String| {
6123                let mut builder = self.clone();
6124                builder.0.request = builder.0.request.set_page_token(token);
6125                builder.send()
6126            };
6127            gax::paginator::internal::new_paginator(token, execute)
6128        }
6129
6130        /// Streams each item in the collection.
6131        pub fn by_item(
6132            self,
6133        ) -> impl gax::paginator::ItemPaginator<crate::model::ListSpokesResponse, gax::error::Error>
6134        {
6135            use gax::paginator::Paginator;
6136            self.by_page().items()
6137        }
6138
6139        /// Sets the value of [parent][crate::model::ListSpokesRequest::parent].
6140        ///
6141        /// This is a **required** field for requests.
6142        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6143            self.0.request.parent = v.into();
6144            self
6145        }
6146
6147        /// Sets the value of [page_size][crate::model::ListSpokesRequest::page_size].
6148        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6149            self.0.request.page_size = v.into();
6150            self
6151        }
6152
6153        /// Sets the value of [page_token][crate::model::ListSpokesRequest::page_token].
6154        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6155            self.0.request.page_token = v.into();
6156            self
6157        }
6158
6159        /// Sets the value of [filter][crate::model::ListSpokesRequest::filter].
6160        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6161            self.0.request.filter = v.into();
6162            self
6163        }
6164
6165        /// Sets the value of [order_by][crate::model::ListSpokesRequest::order_by].
6166        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
6167            self.0.request.order_by = v.into();
6168            self
6169        }
6170    }
6171
6172    #[doc(hidden)]
6173    impl gax::options::internal::RequestBuilder for ListSpokes {
6174        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6175            &mut self.0.options
6176        }
6177    }
6178
6179    /// The request builder for [HubService::get_spoke][crate::client::HubService::get_spoke] calls.
6180    ///
6181    /// # Example
6182    /// ```no_run
6183    /// # use google_cloud_networkconnectivity_v1::builder;
6184    /// use builder::hub_service::GetSpoke;
6185    /// # tokio_test::block_on(async {
6186    ///
6187    /// let builder = prepare_request_builder();
6188    /// let response = builder.send().await?;
6189    /// # gax::Result::<()>::Ok(()) });
6190    ///
6191    /// fn prepare_request_builder() -> GetSpoke {
6192    ///   # panic!();
6193    ///   // ... details omitted ...
6194    /// }
6195    /// ```
6196    #[derive(Clone, Debug)]
6197    pub struct GetSpoke(RequestBuilder<crate::model::GetSpokeRequest>);
6198
6199    impl GetSpoke {
6200        pub(crate) fn new(
6201            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6202        ) -> Self {
6203            Self(RequestBuilder::new(stub))
6204        }
6205
6206        /// Sets the full request, replacing any prior values.
6207        pub fn with_request<V: Into<crate::model::GetSpokeRequest>>(mut self, v: V) -> Self {
6208            self.0.request = v.into();
6209            self
6210        }
6211
6212        /// Sets all the options, replacing any prior values.
6213        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6214            self.0.options = v.into();
6215            self
6216        }
6217
6218        /// Sends the request.
6219        pub async fn send(self) -> Result<crate::model::Spoke> {
6220            (*self.0.stub)
6221                .get_spoke(self.0.request, self.0.options)
6222                .await
6223                .map(gax::response::Response::into_body)
6224        }
6225
6226        /// Sets the value of [name][crate::model::GetSpokeRequest::name].
6227        ///
6228        /// This is a **required** field for requests.
6229        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6230            self.0.request.name = v.into();
6231            self
6232        }
6233    }
6234
6235    #[doc(hidden)]
6236    impl gax::options::internal::RequestBuilder for GetSpoke {
6237        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6238            &mut self.0.options
6239        }
6240    }
6241
6242    /// The request builder for [HubService::create_spoke][crate::client::HubService::create_spoke] calls.
6243    ///
6244    /// # Example
6245    /// ```no_run
6246    /// # use google_cloud_networkconnectivity_v1::builder;
6247    /// use builder::hub_service::CreateSpoke;
6248    /// # tokio_test::block_on(async {
6249    /// use lro::Poller;
6250    ///
6251    /// let builder = prepare_request_builder();
6252    /// let response = builder.poller().until_done().await?;
6253    /// # gax::Result::<()>::Ok(()) });
6254    ///
6255    /// fn prepare_request_builder() -> CreateSpoke {
6256    ///   # panic!();
6257    ///   // ... details omitted ...
6258    /// }
6259    /// ```
6260    #[derive(Clone, Debug)]
6261    pub struct CreateSpoke(RequestBuilder<crate::model::CreateSpokeRequest>);
6262
6263    impl CreateSpoke {
6264        pub(crate) fn new(
6265            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6266        ) -> Self {
6267            Self(RequestBuilder::new(stub))
6268        }
6269
6270        /// Sets the full request, replacing any prior values.
6271        pub fn with_request<V: Into<crate::model::CreateSpokeRequest>>(mut self, v: V) -> Self {
6272            self.0.request = v.into();
6273            self
6274        }
6275
6276        /// Sets all the options, replacing any prior values.
6277        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6278            self.0.options = v.into();
6279            self
6280        }
6281
6282        /// Sends the request.
6283        ///
6284        /// # Long running operations
6285        ///
6286        /// This starts, but does not poll, a longrunning operation. More information
6287        /// on [create_spoke][crate::client::HubService::create_spoke].
6288        pub async fn send(self) -> Result<longrunning::model::Operation> {
6289            (*self.0.stub)
6290                .create_spoke(self.0.request, self.0.options)
6291                .await
6292                .map(gax::response::Response::into_body)
6293        }
6294
6295        /// Creates a [Poller][lro::Poller] to work with `create_spoke`.
6296        pub fn poller(
6297            self,
6298        ) -> impl lro::Poller<crate::model::Spoke, crate::model::OperationMetadata> {
6299            type Operation =
6300                lro::internal::Operation<crate::model::Spoke, crate::model::OperationMetadata>;
6301            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6302            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6303
6304            let stub = self.0.stub.clone();
6305            let mut options = self.0.options.clone();
6306            options.set_retry_policy(gax::retry_policy::NeverRetry);
6307            let query = move |name| {
6308                let stub = stub.clone();
6309                let options = options.clone();
6310                async {
6311                    let op = GetOperation::new(stub)
6312                        .set_name(name)
6313                        .with_options(options)
6314                        .send()
6315                        .await?;
6316                    Ok(Operation::new(op))
6317                }
6318            };
6319
6320            let start = move || async {
6321                let op = self.send().await?;
6322                Ok(Operation::new(op))
6323            };
6324
6325            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
6326        }
6327
6328        /// Sets the value of [parent][crate::model::CreateSpokeRequest::parent].
6329        ///
6330        /// This is a **required** field for requests.
6331        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6332            self.0.request.parent = v.into();
6333            self
6334        }
6335
6336        /// Sets the value of [spoke_id][crate::model::CreateSpokeRequest::spoke_id].
6337        ///
6338        /// This is a **required** field for requests.
6339        pub fn set_spoke_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6340            self.0.request.spoke_id = v.into();
6341            self
6342        }
6343
6344        /// Sets the value of [spoke][crate::model::CreateSpokeRequest::spoke].
6345        ///
6346        /// This is a **required** field for requests.
6347        pub fn set_spoke<T>(mut self, v: T) -> Self
6348        where
6349            T: std::convert::Into<crate::model::Spoke>,
6350        {
6351            self.0.request.spoke = std::option::Option::Some(v.into());
6352            self
6353        }
6354
6355        /// Sets or clears the value of [spoke][crate::model::CreateSpokeRequest::spoke].
6356        ///
6357        /// This is a **required** field for requests.
6358        pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
6359        where
6360            T: std::convert::Into<crate::model::Spoke>,
6361        {
6362            self.0.request.spoke = v.map(|x| x.into());
6363            self
6364        }
6365
6366        /// Sets the value of [request_id][crate::model::CreateSpokeRequest::request_id].
6367        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6368            self.0.request.request_id = v.into();
6369            self
6370        }
6371    }
6372
6373    #[doc(hidden)]
6374    impl gax::options::internal::RequestBuilder for CreateSpoke {
6375        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6376            &mut self.0.options
6377        }
6378    }
6379
6380    /// The request builder for [HubService::update_spoke][crate::client::HubService::update_spoke] calls.
6381    ///
6382    /// # Example
6383    /// ```no_run
6384    /// # use google_cloud_networkconnectivity_v1::builder;
6385    /// use builder::hub_service::UpdateSpoke;
6386    /// # tokio_test::block_on(async {
6387    /// use lro::Poller;
6388    ///
6389    /// let builder = prepare_request_builder();
6390    /// let response = builder.poller().until_done().await?;
6391    /// # gax::Result::<()>::Ok(()) });
6392    ///
6393    /// fn prepare_request_builder() -> UpdateSpoke {
6394    ///   # panic!();
6395    ///   // ... details omitted ...
6396    /// }
6397    /// ```
6398    #[derive(Clone, Debug)]
6399    pub struct UpdateSpoke(RequestBuilder<crate::model::UpdateSpokeRequest>);
6400
6401    impl UpdateSpoke {
6402        pub(crate) fn new(
6403            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6404        ) -> Self {
6405            Self(RequestBuilder::new(stub))
6406        }
6407
6408        /// Sets the full request, replacing any prior values.
6409        pub fn with_request<V: Into<crate::model::UpdateSpokeRequest>>(mut self, v: V) -> Self {
6410            self.0.request = v.into();
6411            self
6412        }
6413
6414        /// Sets all the options, replacing any prior values.
6415        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6416            self.0.options = v.into();
6417            self
6418        }
6419
6420        /// Sends the request.
6421        ///
6422        /// # Long running operations
6423        ///
6424        /// This starts, but does not poll, a longrunning operation. More information
6425        /// on [update_spoke][crate::client::HubService::update_spoke].
6426        pub async fn send(self) -> Result<longrunning::model::Operation> {
6427            (*self.0.stub)
6428                .update_spoke(self.0.request, self.0.options)
6429                .await
6430                .map(gax::response::Response::into_body)
6431        }
6432
6433        /// Creates a [Poller][lro::Poller] to work with `update_spoke`.
6434        pub fn poller(
6435            self,
6436        ) -> impl lro::Poller<crate::model::Spoke, crate::model::OperationMetadata> {
6437            type Operation =
6438                lro::internal::Operation<crate::model::Spoke, crate::model::OperationMetadata>;
6439            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6440            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6441
6442            let stub = self.0.stub.clone();
6443            let mut options = self.0.options.clone();
6444            options.set_retry_policy(gax::retry_policy::NeverRetry);
6445            let query = move |name| {
6446                let stub = stub.clone();
6447                let options = options.clone();
6448                async {
6449                    let op = GetOperation::new(stub)
6450                        .set_name(name)
6451                        .with_options(options)
6452                        .send()
6453                        .await?;
6454                    Ok(Operation::new(op))
6455                }
6456            };
6457
6458            let start = move || async {
6459                let op = self.send().await?;
6460                Ok(Operation::new(op))
6461            };
6462
6463            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
6464        }
6465
6466        /// Sets the value of [update_mask][crate::model::UpdateSpokeRequest::update_mask].
6467        pub fn set_update_mask<T>(mut self, v: T) -> Self
6468        where
6469            T: std::convert::Into<wkt::FieldMask>,
6470        {
6471            self.0.request.update_mask = std::option::Option::Some(v.into());
6472            self
6473        }
6474
6475        /// Sets or clears the value of [update_mask][crate::model::UpdateSpokeRequest::update_mask].
6476        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6477        where
6478            T: std::convert::Into<wkt::FieldMask>,
6479        {
6480            self.0.request.update_mask = v.map(|x| x.into());
6481            self
6482        }
6483
6484        /// Sets the value of [spoke][crate::model::UpdateSpokeRequest::spoke].
6485        ///
6486        /// This is a **required** field for requests.
6487        pub fn set_spoke<T>(mut self, v: T) -> Self
6488        where
6489            T: std::convert::Into<crate::model::Spoke>,
6490        {
6491            self.0.request.spoke = std::option::Option::Some(v.into());
6492            self
6493        }
6494
6495        /// Sets or clears the value of [spoke][crate::model::UpdateSpokeRequest::spoke].
6496        ///
6497        /// This is a **required** field for requests.
6498        pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
6499        where
6500            T: std::convert::Into<crate::model::Spoke>,
6501        {
6502            self.0.request.spoke = v.map(|x| x.into());
6503            self
6504        }
6505
6506        /// Sets the value of [request_id][crate::model::UpdateSpokeRequest::request_id].
6507        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6508            self.0.request.request_id = v.into();
6509            self
6510        }
6511    }
6512
6513    #[doc(hidden)]
6514    impl gax::options::internal::RequestBuilder for UpdateSpoke {
6515        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6516            &mut self.0.options
6517        }
6518    }
6519
6520    /// The request builder for [HubService::reject_hub_spoke][crate::client::HubService::reject_hub_spoke] calls.
6521    ///
6522    /// # Example
6523    /// ```no_run
6524    /// # use google_cloud_networkconnectivity_v1::builder;
6525    /// use builder::hub_service::RejectHubSpoke;
6526    /// # tokio_test::block_on(async {
6527    /// use lro::Poller;
6528    ///
6529    /// let builder = prepare_request_builder();
6530    /// let response = builder.poller().until_done().await?;
6531    /// # gax::Result::<()>::Ok(()) });
6532    ///
6533    /// fn prepare_request_builder() -> RejectHubSpoke {
6534    ///   # panic!();
6535    ///   // ... details omitted ...
6536    /// }
6537    /// ```
6538    #[derive(Clone, Debug)]
6539    pub struct RejectHubSpoke(RequestBuilder<crate::model::RejectHubSpokeRequest>);
6540
6541    impl RejectHubSpoke {
6542        pub(crate) fn new(
6543            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6544        ) -> Self {
6545            Self(RequestBuilder::new(stub))
6546        }
6547
6548        /// Sets the full request, replacing any prior values.
6549        pub fn with_request<V: Into<crate::model::RejectHubSpokeRequest>>(mut self, v: V) -> Self {
6550            self.0.request = v.into();
6551            self
6552        }
6553
6554        /// Sets all the options, replacing any prior values.
6555        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6556            self.0.options = v.into();
6557            self
6558        }
6559
6560        /// Sends the request.
6561        ///
6562        /// # Long running operations
6563        ///
6564        /// This starts, but does not poll, a longrunning operation. More information
6565        /// on [reject_hub_spoke][crate::client::HubService::reject_hub_spoke].
6566        pub async fn send(self) -> Result<longrunning::model::Operation> {
6567            (*self.0.stub)
6568                .reject_hub_spoke(self.0.request, self.0.options)
6569                .await
6570                .map(gax::response::Response::into_body)
6571        }
6572
6573        /// Creates a [Poller][lro::Poller] to work with `reject_hub_spoke`.
6574        pub fn poller(
6575            self,
6576        ) -> impl lro::Poller<crate::model::RejectHubSpokeResponse, crate::model::OperationMetadata>
6577        {
6578            type Operation = lro::internal::Operation<
6579                crate::model::RejectHubSpokeResponse,
6580                crate::model::OperationMetadata,
6581            >;
6582            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6583            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6584
6585            let stub = self.0.stub.clone();
6586            let mut options = self.0.options.clone();
6587            options.set_retry_policy(gax::retry_policy::NeverRetry);
6588            let query = move |name| {
6589                let stub = stub.clone();
6590                let options = options.clone();
6591                async {
6592                    let op = GetOperation::new(stub)
6593                        .set_name(name)
6594                        .with_options(options)
6595                        .send()
6596                        .await?;
6597                    Ok(Operation::new(op))
6598                }
6599            };
6600
6601            let start = move || async {
6602                let op = self.send().await?;
6603                Ok(Operation::new(op))
6604            };
6605
6606            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
6607        }
6608
6609        /// Sets the value of [name][crate::model::RejectHubSpokeRequest::name].
6610        ///
6611        /// This is a **required** field for requests.
6612        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6613            self.0.request.name = v.into();
6614            self
6615        }
6616
6617        /// Sets the value of [spoke_uri][crate::model::RejectHubSpokeRequest::spoke_uri].
6618        ///
6619        /// This is a **required** field for requests.
6620        pub fn set_spoke_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
6621            self.0.request.spoke_uri = v.into();
6622            self
6623        }
6624
6625        /// Sets the value of [request_id][crate::model::RejectHubSpokeRequest::request_id].
6626        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6627            self.0.request.request_id = v.into();
6628            self
6629        }
6630
6631        /// Sets the value of [details][crate::model::RejectHubSpokeRequest::details].
6632        pub fn set_details<T: Into<std::string::String>>(mut self, v: T) -> Self {
6633            self.0.request.details = v.into();
6634            self
6635        }
6636    }
6637
6638    #[doc(hidden)]
6639    impl gax::options::internal::RequestBuilder for RejectHubSpoke {
6640        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6641            &mut self.0.options
6642        }
6643    }
6644
6645    /// The request builder for [HubService::accept_hub_spoke][crate::client::HubService::accept_hub_spoke] calls.
6646    ///
6647    /// # Example
6648    /// ```no_run
6649    /// # use google_cloud_networkconnectivity_v1::builder;
6650    /// use builder::hub_service::AcceptHubSpoke;
6651    /// # tokio_test::block_on(async {
6652    /// use lro::Poller;
6653    ///
6654    /// let builder = prepare_request_builder();
6655    /// let response = builder.poller().until_done().await?;
6656    /// # gax::Result::<()>::Ok(()) });
6657    ///
6658    /// fn prepare_request_builder() -> AcceptHubSpoke {
6659    ///   # panic!();
6660    ///   // ... details omitted ...
6661    /// }
6662    /// ```
6663    #[derive(Clone, Debug)]
6664    pub struct AcceptHubSpoke(RequestBuilder<crate::model::AcceptHubSpokeRequest>);
6665
6666    impl AcceptHubSpoke {
6667        pub(crate) fn new(
6668            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6669        ) -> Self {
6670            Self(RequestBuilder::new(stub))
6671        }
6672
6673        /// Sets the full request, replacing any prior values.
6674        pub fn with_request<V: Into<crate::model::AcceptHubSpokeRequest>>(mut self, v: V) -> Self {
6675            self.0.request = v.into();
6676            self
6677        }
6678
6679        /// Sets all the options, replacing any prior values.
6680        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6681            self.0.options = v.into();
6682            self
6683        }
6684
6685        /// Sends the request.
6686        ///
6687        /// # Long running operations
6688        ///
6689        /// This starts, but does not poll, a longrunning operation. More information
6690        /// on [accept_hub_spoke][crate::client::HubService::accept_hub_spoke].
6691        pub async fn send(self) -> Result<longrunning::model::Operation> {
6692            (*self.0.stub)
6693                .accept_hub_spoke(self.0.request, self.0.options)
6694                .await
6695                .map(gax::response::Response::into_body)
6696        }
6697
6698        /// Creates a [Poller][lro::Poller] to work with `accept_hub_spoke`.
6699        pub fn poller(
6700            self,
6701        ) -> impl lro::Poller<crate::model::AcceptHubSpokeResponse, crate::model::OperationMetadata>
6702        {
6703            type Operation = lro::internal::Operation<
6704                crate::model::AcceptHubSpokeResponse,
6705                crate::model::OperationMetadata,
6706            >;
6707            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6708            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6709
6710            let stub = self.0.stub.clone();
6711            let mut options = self.0.options.clone();
6712            options.set_retry_policy(gax::retry_policy::NeverRetry);
6713            let query = move |name| {
6714                let stub = stub.clone();
6715                let options = options.clone();
6716                async {
6717                    let op = GetOperation::new(stub)
6718                        .set_name(name)
6719                        .with_options(options)
6720                        .send()
6721                        .await?;
6722                    Ok(Operation::new(op))
6723                }
6724            };
6725
6726            let start = move || async {
6727                let op = self.send().await?;
6728                Ok(Operation::new(op))
6729            };
6730
6731            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
6732        }
6733
6734        /// Sets the value of [name][crate::model::AcceptHubSpokeRequest::name].
6735        ///
6736        /// This is a **required** field for requests.
6737        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6738            self.0.request.name = v.into();
6739            self
6740        }
6741
6742        /// Sets the value of [spoke_uri][crate::model::AcceptHubSpokeRequest::spoke_uri].
6743        ///
6744        /// This is a **required** field for requests.
6745        pub fn set_spoke_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
6746            self.0.request.spoke_uri = v.into();
6747            self
6748        }
6749
6750        /// Sets the value of [request_id][crate::model::AcceptHubSpokeRequest::request_id].
6751        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6752            self.0.request.request_id = v.into();
6753            self
6754        }
6755    }
6756
6757    #[doc(hidden)]
6758    impl gax::options::internal::RequestBuilder for AcceptHubSpoke {
6759        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6760            &mut self.0.options
6761        }
6762    }
6763
6764    /// The request builder for [HubService::accept_spoke_update][crate::client::HubService::accept_spoke_update] calls.
6765    ///
6766    /// # Example
6767    /// ```no_run
6768    /// # use google_cloud_networkconnectivity_v1::builder;
6769    /// use builder::hub_service::AcceptSpokeUpdate;
6770    /// # tokio_test::block_on(async {
6771    /// use lro::Poller;
6772    ///
6773    /// let builder = prepare_request_builder();
6774    /// let response = builder.poller().until_done().await?;
6775    /// # gax::Result::<()>::Ok(()) });
6776    ///
6777    /// fn prepare_request_builder() -> AcceptSpokeUpdate {
6778    ///   # panic!();
6779    ///   // ... details omitted ...
6780    /// }
6781    /// ```
6782    #[derive(Clone, Debug)]
6783    pub struct AcceptSpokeUpdate(RequestBuilder<crate::model::AcceptSpokeUpdateRequest>);
6784
6785    impl AcceptSpokeUpdate {
6786        pub(crate) fn new(
6787            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6788        ) -> Self {
6789            Self(RequestBuilder::new(stub))
6790        }
6791
6792        /// Sets the full request, replacing any prior values.
6793        pub fn with_request<V: Into<crate::model::AcceptSpokeUpdateRequest>>(
6794            mut self,
6795            v: V,
6796        ) -> Self {
6797            self.0.request = v.into();
6798            self
6799        }
6800
6801        /// Sets all the options, replacing any prior values.
6802        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6803            self.0.options = v.into();
6804            self
6805        }
6806
6807        /// Sends the request.
6808        ///
6809        /// # Long running operations
6810        ///
6811        /// This starts, but does not poll, a longrunning operation. More information
6812        /// on [accept_spoke_update][crate::client::HubService::accept_spoke_update].
6813        pub async fn send(self) -> Result<longrunning::model::Operation> {
6814            (*self.0.stub)
6815                .accept_spoke_update(self.0.request, self.0.options)
6816                .await
6817                .map(gax::response::Response::into_body)
6818        }
6819
6820        /// Creates a [Poller][lro::Poller] to work with `accept_spoke_update`.
6821        pub fn poller(
6822            self,
6823        ) -> impl lro::Poller<crate::model::AcceptSpokeUpdateResponse, crate::model::OperationMetadata>
6824        {
6825            type Operation = lro::internal::Operation<
6826                crate::model::AcceptSpokeUpdateResponse,
6827                crate::model::OperationMetadata,
6828            >;
6829            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6830            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6831
6832            let stub = self.0.stub.clone();
6833            let mut options = self.0.options.clone();
6834            options.set_retry_policy(gax::retry_policy::NeverRetry);
6835            let query = move |name| {
6836                let stub = stub.clone();
6837                let options = options.clone();
6838                async {
6839                    let op = GetOperation::new(stub)
6840                        .set_name(name)
6841                        .with_options(options)
6842                        .send()
6843                        .await?;
6844                    Ok(Operation::new(op))
6845                }
6846            };
6847
6848            let start = move || async {
6849                let op = self.send().await?;
6850                Ok(Operation::new(op))
6851            };
6852
6853            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
6854        }
6855
6856        /// Sets the value of [name][crate::model::AcceptSpokeUpdateRequest::name].
6857        ///
6858        /// This is a **required** field for requests.
6859        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6860            self.0.request.name = v.into();
6861            self
6862        }
6863
6864        /// Sets the value of [spoke_uri][crate::model::AcceptSpokeUpdateRequest::spoke_uri].
6865        ///
6866        /// This is a **required** field for requests.
6867        pub fn set_spoke_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
6868            self.0.request.spoke_uri = v.into();
6869            self
6870        }
6871
6872        /// Sets the value of [spoke_etag][crate::model::AcceptSpokeUpdateRequest::spoke_etag].
6873        ///
6874        /// This is a **required** field for requests.
6875        pub fn set_spoke_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
6876            self.0.request.spoke_etag = v.into();
6877            self
6878        }
6879
6880        /// Sets the value of [request_id][crate::model::AcceptSpokeUpdateRequest::request_id].
6881        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6882            self.0.request.request_id = v.into();
6883            self
6884        }
6885    }
6886
6887    #[doc(hidden)]
6888    impl gax::options::internal::RequestBuilder for AcceptSpokeUpdate {
6889        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6890            &mut self.0.options
6891        }
6892    }
6893
6894    /// The request builder for [HubService::reject_spoke_update][crate::client::HubService::reject_spoke_update] calls.
6895    ///
6896    /// # Example
6897    /// ```no_run
6898    /// # use google_cloud_networkconnectivity_v1::builder;
6899    /// use builder::hub_service::RejectSpokeUpdate;
6900    /// # tokio_test::block_on(async {
6901    /// use lro::Poller;
6902    ///
6903    /// let builder = prepare_request_builder();
6904    /// let response = builder.poller().until_done().await?;
6905    /// # gax::Result::<()>::Ok(()) });
6906    ///
6907    /// fn prepare_request_builder() -> RejectSpokeUpdate {
6908    ///   # panic!();
6909    ///   // ... details omitted ...
6910    /// }
6911    /// ```
6912    #[derive(Clone, Debug)]
6913    pub struct RejectSpokeUpdate(RequestBuilder<crate::model::RejectSpokeUpdateRequest>);
6914
6915    impl RejectSpokeUpdate {
6916        pub(crate) fn new(
6917            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6918        ) -> Self {
6919            Self(RequestBuilder::new(stub))
6920        }
6921
6922        /// Sets the full request, replacing any prior values.
6923        pub fn with_request<V: Into<crate::model::RejectSpokeUpdateRequest>>(
6924            mut self,
6925            v: V,
6926        ) -> Self {
6927            self.0.request = v.into();
6928            self
6929        }
6930
6931        /// Sets all the options, replacing any prior values.
6932        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6933            self.0.options = v.into();
6934            self
6935        }
6936
6937        /// Sends the request.
6938        ///
6939        /// # Long running operations
6940        ///
6941        /// This starts, but does not poll, a longrunning operation. More information
6942        /// on [reject_spoke_update][crate::client::HubService::reject_spoke_update].
6943        pub async fn send(self) -> Result<longrunning::model::Operation> {
6944            (*self.0.stub)
6945                .reject_spoke_update(self.0.request, self.0.options)
6946                .await
6947                .map(gax::response::Response::into_body)
6948        }
6949
6950        /// Creates a [Poller][lro::Poller] to work with `reject_spoke_update`.
6951        pub fn poller(
6952            self,
6953        ) -> impl lro::Poller<crate::model::RejectSpokeUpdateResponse, crate::model::OperationMetadata>
6954        {
6955            type Operation = lro::internal::Operation<
6956                crate::model::RejectSpokeUpdateResponse,
6957                crate::model::OperationMetadata,
6958            >;
6959            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6960            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6961
6962            let stub = self.0.stub.clone();
6963            let mut options = self.0.options.clone();
6964            options.set_retry_policy(gax::retry_policy::NeverRetry);
6965            let query = move |name| {
6966                let stub = stub.clone();
6967                let options = options.clone();
6968                async {
6969                    let op = GetOperation::new(stub)
6970                        .set_name(name)
6971                        .with_options(options)
6972                        .send()
6973                        .await?;
6974                    Ok(Operation::new(op))
6975                }
6976            };
6977
6978            let start = move || async {
6979                let op = self.send().await?;
6980                Ok(Operation::new(op))
6981            };
6982
6983            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
6984        }
6985
6986        /// Sets the value of [name][crate::model::RejectSpokeUpdateRequest::name].
6987        ///
6988        /// This is a **required** field for requests.
6989        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6990            self.0.request.name = v.into();
6991            self
6992        }
6993
6994        /// Sets the value of [spoke_uri][crate::model::RejectSpokeUpdateRequest::spoke_uri].
6995        ///
6996        /// This is a **required** field for requests.
6997        pub fn set_spoke_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
6998            self.0.request.spoke_uri = v.into();
6999            self
7000        }
7001
7002        /// Sets the value of [spoke_etag][crate::model::RejectSpokeUpdateRequest::spoke_etag].
7003        ///
7004        /// This is a **required** field for requests.
7005        pub fn set_spoke_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
7006            self.0.request.spoke_etag = v.into();
7007            self
7008        }
7009
7010        /// Sets the value of [details][crate::model::RejectSpokeUpdateRequest::details].
7011        pub fn set_details<T: Into<std::string::String>>(mut self, v: T) -> Self {
7012            self.0.request.details = v.into();
7013            self
7014        }
7015
7016        /// Sets the value of [request_id][crate::model::RejectSpokeUpdateRequest::request_id].
7017        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
7018            self.0.request.request_id = v.into();
7019            self
7020        }
7021    }
7022
7023    #[doc(hidden)]
7024    impl gax::options::internal::RequestBuilder for RejectSpokeUpdate {
7025        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7026            &mut self.0.options
7027        }
7028    }
7029
7030    /// The request builder for [HubService::delete_spoke][crate::client::HubService::delete_spoke] calls.
7031    ///
7032    /// # Example
7033    /// ```no_run
7034    /// # use google_cloud_networkconnectivity_v1::builder;
7035    /// use builder::hub_service::DeleteSpoke;
7036    /// # tokio_test::block_on(async {
7037    /// use lro::Poller;
7038    ///
7039    /// let builder = prepare_request_builder();
7040    /// let response = builder.poller().until_done().await?;
7041    /// # gax::Result::<()>::Ok(()) });
7042    ///
7043    /// fn prepare_request_builder() -> DeleteSpoke {
7044    ///   # panic!();
7045    ///   // ... details omitted ...
7046    /// }
7047    /// ```
7048    #[derive(Clone, Debug)]
7049    pub struct DeleteSpoke(RequestBuilder<crate::model::DeleteSpokeRequest>);
7050
7051    impl DeleteSpoke {
7052        pub(crate) fn new(
7053            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7054        ) -> Self {
7055            Self(RequestBuilder::new(stub))
7056        }
7057
7058        /// Sets the full request, replacing any prior values.
7059        pub fn with_request<V: Into<crate::model::DeleteSpokeRequest>>(mut self, v: V) -> Self {
7060            self.0.request = v.into();
7061            self
7062        }
7063
7064        /// Sets all the options, replacing any prior values.
7065        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7066            self.0.options = v.into();
7067            self
7068        }
7069
7070        /// Sends the request.
7071        ///
7072        /// # Long running operations
7073        ///
7074        /// This starts, but does not poll, a longrunning operation. More information
7075        /// on [delete_spoke][crate::client::HubService::delete_spoke].
7076        pub async fn send(self) -> Result<longrunning::model::Operation> {
7077            (*self.0.stub)
7078                .delete_spoke(self.0.request, self.0.options)
7079                .await
7080                .map(gax::response::Response::into_body)
7081        }
7082
7083        /// Creates a [Poller][lro::Poller] to work with `delete_spoke`.
7084        pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
7085            type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
7086            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7087            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7088
7089            let stub = self.0.stub.clone();
7090            let mut options = self.0.options.clone();
7091            options.set_retry_policy(gax::retry_policy::NeverRetry);
7092            let query = move |name| {
7093                let stub = stub.clone();
7094                let options = options.clone();
7095                async {
7096                    let op = GetOperation::new(stub)
7097                        .set_name(name)
7098                        .with_options(options)
7099                        .send()
7100                        .await?;
7101                    Ok(Operation::new(op))
7102                }
7103            };
7104
7105            let start = move || async {
7106                let op = self.send().await?;
7107                Ok(Operation::new(op))
7108            };
7109
7110            lro::internal::new_unit_response_poller(
7111                polling_error_policy,
7112                polling_backoff_policy,
7113                start,
7114                query,
7115            )
7116        }
7117
7118        /// Sets the value of [name][crate::model::DeleteSpokeRequest::name].
7119        ///
7120        /// This is a **required** field for requests.
7121        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7122            self.0.request.name = v.into();
7123            self
7124        }
7125
7126        /// Sets the value of [request_id][crate::model::DeleteSpokeRequest::request_id].
7127        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
7128            self.0.request.request_id = v.into();
7129            self
7130        }
7131    }
7132
7133    #[doc(hidden)]
7134    impl gax::options::internal::RequestBuilder for DeleteSpoke {
7135        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7136            &mut self.0.options
7137        }
7138    }
7139
7140    /// The request builder for [HubService::get_route_table][crate::client::HubService::get_route_table] calls.
7141    ///
7142    /// # Example
7143    /// ```no_run
7144    /// # use google_cloud_networkconnectivity_v1::builder;
7145    /// use builder::hub_service::GetRouteTable;
7146    /// # tokio_test::block_on(async {
7147    ///
7148    /// let builder = prepare_request_builder();
7149    /// let response = builder.send().await?;
7150    /// # gax::Result::<()>::Ok(()) });
7151    ///
7152    /// fn prepare_request_builder() -> GetRouteTable {
7153    ///   # panic!();
7154    ///   // ... details omitted ...
7155    /// }
7156    /// ```
7157    #[derive(Clone, Debug)]
7158    pub struct GetRouteTable(RequestBuilder<crate::model::GetRouteTableRequest>);
7159
7160    impl GetRouteTable {
7161        pub(crate) fn new(
7162            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7163        ) -> Self {
7164            Self(RequestBuilder::new(stub))
7165        }
7166
7167        /// Sets the full request, replacing any prior values.
7168        pub fn with_request<V: Into<crate::model::GetRouteTableRequest>>(mut self, v: V) -> Self {
7169            self.0.request = v.into();
7170            self
7171        }
7172
7173        /// Sets all the options, replacing any prior values.
7174        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7175            self.0.options = v.into();
7176            self
7177        }
7178
7179        /// Sends the request.
7180        pub async fn send(self) -> Result<crate::model::RouteTable> {
7181            (*self.0.stub)
7182                .get_route_table(self.0.request, self.0.options)
7183                .await
7184                .map(gax::response::Response::into_body)
7185        }
7186
7187        /// Sets the value of [name][crate::model::GetRouteTableRequest::name].
7188        ///
7189        /// This is a **required** field for requests.
7190        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7191            self.0.request.name = v.into();
7192            self
7193        }
7194    }
7195
7196    #[doc(hidden)]
7197    impl gax::options::internal::RequestBuilder for GetRouteTable {
7198        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7199            &mut self.0.options
7200        }
7201    }
7202
7203    /// The request builder for [HubService::get_route][crate::client::HubService::get_route] calls.
7204    ///
7205    /// # Example
7206    /// ```no_run
7207    /// # use google_cloud_networkconnectivity_v1::builder;
7208    /// use builder::hub_service::GetRoute;
7209    /// # tokio_test::block_on(async {
7210    ///
7211    /// let builder = prepare_request_builder();
7212    /// let response = builder.send().await?;
7213    /// # gax::Result::<()>::Ok(()) });
7214    ///
7215    /// fn prepare_request_builder() -> GetRoute {
7216    ///   # panic!();
7217    ///   // ... details omitted ...
7218    /// }
7219    /// ```
7220    #[derive(Clone, Debug)]
7221    pub struct GetRoute(RequestBuilder<crate::model::GetRouteRequest>);
7222
7223    impl GetRoute {
7224        pub(crate) fn new(
7225            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7226        ) -> Self {
7227            Self(RequestBuilder::new(stub))
7228        }
7229
7230        /// Sets the full request, replacing any prior values.
7231        pub fn with_request<V: Into<crate::model::GetRouteRequest>>(mut self, v: V) -> Self {
7232            self.0.request = v.into();
7233            self
7234        }
7235
7236        /// Sets all the options, replacing any prior values.
7237        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7238            self.0.options = v.into();
7239            self
7240        }
7241
7242        /// Sends the request.
7243        pub async fn send(self) -> Result<crate::model::Route> {
7244            (*self.0.stub)
7245                .get_route(self.0.request, self.0.options)
7246                .await
7247                .map(gax::response::Response::into_body)
7248        }
7249
7250        /// Sets the value of [name][crate::model::GetRouteRequest::name].
7251        ///
7252        /// This is a **required** field for requests.
7253        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7254            self.0.request.name = v.into();
7255            self
7256        }
7257    }
7258
7259    #[doc(hidden)]
7260    impl gax::options::internal::RequestBuilder for GetRoute {
7261        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7262            &mut self.0.options
7263        }
7264    }
7265
7266    /// The request builder for [HubService::list_routes][crate::client::HubService::list_routes] calls.
7267    ///
7268    /// # Example
7269    /// ```no_run
7270    /// # use google_cloud_networkconnectivity_v1::builder;
7271    /// use builder::hub_service::ListRoutes;
7272    /// # tokio_test::block_on(async {
7273    /// use gax::paginator::ItemPaginator;
7274    ///
7275    /// let builder = prepare_request_builder();
7276    /// let mut items = builder.by_item();
7277    /// while let Some(result) = items.next().await {
7278    ///   let item = result?;
7279    /// }
7280    /// # gax::Result::<()>::Ok(()) });
7281    ///
7282    /// fn prepare_request_builder() -> ListRoutes {
7283    ///   # panic!();
7284    ///   // ... details omitted ...
7285    /// }
7286    /// ```
7287    #[derive(Clone, Debug)]
7288    pub struct ListRoutes(RequestBuilder<crate::model::ListRoutesRequest>);
7289
7290    impl ListRoutes {
7291        pub(crate) fn new(
7292            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7293        ) -> Self {
7294            Self(RequestBuilder::new(stub))
7295        }
7296
7297        /// Sets the full request, replacing any prior values.
7298        pub fn with_request<V: Into<crate::model::ListRoutesRequest>>(mut self, v: V) -> Self {
7299            self.0.request = v.into();
7300            self
7301        }
7302
7303        /// Sets all the options, replacing any prior values.
7304        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7305            self.0.options = v.into();
7306            self
7307        }
7308
7309        /// Sends the request.
7310        pub async fn send(self) -> Result<crate::model::ListRoutesResponse> {
7311            (*self.0.stub)
7312                .list_routes(self.0.request, self.0.options)
7313                .await
7314                .map(gax::response::Response::into_body)
7315        }
7316
7317        /// Streams each page in the collection.
7318        pub fn by_page(
7319            self,
7320        ) -> impl gax::paginator::Paginator<crate::model::ListRoutesResponse, gax::error::Error>
7321        {
7322            use std::clone::Clone;
7323            let token = self.0.request.page_token.clone();
7324            let execute = move |token: String| {
7325                let mut builder = self.clone();
7326                builder.0.request = builder.0.request.set_page_token(token);
7327                builder.send()
7328            };
7329            gax::paginator::internal::new_paginator(token, execute)
7330        }
7331
7332        /// Streams each item in the collection.
7333        pub fn by_item(
7334            self,
7335        ) -> impl gax::paginator::ItemPaginator<crate::model::ListRoutesResponse, gax::error::Error>
7336        {
7337            use gax::paginator::Paginator;
7338            self.by_page().items()
7339        }
7340
7341        /// Sets the value of [parent][crate::model::ListRoutesRequest::parent].
7342        ///
7343        /// This is a **required** field for requests.
7344        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7345            self.0.request.parent = v.into();
7346            self
7347        }
7348
7349        /// Sets the value of [page_size][crate::model::ListRoutesRequest::page_size].
7350        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7351            self.0.request.page_size = v.into();
7352            self
7353        }
7354
7355        /// Sets the value of [page_token][crate::model::ListRoutesRequest::page_token].
7356        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7357            self.0.request.page_token = v.into();
7358            self
7359        }
7360
7361        /// Sets the value of [filter][crate::model::ListRoutesRequest::filter].
7362        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7363            self.0.request.filter = v.into();
7364            self
7365        }
7366
7367        /// Sets the value of [order_by][crate::model::ListRoutesRequest::order_by].
7368        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
7369            self.0.request.order_by = v.into();
7370            self
7371        }
7372    }
7373
7374    #[doc(hidden)]
7375    impl gax::options::internal::RequestBuilder for ListRoutes {
7376        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7377            &mut self.0.options
7378        }
7379    }
7380
7381    /// The request builder for [HubService::list_route_tables][crate::client::HubService::list_route_tables] calls.
7382    ///
7383    /// # Example
7384    /// ```no_run
7385    /// # use google_cloud_networkconnectivity_v1::builder;
7386    /// use builder::hub_service::ListRouteTables;
7387    /// # tokio_test::block_on(async {
7388    /// use gax::paginator::ItemPaginator;
7389    ///
7390    /// let builder = prepare_request_builder();
7391    /// let mut items = builder.by_item();
7392    /// while let Some(result) = items.next().await {
7393    ///   let item = result?;
7394    /// }
7395    /// # gax::Result::<()>::Ok(()) });
7396    ///
7397    /// fn prepare_request_builder() -> ListRouteTables {
7398    ///   # panic!();
7399    ///   // ... details omitted ...
7400    /// }
7401    /// ```
7402    #[derive(Clone, Debug)]
7403    pub struct ListRouteTables(RequestBuilder<crate::model::ListRouteTablesRequest>);
7404
7405    impl ListRouteTables {
7406        pub(crate) fn new(
7407            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7408        ) -> Self {
7409            Self(RequestBuilder::new(stub))
7410        }
7411
7412        /// Sets the full request, replacing any prior values.
7413        pub fn with_request<V: Into<crate::model::ListRouteTablesRequest>>(mut self, v: V) -> Self {
7414            self.0.request = v.into();
7415            self
7416        }
7417
7418        /// Sets all the options, replacing any prior values.
7419        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7420            self.0.options = v.into();
7421            self
7422        }
7423
7424        /// Sends the request.
7425        pub async fn send(self) -> Result<crate::model::ListRouteTablesResponse> {
7426            (*self.0.stub)
7427                .list_route_tables(self.0.request, self.0.options)
7428                .await
7429                .map(gax::response::Response::into_body)
7430        }
7431
7432        /// Streams each page in the collection.
7433        pub fn by_page(
7434            self,
7435        ) -> impl gax::paginator::Paginator<crate::model::ListRouteTablesResponse, gax::error::Error>
7436        {
7437            use std::clone::Clone;
7438            let token = self.0.request.page_token.clone();
7439            let execute = move |token: String| {
7440                let mut builder = self.clone();
7441                builder.0.request = builder.0.request.set_page_token(token);
7442                builder.send()
7443            };
7444            gax::paginator::internal::new_paginator(token, execute)
7445        }
7446
7447        /// Streams each item in the collection.
7448        pub fn by_item(
7449            self,
7450        ) -> impl gax::paginator::ItemPaginator<crate::model::ListRouteTablesResponse, gax::error::Error>
7451        {
7452            use gax::paginator::Paginator;
7453            self.by_page().items()
7454        }
7455
7456        /// Sets the value of [parent][crate::model::ListRouteTablesRequest::parent].
7457        ///
7458        /// This is a **required** field for requests.
7459        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7460            self.0.request.parent = v.into();
7461            self
7462        }
7463
7464        /// Sets the value of [page_size][crate::model::ListRouteTablesRequest::page_size].
7465        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7466            self.0.request.page_size = v.into();
7467            self
7468        }
7469
7470        /// Sets the value of [page_token][crate::model::ListRouteTablesRequest::page_token].
7471        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7472            self.0.request.page_token = v.into();
7473            self
7474        }
7475
7476        /// Sets the value of [filter][crate::model::ListRouteTablesRequest::filter].
7477        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7478            self.0.request.filter = v.into();
7479            self
7480        }
7481
7482        /// Sets the value of [order_by][crate::model::ListRouteTablesRequest::order_by].
7483        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
7484            self.0.request.order_by = v.into();
7485            self
7486        }
7487    }
7488
7489    #[doc(hidden)]
7490    impl gax::options::internal::RequestBuilder for ListRouteTables {
7491        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7492            &mut self.0.options
7493        }
7494    }
7495
7496    /// The request builder for [HubService::get_group][crate::client::HubService::get_group] calls.
7497    ///
7498    /// # Example
7499    /// ```no_run
7500    /// # use google_cloud_networkconnectivity_v1::builder;
7501    /// use builder::hub_service::GetGroup;
7502    /// # tokio_test::block_on(async {
7503    ///
7504    /// let builder = prepare_request_builder();
7505    /// let response = builder.send().await?;
7506    /// # gax::Result::<()>::Ok(()) });
7507    ///
7508    /// fn prepare_request_builder() -> GetGroup {
7509    ///   # panic!();
7510    ///   // ... details omitted ...
7511    /// }
7512    /// ```
7513    #[derive(Clone, Debug)]
7514    pub struct GetGroup(RequestBuilder<crate::model::GetGroupRequest>);
7515
7516    impl GetGroup {
7517        pub(crate) fn new(
7518            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7519        ) -> Self {
7520            Self(RequestBuilder::new(stub))
7521        }
7522
7523        /// Sets the full request, replacing any prior values.
7524        pub fn with_request<V: Into<crate::model::GetGroupRequest>>(mut self, v: V) -> Self {
7525            self.0.request = v.into();
7526            self
7527        }
7528
7529        /// Sets all the options, replacing any prior values.
7530        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7531            self.0.options = v.into();
7532            self
7533        }
7534
7535        /// Sends the request.
7536        pub async fn send(self) -> Result<crate::model::Group> {
7537            (*self.0.stub)
7538                .get_group(self.0.request, self.0.options)
7539                .await
7540                .map(gax::response::Response::into_body)
7541        }
7542
7543        /// Sets the value of [name][crate::model::GetGroupRequest::name].
7544        ///
7545        /// This is a **required** field for requests.
7546        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7547            self.0.request.name = v.into();
7548            self
7549        }
7550    }
7551
7552    #[doc(hidden)]
7553    impl gax::options::internal::RequestBuilder for GetGroup {
7554        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7555            &mut self.0.options
7556        }
7557    }
7558
7559    /// The request builder for [HubService::list_groups][crate::client::HubService::list_groups] calls.
7560    ///
7561    /// # Example
7562    /// ```no_run
7563    /// # use google_cloud_networkconnectivity_v1::builder;
7564    /// use builder::hub_service::ListGroups;
7565    /// # tokio_test::block_on(async {
7566    /// use gax::paginator::ItemPaginator;
7567    ///
7568    /// let builder = prepare_request_builder();
7569    /// let mut items = builder.by_item();
7570    /// while let Some(result) = items.next().await {
7571    ///   let item = result?;
7572    /// }
7573    /// # gax::Result::<()>::Ok(()) });
7574    ///
7575    /// fn prepare_request_builder() -> ListGroups {
7576    ///   # panic!();
7577    ///   // ... details omitted ...
7578    /// }
7579    /// ```
7580    #[derive(Clone, Debug)]
7581    pub struct ListGroups(RequestBuilder<crate::model::ListGroupsRequest>);
7582
7583    impl ListGroups {
7584        pub(crate) fn new(
7585            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7586        ) -> Self {
7587            Self(RequestBuilder::new(stub))
7588        }
7589
7590        /// Sets the full request, replacing any prior values.
7591        pub fn with_request<V: Into<crate::model::ListGroupsRequest>>(mut self, v: V) -> Self {
7592            self.0.request = v.into();
7593            self
7594        }
7595
7596        /// Sets all the options, replacing any prior values.
7597        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7598            self.0.options = v.into();
7599            self
7600        }
7601
7602        /// Sends the request.
7603        pub async fn send(self) -> Result<crate::model::ListGroupsResponse> {
7604            (*self.0.stub)
7605                .list_groups(self.0.request, self.0.options)
7606                .await
7607                .map(gax::response::Response::into_body)
7608        }
7609
7610        /// Streams each page in the collection.
7611        pub fn by_page(
7612            self,
7613        ) -> impl gax::paginator::Paginator<crate::model::ListGroupsResponse, gax::error::Error>
7614        {
7615            use std::clone::Clone;
7616            let token = self.0.request.page_token.clone();
7617            let execute = move |token: String| {
7618                let mut builder = self.clone();
7619                builder.0.request = builder.0.request.set_page_token(token);
7620                builder.send()
7621            };
7622            gax::paginator::internal::new_paginator(token, execute)
7623        }
7624
7625        /// Streams each item in the collection.
7626        pub fn by_item(
7627            self,
7628        ) -> impl gax::paginator::ItemPaginator<crate::model::ListGroupsResponse, gax::error::Error>
7629        {
7630            use gax::paginator::Paginator;
7631            self.by_page().items()
7632        }
7633
7634        /// Sets the value of [parent][crate::model::ListGroupsRequest::parent].
7635        ///
7636        /// This is a **required** field for requests.
7637        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7638            self.0.request.parent = v.into();
7639            self
7640        }
7641
7642        /// Sets the value of [page_size][crate::model::ListGroupsRequest::page_size].
7643        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7644            self.0.request.page_size = v.into();
7645            self
7646        }
7647
7648        /// Sets the value of [page_token][crate::model::ListGroupsRequest::page_token].
7649        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7650            self.0.request.page_token = v.into();
7651            self
7652        }
7653
7654        /// Sets the value of [filter][crate::model::ListGroupsRequest::filter].
7655        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7656            self.0.request.filter = v.into();
7657            self
7658        }
7659
7660        /// Sets the value of [order_by][crate::model::ListGroupsRequest::order_by].
7661        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
7662            self.0.request.order_by = v.into();
7663            self
7664        }
7665    }
7666
7667    #[doc(hidden)]
7668    impl gax::options::internal::RequestBuilder for ListGroups {
7669        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7670            &mut self.0.options
7671        }
7672    }
7673
7674    /// The request builder for [HubService::update_group][crate::client::HubService::update_group] calls.
7675    ///
7676    /// # Example
7677    /// ```no_run
7678    /// # use google_cloud_networkconnectivity_v1::builder;
7679    /// use builder::hub_service::UpdateGroup;
7680    /// # tokio_test::block_on(async {
7681    /// use lro::Poller;
7682    ///
7683    /// let builder = prepare_request_builder();
7684    /// let response = builder.poller().until_done().await?;
7685    /// # gax::Result::<()>::Ok(()) });
7686    ///
7687    /// fn prepare_request_builder() -> UpdateGroup {
7688    ///   # panic!();
7689    ///   // ... details omitted ...
7690    /// }
7691    /// ```
7692    #[derive(Clone, Debug)]
7693    pub struct UpdateGroup(RequestBuilder<crate::model::UpdateGroupRequest>);
7694
7695    impl UpdateGroup {
7696        pub(crate) fn new(
7697            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7698        ) -> Self {
7699            Self(RequestBuilder::new(stub))
7700        }
7701
7702        /// Sets the full request, replacing any prior values.
7703        pub fn with_request<V: Into<crate::model::UpdateGroupRequest>>(mut self, v: V) -> Self {
7704            self.0.request = v.into();
7705            self
7706        }
7707
7708        /// Sets all the options, replacing any prior values.
7709        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7710            self.0.options = v.into();
7711            self
7712        }
7713
7714        /// Sends the request.
7715        ///
7716        /// # Long running operations
7717        ///
7718        /// This starts, but does not poll, a longrunning operation. More information
7719        /// on [update_group][crate::client::HubService::update_group].
7720        pub async fn send(self) -> Result<longrunning::model::Operation> {
7721            (*self.0.stub)
7722                .update_group(self.0.request, self.0.options)
7723                .await
7724                .map(gax::response::Response::into_body)
7725        }
7726
7727        /// Creates a [Poller][lro::Poller] to work with `update_group`.
7728        pub fn poller(
7729            self,
7730        ) -> impl lro::Poller<crate::model::Group, crate::model::OperationMetadata> {
7731            type Operation =
7732                lro::internal::Operation<crate::model::Group, crate::model::OperationMetadata>;
7733            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7734            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7735
7736            let stub = self.0.stub.clone();
7737            let mut options = self.0.options.clone();
7738            options.set_retry_policy(gax::retry_policy::NeverRetry);
7739            let query = move |name| {
7740                let stub = stub.clone();
7741                let options = options.clone();
7742                async {
7743                    let op = GetOperation::new(stub)
7744                        .set_name(name)
7745                        .with_options(options)
7746                        .send()
7747                        .await?;
7748                    Ok(Operation::new(op))
7749                }
7750            };
7751
7752            let start = move || async {
7753                let op = self.send().await?;
7754                Ok(Operation::new(op))
7755            };
7756
7757            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
7758        }
7759
7760        /// Sets the value of [update_mask][crate::model::UpdateGroupRequest::update_mask].
7761        pub fn set_update_mask<T>(mut self, v: T) -> Self
7762        where
7763            T: std::convert::Into<wkt::FieldMask>,
7764        {
7765            self.0.request.update_mask = std::option::Option::Some(v.into());
7766            self
7767        }
7768
7769        /// Sets or clears the value of [update_mask][crate::model::UpdateGroupRequest::update_mask].
7770        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7771        where
7772            T: std::convert::Into<wkt::FieldMask>,
7773        {
7774            self.0.request.update_mask = v.map(|x| x.into());
7775            self
7776        }
7777
7778        /// Sets the value of [group][crate::model::UpdateGroupRequest::group].
7779        ///
7780        /// This is a **required** field for requests.
7781        pub fn set_group<T>(mut self, v: T) -> Self
7782        where
7783            T: std::convert::Into<crate::model::Group>,
7784        {
7785            self.0.request.group = std::option::Option::Some(v.into());
7786            self
7787        }
7788
7789        /// Sets or clears the value of [group][crate::model::UpdateGroupRequest::group].
7790        ///
7791        /// This is a **required** field for requests.
7792        pub fn set_or_clear_group<T>(mut self, v: std::option::Option<T>) -> Self
7793        where
7794            T: std::convert::Into<crate::model::Group>,
7795        {
7796            self.0.request.group = v.map(|x| x.into());
7797            self
7798        }
7799
7800        /// Sets the value of [request_id][crate::model::UpdateGroupRequest::request_id].
7801        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
7802            self.0.request.request_id = v.into();
7803            self
7804        }
7805    }
7806
7807    #[doc(hidden)]
7808    impl gax::options::internal::RequestBuilder for UpdateGroup {
7809        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7810            &mut self.0.options
7811        }
7812    }
7813
7814    /// The request builder for [HubService::list_locations][crate::client::HubService::list_locations] calls.
7815    ///
7816    /// # Example
7817    /// ```no_run
7818    /// # use google_cloud_networkconnectivity_v1::builder;
7819    /// use builder::hub_service::ListLocations;
7820    /// # tokio_test::block_on(async {
7821    /// use gax::paginator::ItemPaginator;
7822    ///
7823    /// let builder = prepare_request_builder();
7824    /// let mut items = builder.by_item();
7825    /// while let Some(result) = items.next().await {
7826    ///   let item = result?;
7827    /// }
7828    /// # gax::Result::<()>::Ok(()) });
7829    ///
7830    /// fn prepare_request_builder() -> ListLocations {
7831    ///   # panic!();
7832    ///   // ... details omitted ...
7833    /// }
7834    /// ```
7835    #[derive(Clone, Debug)]
7836    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
7837
7838    impl ListLocations {
7839        pub(crate) fn new(
7840            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7841        ) -> Self {
7842            Self(RequestBuilder::new(stub))
7843        }
7844
7845        /// Sets the full request, replacing any prior values.
7846        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
7847            mut self,
7848            v: V,
7849        ) -> Self {
7850            self.0.request = v.into();
7851            self
7852        }
7853
7854        /// Sets all the options, replacing any prior values.
7855        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7856            self.0.options = v.into();
7857            self
7858        }
7859
7860        /// Sends the request.
7861        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
7862            (*self.0.stub)
7863                .list_locations(self.0.request, self.0.options)
7864                .await
7865                .map(gax::response::Response::into_body)
7866        }
7867
7868        /// Streams each page in the collection.
7869        pub fn by_page(
7870            self,
7871        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
7872        {
7873            use std::clone::Clone;
7874            let token = self.0.request.page_token.clone();
7875            let execute = move |token: String| {
7876                let mut builder = self.clone();
7877                builder.0.request = builder.0.request.set_page_token(token);
7878                builder.send()
7879            };
7880            gax::paginator::internal::new_paginator(token, execute)
7881        }
7882
7883        /// Streams each item in the collection.
7884        pub fn by_item(
7885            self,
7886        ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
7887        {
7888            use gax::paginator::Paginator;
7889            self.by_page().items()
7890        }
7891
7892        /// Sets the value of [name][location::model::ListLocationsRequest::name].
7893        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7894            self.0.request.name = v.into();
7895            self
7896        }
7897
7898        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
7899        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7900            self.0.request.filter = v.into();
7901            self
7902        }
7903
7904        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
7905        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7906            self.0.request.page_size = v.into();
7907            self
7908        }
7909
7910        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
7911        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7912            self.0.request.page_token = v.into();
7913            self
7914        }
7915    }
7916
7917    #[doc(hidden)]
7918    impl gax::options::internal::RequestBuilder for ListLocations {
7919        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7920            &mut self.0.options
7921        }
7922    }
7923
7924    /// The request builder for [HubService::get_location][crate::client::HubService::get_location] calls.
7925    ///
7926    /// # Example
7927    /// ```no_run
7928    /// # use google_cloud_networkconnectivity_v1::builder;
7929    /// use builder::hub_service::GetLocation;
7930    /// # tokio_test::block_on(async {
7931    ///
7932    /// let builder = prepare_request_builder();
7933    /// let response = builder.send().await?;
7934    /// # gax::Result::<()>::Ok(()) });
7935    ///
7936    /// fn prepare_request_builder() -> GetLocation {
7937    ///   # panic!();
7938    ///   // ... details omitted ...
7939    /// }
7940    /// ```
7941    #[derive(Clone, Debug)]
7942    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
7943
7944    impl GetLocation {
7945        pub(crate) fn new(
7946            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7947        ) -> Self {
7948            Self(RequestBuilder::new(stub))
7949        }
7950
7951        /// Sets the full request, replacing any prior values.
7952        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
7953            self.0.request = v.into();
7954            self
7955        }
7956
7957        /// Sets all the options, replacing any prior values.
7958        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7959            self.0.options = v.into();
7960            self
7961        }
7962
7963        /// Sends the request.
7964        pub async fn send(self) -> Result<location::model::Location> {
7965            (*self.0.stub)
7966                .get_location(self.0.request, self.0.options)
7967                .await
7968                .map(gax::response::Response::into_body)
7969        }
7970
7971        /// Sets the value of [name][location::model::GetLocationRequest::name].
7972        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7973            self.0.request.name = v.into();
7974            self
7975        }
7976    }
7977
7978    #[doc(hidden)]
7979    impl gax::options::internal::RequestBuilder for GetLocation {
7980        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7981            &mut self.0.options
7982        }
7983    }
7984
7985    /// The request builder for [HubService::set_iam_policy][crate::client::HubService::set_iam_policy] calls.
7986    ///
7987    /// # Example
7988    /// ```no_run
7989    /// # use google_cloud_networkconnectivity_v1::builder;
7990    /// use builder::hub_service::SetIamPolicy;
7991    /// # tokio_test::block_on(async {
7992    ///
7993    /// let builder = prepare_request_builder();
7994    /// let response = builder.send().await?;
7995    /// # gax::Result::<()>::Ok(()) });
7996    ///
7997    /// fn prepare_request_builder() -> SetIamPolicy {
7998    ///   # panic!();
7999    ///   // ... details omitted ...
8000    /// }
8001    /// ```
8002    #[derive(Clone, Debug)]
8003    pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
8004
8005    impl SetIamPolicy {
8006        pub(crate) fn new(
8007            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8008        ) -> Self {
8009            Self(RequestBuilder::new(stub))
8010        }
8011
8012        /// Sets the full request, replacing any prior values.
8013        pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> 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        pub async fn send(self) -> Result<iam_v1::model::Policy> {
8026            (*self.0.stub)
8027                .set_iam_policy(self.0.request, self.0.options)
8028                .await
8029                .map(gax::response::Response::into_body)
8030        }
8031
8032        /// Sets the value of [resource][iam_v1::model::SetIamPolicyRequest::resource].
8033        ///
8034        /// This is a **required** field for requests.
8035        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
8036            self.0.request.resource = v.into();
8037            self
8038        }
8039
8040        /// Sets the value of [policy][iam_v1::model::SetIamPolicyRequest::policy].
8041        ///
8042        /// This is a **required** field for requests.
8043        pub fn set_policy<T>(mut self, v: T) -> Self
8044        where
8045            T: std::convert::Into<iam_v1::model::Policy>,
8046        {
8047            self.0.request.policy = std::option::Option::Some(v.into());
8048            self
8049        }
8050
8051        /// Sets or clears the value of [policy][iam_v1::model::SetIamPolicyRequest::policy].
8052        ///
8053        /// This is a **required** field for requests.
8054        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
8055        where
8056            T: std::convert::Into<iam_v1::model::Policy>,
8057        {
8058            self.0.request.policy = v.map(|x| x.into());
8059            self
8060        }
8061
8062        /// Sets the value of [update_mask][iam_v1::model::SetIamPolicyRequest::update_mask].
8063        pub fn set_update_mask<T>(mut self, v: T) -> Self
8064        where
8065            T: std::convert::Into<wkt::FieldMask>,
8066        {
8067            self.0.request.update_mask = std::option::Option::Some(v.into());
8068            self
8069        }
8070
8071        /// Sets or clears the value of [update_mask][iam_v1::model::SetIamPolicyRequest::update_mask].
8072        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
8073        where
8074            T: std::convert::Into<wkt::FieldMask>,
8075        {
8076            self.0.request.update_mask = v.map(|x| x.into());
8077            self
8078        }
8079    }
8080
8081    #[doc(hidden)]
8082    impl gax::options::internal::RequestBuilder for SetIamPolicy {
8083        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8084            &mut self.0.options
8085        }
8086    }
8087
8088    /// The request builder for [HubService::get_iam_policy][crate::client::HubService::get_iam_policy] calls.
8089    ///
8090    /// # Example
8091    /// ```no_run
8092    /// # use google_cloud_networkconnectivity_v1::builder;
8093    /// use builder::hub_service::GetIamPolicy;
8094    /// # tokio_test::block_on(async {
8095    ///
8096    /// let builder = prepare_request_builder();
8097    /// let response = builder.send().await?;
8098    /// # gax::Result::<()>::Ok(()) });
8099    ///
8100    /// fn prepare_request_builder() -> GetIamPolicy {
8101    ///   # panic!();
8102    ///   // ... details omitted ...
8103    /// }
8104    /// ```
8105    #[derive(Clone, Debug)]
8106    pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
8107
8108    impl GetIamPolicy {
8109        pub(crate) fn new(
8110            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8111        ) -> Self {
8112            Self(RequestBuilder::new(stub))
8113        }
8114
8115        /// Sets the full request, replacing any prior values.
8116        pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
8117            self.0.request = v.into();
8118            self
8119        }
8120
8121        /// Sets all the options, replacing any prior values.
8122        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8123            self.0.options = v.into();
8124            self
8125        }
8126
8127        /// Sends the request.
8128        pub async fn send(self) -> Result<iam_v1::model::Policy> {
8129            (*self.0.stub)
8130                .get_iam_policy(self.0.request, self.0.options)
8131                .await
8132                .map(gax::response::Response::into_body)
8133        }
8134
8135        /// Sets the value of [resource][iam_v1::model::GetIamPolicyRequest::resource].
8136        ///
8137        /// This is a **required** field for requests.
8138        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
8139            self.0.request.resource = v.into();
8140            self
8141        }
8142
8143        /// Sets the value of [options][iam_v1::model::GetIamPolicyRequest::options].
8144        pub fn set_options<T>(mut self, v: T) -> Self
8145        where
8146            T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
8147        {
8148            self.0.request.options = std::option::Option::Some(v.into());
8149            self
8150        }
8151
8152        /// Sets or clears the value of [options][iam_v1::model::GetIamPolicyRequest::options].
8153        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
8154        where
8155            T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
8156        {
8157            self.0.request.options = v.map(|x| x.into());
8158            self
8159        }
8160    }
8161
8162    #[doc(hidden)]
8163    impl gax::options::internal::RequestBuilder for GetIamPolicy {
8164        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8165            &mut self.0.options
8166        }
8167    }
8168
8169    /// The request builder for [HubService::test_iam_permissions][crate::client::HubService::test_iam_permissions] calls.
8170    ///
8171    /// # Example
8172    /// ```no_run
8173    /// # use google_cloud_networkconnectivity_v1::builder;
8174    /// use builder::hub_service::TestIamPermissions;
8175    /// # tokio_test::block_on(async {
8176    ///
8177    /// let builder = prepare_request_builder();
8178    /// let response = builder.send().await?;
8179    /// # gax::Result::<()>::Ok(()) });
8180    ///
8181    /// fn prepare_request_builder() -> TestIamPermissions {
8182    ///   # panic!();
8183    ///   // ... details omitted ...
8184    /// }
8185    /// ```
8186    #[derive(Clone, Debug)]
8187    pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
8188
8189    impl TestIamPermissions {
8190        pub(crate) fn new(
8191            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8192        ) -> Self {
8193            Self(RequestBuilder::new(stub))
8194        }
8195
8196        /// Sets the full request, replacing any prior values.
8197        pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
8198            mut self,
8199            v: V,
8200        ) -> Self {
8201            self.0.request = v.into();
8202            self
8203        }
8204
8205        /// Sets all the options, replacing any prior values.
8206        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8207            self.0.options = v.into();
8208            self
8209        }
8210
8211        /// Sends the request.
8212        pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
8213            (*self.0.stub)
8214                .test_iam_permissions(self.0.request, self.0.options)
8215                .await
8216                .map(gax::response::Response::into_body)
8217        }
8218
8219        /// Sets the value of [resource][iam_v1::model::TestIamPermissionsRequest::resource].
8220        ///
8221        /// This is a **required** field for requests.
8222        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
8223            self.0.request.resource = v.into();
8224            self
8225        }
8226
8227        /// Sets the value of [permissions][iam_v1::model::TestIamPermissionsRequest::permissions].
8228        ///
8229        /// This is a **required** field for requests.
8230        pub fn set_permissions<T, V>(mut self, v: T) -> Self
8231        where
8232            T: std::iter::IntoIterator<Item = V>,
8233            V: std::convert::Into<std::string::String>,
8234        {
8235            use std::iter::Iterator;
8236            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
8237            self
8238        }
8239    }
8240
8241    #[doc(hidden)]
8242    impl gax::options::internal::RequestBuilder for TestIamPermissions {
8243        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8244            &mut self.0.options
8245        }
8246    }
8247
8248    /// The request builder for [HubService::list_operations][crate::client::HubService::list_operations] calls.
8249    ///
8250    /// # Example
8251    /// ```no_run
8252    /// # use google_cloud_networkconnectivity_v1::builder;
8253    /// use builder::hub_service::ListOperations;
8254    /// # tokio_test::block_on(async {
8255    /// use gax::paginator::ItemPaginator;
8256    ///
8257    /// let builder = prepare_request_builder();
8258    /// let mut items = builder.by_item();
8259    /// while let Some(result) = items.next().await {
8260    ///   let item = result?;
8261    /// }
8262    /// # gax::Result::<()>::Ok(()) });
8263    ///
8264    /// fn prepare_request_builder() -> ListOperations {
8265    ///   # panic!();
8266    ///   // ... details omitted ...
8267    /// }
8268    /// ```
8269    #[derive(Clone, Debug)]
8270    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
8271
8272    impl ListOperations {
8273        pub(crate) fn new(
8274            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8275        ) -> Self {
8276            Self(RequestBuilder::new(stub))
8277        }
8278
8279        /// Sets the full request, replacing any prior values.
8280        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
8281            mut self,
8282            v: V,
8283        ) -> Self {
8284            self.0.request = v.into();
8285            self
8286        }
8287
8288        /// Sets all the options, replacing any prior values.
8289        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8290            self.0.options = v.into();
8291            self
8292        }
8293
8294        /// Sends the request.
8295        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
8296            (*self.0.stub)
8297                .list_operations(self.0.request, self.0.options)
8298                .await
8299                .map(gax::response::Response::into_body)
8300        }
8301
8302        /// Streams each page in the collection.
8303        pub fn by_page(
8304            self,
8305        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
8306        {
8307            use std::clone::Clone;
8308            let token = self.0.request.page_token.clone();
8309            let execute = move |token: String| {
8310                let mut builder = self.clone();
8311                builder.0.request = builder.0.request.set_page_token(token);
8312                builder.send()
8313            };
8314            gax::paginator::internal::new_paginator(token, execute)
8315        }
8316
8317        /// Streams each item in the collection.
8318        pub fn by_item(
8319            self,
8320        ) -> impl gax::paginator::ItemPaginator<
8321            longrunning::model::ListOperationsResponse,
8322            gax::error::Error,
8323        > {
8324            use gax::paginator::Paginator;
8325            self.by_page().items()
8326        }
8327
8328        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
8329        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8330            self.0.request.name = v.into();
8331            self
8332        }
8333
8334        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
8335        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8336            self.0.request.filter = v.into();
8337            self
8338        }
8339
8340        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
8341        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8342            self.0.request.page_size = v.into();
8343            self
8344        }
8345
8346        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
8347        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8348            self.0.request.page_token = v.into();
8349            self
8350        }
8351    }
8352
8353    #[doc(hidden)]
8354    impl gax::options::internal::RequestBuilder for ListOperations {
8355        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8356            &mut self.0.options
8357        }
8358    }
8359
8360    /// The request builder for [HubService::get_operation][crate::client::HubService::get_operation] calls.
8361    ///
8362    /// # Example
8363    /// ```no_run
8364    /// # use google_cloud_networkconnectivity_v1::builder;
8365    /// use builder::hub_service::GetOperation;
8366    /// # tokio_test::block_on(async {
8367    ///
8368    /// let builder = prepare_request_builder();
8369    /// let response = builder.send().await?;
8370    /// # gax::Result::<()>::Ok(()) });
8371    ///
8372    /// fn prepare_request_builder() -> GetOperation {
8373    ///   # panic!();
8374    ///   // ... details omitted ...
8375    /// }
8376    /// ```
8377    #[derive(Clone, Debug)]
8378    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
8379
8380    impl GetOperation {
8381        pub(crate) fn new(
8382            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8383        ) -> Self {
8384            Self(RequestBuilder::new(stub))
8385        }
8386
8387        /// Sets the full request, replacing any prior values.
8388        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
8389            mut self,
8390            v: V,
8391        ) -> Self {
8392            self.0.request = v.into();
8393            self
8394        }
8395
8396        /// Sets all the options, replacing any prior values.
8397        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8398            self.0.options = v.into();
8399            self
8400        }
8401
8402        /// Sends the request.
8403        pub async fn send(self) -> Result<longrunning::model::Operation> {
8404            (*self.0.stub)
8405                .get_operation(self.0.request, self.0.options)
8406                .await
8407                .map(gax::response::Response::into_body)
8408        }
8409
8410        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
8411        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8412            self.0.request.name = v.into();
8413            self
8414        }
8415    }
8416
8417    #[doc(hidden)]
8418    impl gax::options::internal::RequestBuilder for GetOperation {
8419        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8420            &mut self.0.options
8421        }
8422    }
8423
8424    /// The request builder for [HubService::delete_operation][crate::client::HubService::delete_operation] calls.
8425    ///
8426    /// # Example
8427    /// ```no_run
8428    /// # use google_cloud_networkconnectivity_v1::builder;
8429    /// use builder::hub_service::DeleteOperation;
8430    /// # tokio_test::block_on(async {
8431    ///
8432    /// let builder = prepare_request_builder();
8433    /// let response = builder.send().await?;
8434    /// # gax::Result::<()>::Ok(()) });
8435    ///
8436    /// fn prepare_request_builder() -> DeleteOperation {
8437    ///   # panic!();
8438    ///   // ... details omitted ...
8439    /// }
8440    /// ```
8441    #[derive(Clone, Debug)]
8442    pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
8443
8444    impl DeleteOperation {
8445        pub(crate) fn new(
8446            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8447        ) -> Self {
8448            Self(RequestBuilder::new(stub))
8449        }
8450
8451        /// Sets the full request, replacing any prior values.
8452        pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
8453            mut self,
8454            v: V,
8455        ) -> Self {
8456            self.0.request = v.into();
8457            self
8458        }
8459
8460        /// Sets all the options, replacing any prior values.
8461        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8462            self.0.options = v.into();
8463            self
8464        }
8465
8466        /// Sends the request.
8467        pub async fn send(self) -> Result<()> {
8468            (*self.0.stub)
8469                .delete_operation(self.0.request, self.0.options)
8470                .await
8471                .map(gax::response::Response::into_body)
8472        }
8473
8474        /// Sets the value of [name][longrunning::model::DeleteOperationRequest::name].
8475        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8476            self.0.request.name = v.into();
8477            self
8478        }
8479    }
8480
8481    #[doc(hidden)]
8482    impl gax::options::internal::RequestBuilder for DeleteOperation {
8483        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8484            &mut self.0.options
8485        }
8486    }
8487
8488    /// The request builder for [HubService::cancel_operation][crate::client::HubService::cancel_operation] calls.
8489    ///
8490    /// # Example
8491    /// ```no_run
8492    /// # use google_cloud_networkconnectivity_v1::builder;
8493    /// use builder::hub_service::CancelOperation;
8494    /// # tokio_test::block_on(async {
8495    ///
8496    /// let builder = prepare_request_builder();
8497    /// let response = builder.send().await?;
8498    /// # gax::Result::<()>::Ok(()) });
8499    ///
8500    /// fn prepare_request_builder() -> CancelOperation {
8501    ///   # panic!();
8502    ///   // ... details omitted ...
8503    /// }
8504    /// ```
8505    #[derive(Clone, Debug)]
8506    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
8507
8508    impl CancelOperation {
8509        pub(crate) fn new(
8510            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8511        ) -> Self {
8512            Self(RequestBuilder::new(stub))
8513        }
8514
8515        /// Sets the full request, replacing any prior values.
8516        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
8517            mut self,
8518            v: V,
8519        ) -> Self {
8520            self.0.request = v.into();
8521            self
8522        }
8523
8524        /// Sets all the options, replacing any prior values.
8525        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8526            self.0.options = v.into();
8527            self
8528        }
8529
8530        /// Sends the request.
8531        pub async fn send(self) -> Result<()> {
8532            (*self.0.stub)
8533                .cancel_operation(self.0.request, self.0.options)
8534                .await
8535                .map(gax::response::Response::into_body)
8536        }
8537
8538        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
8539        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8540            self.0.request.name = v.into();
8541            self
8542        }
8543    }
8544
8545    #[doc(hidden)]
8546    impl gax::options::internal::RequestBuilder for CancelOperation {
8547        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8548            &mut self.0.options
8549        }
8550    }
8551}
8552
8553pub mod internal_range_service {
8554    use crate::Result;
8555
8556    /// A builder for [InternalRangeService][crate::client::InternalRangeService].
8557    ///
8558    /// ```
8559    /// # tokio_test::block_on(async {
8560    /// # use google_cloud_networkconnectivity_v1::*;
8561    /// # use builder::internal_range_service::ClientBuilder;
8562    /// # use client::InternalRangeService;
8563    /// let builder : ClientBuilder = InternalRangeService::builder();
8564    /// let client = builder
8565    ///     .with_endpoint("https://networkconnectivity.googleapis.com")
8566    ///     .build().await?;
8567    /// # gax::client_builder::Result::<()>::Ok(()) });
8568    /// ```
8569    pub type ClientBuilder =
8570        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
8571
8572    pub(crate) mod client {
8573        use super::super::super::client::InternalRangeService;
8574        pub struct Factory;
8575        impl gax::client_builder::internal::ClientFactory for Factory {
8576            type Client = InternalRangeService;
8577            type Credentials = gaxi::options::Credentials;
8578            async fn build(
8579                self,
8580                config: gaxi::options::ClientConfig,
8581            ) -> gax::client_builder::Result<Self::Client> {
8582                Self::Client::new(config).await
8583            }
8584        }
8585    }
8586
8587    /// Common implementation for [crate::client::InternalRangeService] request builders.
8588    #[derive(Clone, Debug)]
8589    pub(crate) struct RequestBuilder<R: std::default::Default> {
8590        stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
8591        request: R,
8592        options: gax::options::RequestOptions,
8593    }
8594
8595    impl<R> RequestBuilder<R>
8596    where
8597        R: std::default::Default,
8598    {
8599        pub(crate) fn new(
8600            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
8601        ) -> Self {
8602            Self {
8603                stub,
8604                request: R::default(),
8605                options: gax::options::RequestOptions::default(),
8606            }
8607        }
8608    }
8609
8610    /// The request builder for [InternalRangeService::list_internal_ranges][crate::client::InternalRangeService::list_internal_ranges] calls.
8611    ///
8612    /// # Example
8613    /// ```no_run
8614    /// # use google_cloud_networkconnectivity_v1::builder;
8615    /// use builder::internal_range_service::ListInternalRanges;
8616    /// # tokio_test::block_on(async {
8617    /// use gax::paginator::ItemPaginator;
8618    ///
8619    /// let builder = prepare_request_builder();
8620    /// let mut items = builder.by_item();
8621    /// while let Some(result) = items.next().await {
8622    ///   let item = result?;
8623    /// }
8624    /// # gax::Result::<()>::Ok(()) });
8625    ///
8626    /// fn prepare_request_builder() -> ListInternalRanges {
8627    ///   # panic!();
8628    ///   // ... details omitted ...
8629    /// }
8630    /// ```
8631    #[derive(Clone, Debug)]
8632    pub struct ListInternalRanges(RequestBuilder<crate::model::ListInternalRangesRequest>);
8633
8634    impl ListInternalRanges {
8635        pub(crate) fn new(
8636            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
8637        ) -> Self {
8638            Self(RequestBuilder::new(stub))
8639        }
8640
8641        /// Sets the full request, replacing any prior values.
8642        pub fn with_request<V: Into<crate::model::ListInternalRangesRequest>>(
8643            mut self,
8644            v: V,
8645        ) -> Self {
8646            self.0.request = v.into();
8647            self
8648        }
8649
8650        /// Sets all the options, replacing any prior values.
8651        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8652            self.0.options = v.into();
8653            self
8654        }
8655
8656        /// Sends the request.
8657        pub async fn send(self) -> Result<crate::model::ListInternalRangesResponse> {
8658            (*self.0.stub)
8659                .list_internal_ranges(self.0.request, self.0.options)
8660                .await
8661                .map(gax::response::Response::into_body)
8662        }
8663
8664        /// Streams each page in the collection.
8665        pub fn by_page(
8666            self,
8667        ) -> impl gax::paginator::Paginator<crate::model::ListInternalRangesResponse, gax::error::Error>
8668        {
8669            use std::clone::Clone;
8670            let token = self.0.request.page_token.clone();
8671            let execute = move |token: String| {
8672                let mut builder = self.clone();
8673                builder.0.request = builder.0.request.set_page_token(token);
8674                builder.send()
8675            };
8676            gax::paginator::internal::new_paginator(token, execute)
8677        }
8678
8679        /// Streams each item in the collection.
8680        pub fn by_item(
8681            self,
8682        ) -> impl gax::paginator::ItemPaginator<
8683            crate::model::ListInternalRangesResponse,
8684            gax::error::Error,
8685        > {
8686            use gax::paginator::Paginator;
8687            self.by_page().items()
8688        }
8689
8690        /// Sets the value of [parent][crate::model::ListInternalRangesRequest::parent].
8691        ///
8692        /// This is a **required** field for requests.
8693        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
8694            self.0.request.parent = v.into();
8695            self
8696        }
8697
8698        /// Sets the value of [page_size][crate::model::ListInternalRangesRequest::page_size].
8699        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8700            self.0.request.page_size = v.into();
8701            self
8702        }
8703
8704        /// Sets the value of [page_token][crate::model::ListInternalRangesRequest::page_token].
8705        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8706            self.0.request.page_token = v.into();
8707            self
8708        }
8709
8710        /// Sets the value of [filter][crate::model::ListInternalRangesRequest::filter].
8711        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8712            self.0.request.filter = v.into();
8713            self
8714        }
8715
8716        /// Sets the value of [order_by][crate::model::ListInternalRangesRequest::order_by].
8717        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
8718            self.0.request.order_by = v.into();
8719            self
8720        }
8721    }
8722
8723    #[doc(hidden)]
8724    impl gax::options::internal::RequestBuilder for ListInternalRanges {
8725        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8726            &mut self.0.options
8727        }
8728    }
8729
8730    /// The request builder for [InternalRangeService::get_internal_range][crate::client::InternalRangeService::get_internal_range] calls.
8731    ///
8732    /// # Example
8733    /// ```no_run
8734    /// # use google_cloud_networkconnectivity_v1::builder;
8735    /// use builder::internal_range_service::GetInternalRange;
8736    /// # tokio_test::block_on(async {
8737    ///
8738    /// let builder = prepare_request_builder();
8739    /// let response = builder.send().await?;
8740    /// # gax::Result::<()>::Ok(()) });
8741    ///
8742    /// fn prepare_request_builder() -> GetInternalRange {
8743    ///   # panic!();
8744    ///   // ... details omitted ...
8745    /// }
8746    /// ```
8747    #[derive(Clone, Debug)]
8748    pub struct GetInternalRange(RequestBuilder<crate::model::GetInternalRangeRequest>);
8749
8750    impl GetInternalRange {
8751        pub(crate) fn new(
8752            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
8753        ) -> Self {
8754            Self(RequestBuilder::new(stub))
8755        }
8756
8757        /// Sets the full request, replacing any prior values.
8758        pub fn with_request<V: Into<crate::model::GetInternalRangeRequest>>(
8759            mut self,
8760            v: V,
8761        ) -> Self {
8762            self.0.request = v.into();
8763            self
8764        }
8765
8766        /// Sets all the options, replacing any prior values.
8767        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8768            self.0.options = v.into();
8769            self
8770        }
8771
8772        /// Sends the request.
8773        pub async fn send(self) -> Result<crate::model::InternalRange> {
8774            (*self.0.stub)
8775                .get_internal_range(self.0.request, self.0.options)
8776                .await
8777                .map(gax::response::Response::into_body)
8778        }
8779
8780        /// Sets the value of [name][crate::model::GetInternalRangeRequest::name].
8781        ///
8782        /// This is a **required** field for requests.
8783        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8784            self.0.request.name = v.into();
8785            self
8786        }
8787    }
8788
8789    #[doc(hidden)]
8790    impl gax::options::internal::RequestBuilder for GetInternalRange {
8791        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8792            &mut self.0.options
8793        }
8794    }
8795
8796    /// The request builder for [InternalRangeService::create_internal_range][crate::client::InternalRangeService::create_internal_range] calls.
8797    ///
8798    /// # Example
8799    /// ```no_run
8800    /// # use google_cloud_networkconnectivity_v1::builder;
8801    /// use builder::internal_range_service::CreateInternalRange;
8802    /// # tokio_test::block_on(async {
8803    /// use lro::Poller;
8804    ///
8805    /// let builder = prepare_request_builder();
8806    /// let response = builder.poller().until_done().await?;
8807    /// # gax::Result::<()>::Ok(()) });
8808    ///
8809    /// fn prepare_request_builder() -> CreateInternalRange {
8810    ///   # panic!();
8811    ///   // ... details omitted ...
8812    /// }
8813    /// ```
8814    #[derive(Clone, Debug)]
8815    pub struct CreateInternalRange(RequestBuilder<crate::model::CreateInternalRangeRequest>);
8816
8817    impl CreateInternalRange {
8818        pub(crate) fn new(
8819            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
8820        ) -> Self {
8821            Self(RequestBuilder::new(stub))
8822        }
8823
8824        /// Sets the full request, replacing any prior values.
8825        pub fn with_request<V: Into<crate::model::CreateInternalRangeRequest>>(
8826            mut self,
8827            v: V,
8828        ) -> Self {
8829            self.0.request = v.into();
8830            self
8831        }
8832
8833        /// Sets all the options, replacing any prior values.
8834        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8835            self.0.options = v.into();
8836            self
8837        }
8838
8839        /// Sends the request.
8840        ///
8841        /// # Long running operations
8842        ///
8843        /// This starts, but does not poll, a longrunning operation. More information
8844        /// on [create_internal_range][crate::client::InternalRangeService::create_internal_range].
8845        pub async fn send(self) -> Result<longrunning::model::Operation> {
8846            (*self.0.stub)
8847                .create_internal_range(self.0.request, self.0.options)
8848                .await
8849                .map(gax::response::Response::into_body)
8850        }
8851
8852        /// Creates a [Poller][lro::Poller] to work with `create_internal_range`.
8853        pub fn poller(
8854            self,
8855        ) -> impl lro::Poller<crate::model::InternalRange, crate::model::OperationMetadata>
8856        {
8857            type Operation = lro::internal::Operation<
8858                crate::model::InternalRange,
8859                crate::model::OperationMetadata,
8860            >;
8861            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8862            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8863
8864            let stub = self.0.stub.clone();
8865            let mut options = self.0.options.clone();
8866            options.set_retry_policy(gax::retry_policy::NeverRetry);
8867            let query = move |name| {
8868                let stub = stub.clone();
8869                let options = options.clone();
8870                async {
8871                    let op = GetOperation::new(stub)
8872                        .set_name(name)
8873                        .with_options(options)
8874                        .send()
8875                        .await?;
8876                    Ok(Operation::new(op))
8877                }
8878            };
8879
8880            let start = move || async {
8881                let op = self.send().await?;
8882                Ok(Operation::new(op))
8883            };
8884
8885            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
8886        }
8887
8888        /// Sets the value of [parent][crate::model::CreateInternalRangeRequest::parent].
8889        ///
8890        /// This is a **required** field for requests.
8891        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
8892            self.0.request.parent = v.into();
8893            self
8894        }
8895
8896        /// Sets the value of [internal_range_id][crate::model::CreateInternalRangeRequest::internal_range_id].
8897        pub fn set_internal_range_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
8898            self.0.request.internal_range_id = v.into();
8899            self
8900        }
8901
8902        /// Sets the value of [internal_range][crate::model::CreateInternalRangeRequest::internal_range].
8903        ///
8904        /// This is a **required** field for requests.
8905        pub fn set_internal_range<T>(mut self, v: T) -> Self
8906        where
8907            T: std::convert::Into<crate::model::InternalRange>,
8908        {
8909            self.0.request.internal_range = std::option::Option::Some(v.into());
8910            self
8911        }
8912
8913        /// Sets or clears the value of [internal_range][crate::model::CreateInternalRangeRequest::internal_range].
8914        ///
8915        /// This is a **required** field for requests.
8916        pub fn set_or_clear_internal_range<T>(mut self, v: std::option::Option<T>) -> Self
8917        where
8918            T: std::convert::Into<crate::model::InternalRange>,
8919        {
8920            self.0.request.internal_range = v.map(|x| x.into());
8921            self
8922        }
8923
8924        /// Sets the value of [request_id][crate::model::CreateInternalRangeRequest::request_id].
8925        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
8926            self.0.request.request_id = v.into();
8927            self
8928        }
8929    }
8930
8931    #[doc(hidden)]
8932    impl gax::options::internal::RequestBuilder for CreateInternalRange {
8933        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8934            &mut self.0.options
8935        }
8936    }
8937
8938    /// The request builder for [InternalRangeService::update_internal_range][crate::client::InternalRangeService::update_internal_range] calls.
8939    ///
8940    /// # Example
8941    /// ```no_run
8942    /// # use google_cloud_networkconnectivity_v1::builder;
8943    /// use builder::internal_range_service::UpdateInternalRange;
8944    /// # tokio_test::block_on(async {
8945    /// use lro::Poller;
8946    ///
8947    /// let builder = prepare_request_builder();
8948    /// let response = builder.poller().until_done().await?;
8949    /// # gax::Result::<()>::Ok(()) });
8950    ///
8951    /// fn prepare_request_builder() -> UpdateInternalRange {
8952    ///   # panic!();
8953    ///   // ... details omitted ...
8954    /// }
8955    /// ```
8956    #[derive(Clone, Debug)]
8957    pub struct UpdateInternalRange(RequestBuilder<crate::model::UpdateInternalRangeRequest>);
8958
8959    impl UpdateInternalRange {
8960        pub(crate) fn new(
8961            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
8962        ) -> Self {
8963            Self(RequestBuilder::new(stub))
8964        }
8965
8966        /// Sets the full request, replacing any prior values.
8967        pub fn with_request<V: Into<crate::model::UpdateInternalRangeRequest>>(
8968            mut self,
8969            v: V,
8970        ) -> Self {
8971            self.0.request = v.into();
8972            self
8973        }
8974
8975        /// Sets all the options, replacing any prior values.
8976        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8977            self.0.options = v.into();
8978            self
8979        }
8980
8981        /// Sends the request.
8982        ///
8983        /// # Long running operations
8984        ///
8985        /// This starts, but does not poll, a longrunning operation. More information
8986        /// on [update_internal_range][crate::client::InternalRangeService::update_internal_range].
8987        pub async fn send(self) -> Result<longrunning::model::Operation> {
8988            (*self.0.stub)
8989                .update_internal_range(self.0.request, self.0.options)
8990                .await
8991                .map(gax::response::Response::into_body)
8992        }
8993
8994        /// Creates a [Poller][lro::Poller] to work with `update_internal_range`.
8995        pub fn poller(
8996            self,
8997        ) -> impl lro::Poller<crate::model::InternalRange, crate::model::OperationMetadata>
8998        {
8999            type Operation = lro::internal::Operation<
9000                crate::model::InternalRange,
9001                crate::model::OperationMetadata,
9002            >;
9003            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9004            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9005
9006            let stub = self.0.stub.clone();
9007            let mut options = self.0.options.clone();
9008            options.set_retry_policy(gax::retry_policy::NeverRetry);
9009            let query = move |name| {
9010                let stub = stub.clone();
9011                let options = options.clone();
9012                async {
9013                    let op = GetOperation::new(stub)
9014                        .set_name(name)
9015                        .with_options(options)
9016                        .send()
9017                        .await?;
9018                    Ok(Operation::new(op))
9019                }
9020            };
9021
9022            let start = move || async {
9023                let op = self.send().await?;
9024                Ok(Operation::new(op))
9025            };
9026
9027            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
9028        }
9029
9030        /// Sets the value of [update_mask][crate::model::UpdateInternalRangeRequest::update_mask].
9031        pub fn set_update_mask<T>(mut self, v: T) -> Self
9032        where
9033            T: std::convert::Into<wkt::FieldMask>,
9034        {
9035            self.0.request.update_mask = std::option::Option::Some(v.into());
9036            self
9037        }
9038
9039        /// Sets or clears the value of [update_mask][crate::model::UpdateInternalRangeRequest::update_mask].
9040        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
9041        where
9042            T: std::convert::Into<wkt::FieldMask>,
9043        {
9044            self.0.request.update_mask = v.map(|x| x.into());
9045            self
9046        }
9047
9048        /// Sets the value of [internal_range][crate::model::UpdateInternalRangeRequest::internal_range].
9049        ///
9050        /// This is a **required** field for requests.
9051        pub fn set_internal_range<T>(mut self, v: T) -> Self
9052        where
9053            T: std::convert::Into<crate::model::InternalRange>,
9054        {
9055            self.0.request.internal_range = std::option::Option::Some(v.into());
9056            self
9057        }
9058
9059        /// Sets or clears the value of [internal_range][crate::model::UpdateInternalRangeRequest::internal_range].
9060        ///
9061        /// This is a **required** field for requests.
9062        pub fn set_or_clear_internal_range<T>(mut self, v: std::option::Option<T>) -> Self
9063        where
9064            T: std::convert::Into<crate::model::InternalRange>,
9065        {
9066            self.0.request.internal_range = v.map(|x| x.into());
9067            self
9068        }
9069
9070        /// Sets the value of [request_id][crate::model::UpdateInternalRangeRequest::request_id].
9071        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9072            self.0.request.request_id = v.into();
9073            self
9074        }
9075    }
9076
9077    #[doc(hidden)]
9078    impl gax::options::internal::RequestBuilder for UpdateInternalRange {
9079        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9080            &mut self.0.options
9081        }
9082    }
9083
9084    /// The request builder for [InternalRangeService::delete_internal_range][crate::client::InternalRangeService::delete_internal_range] calls.
9085    ///
9086    /// # Example
9087    /// ```no_run
9088    /// # use google_cloud_networkconnectivity_v1::builder;
9089    /// use builder::internal_range_service::DeleteInternalRange;
9090    /// # tokio_test::block_on(async {
9091    /// use lro::Poller;
9092    ///
9093    /// let builder = prepare_request_builder();
9094    /// let response = builder.poller().until_done().await?;
9095    /// # gax::Result::<()>::Ok(()) });
9096    ///
9097    /// fn prepare_request_builder() -> DeleteInternalRange {
9098    ///   # panic!();
9099    ///   // ... details omitted ...
9100    /// }
9101    /// ```
9102    #[derive(Clone, Debug)]
9103    pub struct DeleteInternalRange(RequestBuilder<crate::model::DeleteInternalRangeRequest>);
9104
9105    impl DeleteInternalRange {
9106        pub(crate) fn new(
9107            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9108        ) -> Self {
9109            Self(RequestBuilder::new(stub))
9110        }
9111
9112        /// Sets the full request, replacing any prior values.
9113        pub fn with_request<V: Into<crate::model::DeleteInternalRangeRequest>>(
9114            mut self,
9115            v: V,
9116        ) -> Self {
9117            self.0.request = v.into();
9118            self
9119        }
9120
9121        /// Sets all the options, replacing any prior values.
9122        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9123            self.0.options = v.into();
9124            self
9125        }
9126
9127        /// Sends the request.
9128        ///
9129        /// # Long running operations
9130        ///
9131        /// This starts, but does not poll, a longrunning operation. More information
9132        /// on [delete_internal_range][crate::client::InternalRangeService::delete_internal_range].
9133        pub async fn send(self) -> Result<longrunning::model::Operation> {
9134            (*self.0.stub)
9135                .delete_internal_range(self.0.request, self.0.options)
9136                .await
9137                .map(gax::response::Response::into_body)
9138        }
9139
9140        /// Creates a [Poller][lro::Poller] to work with `delete_internal_range`.
9141        pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
9142            type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
9143            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9144            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9145
9146            let stub = self.0.stub.clone();
9147            let mut options = self.0.options.clone();
9148            options.set_retry_policy(gax::retry_policy::NeverRetry);
9149            let query = move |name| {
9150                let stub = stub.clone();
9151                let options = options.clone();
9152                async {
9153                    let op = GetOperation::new(stub)
9154                        .set_name(name)
9155                        .with_options(options)
9156                        .send()
9157                        .await?;
9158                    Ok(Operation::new(op))
9159                }
9160            };
9161
9162            let start = move || async {
9163                let op = self.send().await?;
9164                Ok(Operation::new(op))
9165            };
9166
9167            lro::internal::new_unit_response_poller(
9168                polling_error_policy,
9169                polling_backoff_policy,
9170                start,
9171                query,
9172            )
9173        }
9174
9175        /// Sets the value of [name][crate::model::DeleteInternalRangeRequest::name].
9176        ///
9177        /// This is a **required** field for requests.
9178        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9179            self.0.request.name = v.into();
9180            self
9181        }
9182
9183        /// Sets the value of [request_id][crate::model::DeleteInternalRangeRequest::request_id].
9184        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9185            self.0.request.request_id = v.into();
9186            self
9187        }
9188    }
9189
9190    #[doc(hidden)]
9191    impl gax::options::internal::RequestBuilder for DeleteInternalRange {
9192        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9193            &mut self.0.options
9194        }
9195    }
9196
9197    /// The request builder for [InternalRangeService::list_locations][crate::client::InternalRangeService::list_locations] calls.
9198    ///
9199    /// # Example
9200    /// ```no_run
9201    /// # use google_cloud_networkconnectivity_v1::builder;
9202    /// use builder::internal_range_service::ListLocations;
9203    /// # tokio_test::block_on(async {
9204    /// use gax::paginator::ItemPaginator;
9205    ///
9206    /// let builder = prepare_request_builder();
9207    /// let mut items = builder.by_item();
9208    /// while let Some(result) = items.next().await {
9209    ///   let item = result?;
9210    /// }
9211    /// # gax::Result::<()>::Ok(()) });
9212    ///
9213    /// fn prepare_request_builder() -> ListLocations {
9214    ///   # panic!();
9215    ///   // ... details omitted ...
9216    /// }
9217    /// ```
9218    #[derive(Clone, Debug)]
9219    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
9220
9221    impl ListLocations {
9222        pub(crate) fn new(
9223            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9224        ) -> Self {
9225            Self(RequestBuilder::new(stub))
9226        }
9227
9228        /// Sets the full request, replacing any prior values.
9229        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
9230            mut self,
9231            v: V,
9232        ) -> Self {
9233            self.0.request = v.into();
9234            self
9235        }
9236
9237        /// Sets all the options, replacing any prior values.
9238        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9239            self.0.options = v.into();
9240            self
9241        }
9242
9243        /// Sends the request.
9244        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
9245            (*self.0.stub)
9246                .list_locations(self.0.request, self.0.options)
9247                .await
9248                .map(gax::response::Response::into_body)
9249        }
9250
9251        /// Streams each page in the collection.
9252        pub fn by_page(
9253            self,
9254        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
9255        {
9256            use std::clone::Clone;
9257            let token = self.0.request.page_token.clone();
9258            let execute = move |token: String| {
9259                let mut builder = self.clone();
9260                builder.0.request = builder.0.request.set_page_token(token);
9261                builder.send()
9262            };
9263            gax::paginator::internal::new_paginator(token, execute)
9264        }
9265
9266        /// Streams each item in the collection.
9267        pub fn by_item(
9268            self,
9269        ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
9270        {
9271            use gax::paginator::Paginator;
9272            self.by_page().items()
9273        }
9274
9275        /// Sets the value of [name][location::model::ListLocationsRequest::name].
9276        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9277            self.0.request.name = v.into();
9278            self
9279        }
9280
9281        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
9282        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
9283            self.0.request.filter = v.into();
9284            self
9285        }
9286
9287        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
9288        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
9289            self.0.request.page_size = v.into();
9290            self
9291        }
9292
9293        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
9294        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
9295            self.0.request.page_token = v.into();
9296            self
9297        }
9298    }
9299
9300    #[doc(hidden)]
9301    impl gax::options::internal::RequestBuilder for ListLocations {
9302        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9303            &mut self.0.options
9304        }
9305    }
9306
9307    /// The request builder for [InternalRangeService::get_location][crate::client::InternalRangeService::get_location] calls.
9308    ///
9309    /// # Example
9310    /// ```no_run
9311    /// # use google_cloud_networkconnectivity_v1::builder;
9312    /// use builder::internal_range_service::GetLocation;
9313    /// # tokio_test::block_on(async {
9314    ///
9315    /// let builder = prepare_request_builder();
9316    /// let response = builder.send().await?;
9317    /// # gax::Result::<()>::Ok(()) });
9318    ///
9319    /// fn prepare_request_builder() -> GetLocation {
9320    ///   # panic!();
9321    ///   // ... details omitted ...
9322    /// }
9323    /// ```
9324    #[derive(Clone, Debug)]
9325    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
9326
9327    impl GetLocation {
9328        pub(crate) fn new(
9329            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9330        ) -> Self {
9331            Self(RequestBuilder::new(stub))
9332        }
9333
9334        /// Sets the full request, replacing any prior values.
9335        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
9336            self.0.request = v.into();
9337            self
9338        }
9339
9340        /// Sets all the options, replacing any prior values.
9341        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9342            self.0.options = v.into();
9343            self
9344        }
9345
9346        /// Sends the request.
9347        pub async fn send(self) -> Result<location::model::Location> {
9348            (*self.0.stub)
9349                .get_location(self.0.request, self.0.options)
9350                .await
9351                .map(gax::response::Response::into_body)
9352        }
9353
9354        /// Sets the value of [name][location::model::GetLocationRequest::name].
9355        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9356            self.0.request.name = v.into();
9357            self
9358        }
9359    }
9360
9361    #[doc(hidden)]
9362    impl gax::options::internal::RequestBuilder for GetLocation {
9363        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9364            &mut self.0.options
9365        }
9366    }
9367
9368    /// The request builder for [InternalRangeService::set_iam_policy][crate::client::InternalRangeService::set_iam_policy] calls.
9369    ///
9370    /// # Example
9371    /// ```no_run
9372    /// # use google_cloud_networkconnectivity_v1::builder;
9373    /// use builder::internal_range_service::SetIamPolicy;
9374    /// # tokio_test::block_on(async {
9375    ///
9376    /// let builder = prepare_request_builder();
9377    /// let response = builder.send().await?;
9378    /// # gax::Result::<()>::Ok(()) });
9379    ///
9380    /// fn prepare_request_builder() -> SetIamPolicy {
9381    ///   # panic!();
9382    ///   // ... details omitted ...
9383    /// }
9384    /// ```
9385    #[derive(Clone, Debug)]
9386    pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
9387
9388    impl SetIamPolicy {
9389        pub(crate) fn new(
9390            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9391        ) -> Self {
9392            Self(RequestBuilder::new(stub))
9393        }
9394
9395        /// Sets the full request, replacing any prior values.
9396        pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
9397            self.0.request = v.into();
9398            self
9399        }
9400
9401        /// Sets all the options, replacing any prior values.
9402        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9403            self.0.options = v.into();
9404            self
9405        }
9406
9407        /// Sends the request.
9408        pub async fn send(self) -> Result<iam_v1::model::Policy> {
9409            (*self.0.stub)
9410                .set_iam_policy(self.0.request, self.0.options)
9411                .await
9412                .map(gax::response::Response::into_body)
9413        }
9414
9415        /// Sets the value of [resource][iam_v1::model::SetIamPolicyRequest::resource].
9416        ///
9417        /// This is a **required** field for requests.
9418        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
9419            self.0.request.resource = v.into();
9420            self
9421        }
9422
9423        /// Sets the value of [policy][iam_v1::model::SetIamPolicyRequest::policy].
9424        ///
9425        /// This is a **required** field for requests.
9426        pub fn set_policy<T>(mut self, v: T) -> Self
9427        where
9428            T: std::convert::Into<iam_v1::model::Policy>,
9429        {
9430            self.0.request.policy = std::option::Option::Some(v.into());
9431            self
9432        }
9433
9434        /// Sets or clears the value of [policy][iam_v1::model::SetIamPolicyRequest::policy].
9435        ///
9436        /// This is a **required** field for requests.
9437        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
9438        where
9439            T: std::convert::Into<iam_v1::model::Policy>,
9440        {
9441            self.0.request.policy = v.map(|x| x.into());
9442            self
9443        }
9444
9445        /// Sets the value of [update_mask][iam_v1::model::SetIamPolicyRequest::update_mask].
9446        pub fn set_update_mask<T>(mut self, v: T) -> Self
9447        where
9448            T: std::convert::Into<wkt::FieldMask>,
9449        {
9450            self.0.request.update_mask = std::option::Option::Some(v.into());
9451            self
9452        }
9453
9454        /// Sets or clears the value of [update_mask][iam_v1::model::SetIamPolicyRequest::update_mask].
9455        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
9456        where
9457            T: std::convert::Into<wkt::FieldMask>,
9458        {
9459            self.0.request.update_mask = v.map(|x| x.into());
9460            self
9461        }
9462    }
9463
9464    #[doc(hidden)]
9465    impl gax::options::internal::RequestBuilder for SetIamPolicy {
9466        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9467            &mut self.0.options
9468        }
9469    }
9470
9471    /// The request builder for [InternalRangeService::get_iam_policy][crate::client::InternalRangeService::get_iam_policy] calls.
9472    ///
9473    /// # Example
9474    /// ```no_run
9475    /// # use google_cloud_networkconnectivity_v1::builder;
9476    /// use builder::internal_range_service::GetIamPolicy;
9477    /// # tokio_test::block_on(async {
9478    ///
9479    /// let builder = prepare_request_builder();
9480    /// let response = builder.send().await?;
9481    /// # gax::Result::<()>::Ok(()) });
9482    ///
9483    /// fn prepare_request_builder() -> GetIamPolicy {
9484    ///   # panic!();
9485    ///   // ... details omitted ...
9486    /// }
9487    /// ```
9488    #[derive(Clone, Debug)]
9489    pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
9490
9491    impl GetIamPolicy {
9492        pub(crate) fn new(
9493            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9494        ) -> Self {
9495            Self(RequestBuilder::new(stub))
9496        }
9497
9498        /// Sets the full request, replacing any prior values.
9499        pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
9500            self.0.request = v.into();
9501            self
9502        }
9503
9504        /// Sets all the options, replacing any prior values.
9505        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9506            self.0.options = v.into();
9507            self
9508        }
9509
9510        /// Sends the request.
9511        pub async fn send(self) -> Result<iam_v1::model::Policy> {
9512            (*self.0.stub)
9513                .get_iam_policy(self.0.request, self.0.options)
9514                .await
9515                .map(gax::response::Response::into_body)
9516        }
9517
9518        /// Sets the value of [resource][iam_v1::model::GetIamPolicyRequest::resource].
9519        ///
9520        /// This is a **required** field for requests.
9521        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
9522            self.0.request.resource = v.into();
9523            self
9524        }
9525
9526        /// Sets the value of [options][iam_v1::model::GetIamPolicyRequest::options].
9527        pub fn set_options<T>(mut self, v: T) -> Self
9528        where
9529            T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
9530        {
9531            self.0.request.options = std::option::Option::Some(v.into());
9532            self
9533        }
9534
9535        /// Sets or clears the value of [options][iam_v1::model::GetIamPolicyRequest::options].
9536        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
9537        where
9538            T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
9539        {
9540            self.0.request.options = v.map(|x| x.into());
9541            self
9542        }
9543    }
9544
9545    #[doc(hidden)]
9546    impl gax::options::internal::RequestBuilder for GetIamPolicy {
9547        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9548            &mut self.0.options
9549        }
9550    }
9551
9552    /// The request builder for [InternalRangeService::test_iam_permissions][crate::client::InternalRangeService::test_iam_permissions] calls.
9553    ///
9554    /// # Example
9555    /// ```no_run
9556    /// # use google_cloud_networkconnectivity_v1::builder;
9557    /// use builder::internal_range_service::TestIamPermissions;
9558    /// # tokio_test::block_on(async {
9559    ///
9560    /// let builder = prepare_request_builder();
9561    /// let response = builder.send().await?;
9562    /// # gax::Result::<()>::Ok(()) });
9563    ///
9564    /// fn prepare_request_builder() -> TestIamPermissions {
9565    ///   # panic!();
9566    ///   // ... details omitted ...
9567    /// }
9568    /// ```
9569    #[derive(Clone, Debug)]
9570    pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
9571
9572    impl TestIamPermissions {
9573        pub(crate) fn new(
9574            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9575        ) -> Self {
9576            Self(RequestBuilder::new(stub))
9577        }
9578
9579        /// Sets the full request, replacing any prior values.
9580        pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
9581            mut self,
9582            v: V,
9583        ) -> Self {
9584            self.0.request = v.into();
9585            self
9586        }
9587
9588        /// Sets all the options, replacing any prior values.
9589        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9590            self.0.options = v.into();
9591            self
9592        }
9593
9594        /// Sends the request.
9595        pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
9596            (*self.0.stub)
9597                .test_iam_permissions(self.0.request, self.0.options)
9598                .await
9599                .map(gax::response::Response::into_body)
9600        }
9601
9602        /// Sets the value of [resource][iam_v1::model::TestIamPermissionsRequest::resource].
9603        ///
9604        /// This is a **required** field for requests.
9605        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
9606            self.0.request.resource = v.into();
9607            self
9608        }
9609
9610        /// Sets the value of [permissions][iam_v1::model::TestIamPermissionsRequest::permissions].
9611        ///
9612        /// This is a **required** field for requests.
9613        pub fn set_permissions<T, V>(mut self, v: T) -> Self
9614        where
9615            T: std::iter::IntoIterator<Item = V>,
9616            V: std::convert::Into<std::string::String>,
9617        {
9618            use std::iter::Iterator;
9619            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
9620            self
9621        }
9622    }
9623
9624    #[doc(hidden)]
9625    impl gax::options::internal::RequestBuilder for TestIamPermissions {
9626        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9627            &mut self.0.options
9628        }
9629    }
9630
9631    /// The request builder for [InternalRangeService::list_operations][crate::client::InternalRangeService::list_operations] calls.
9632    ///
9633    /// # Example
9634    /// ```no_run
9635    /// # use google_cloud_networkconnectivity_v1::builder;
9636    /// use builder::internal_range_service::ListOperations;
9637    /// # tokio_test::block_on(async {
9638    /// use gax::paginator::ItemPaginator;
9639    ///
9640    /// let builder = prepare_request_builder();
9641    /// let mut items = builder.by_item();
9642    /// while let Some(result) = items.next().await {
9643    ///   let item = result?;
9644    /// }
9645    /// # gax::Result::<()>::Ok(()) });
9646    ///
9647    /// fn prepare_request_builder() -> ListOperations {
9648    ///   # panic!();
9649    ///   // ... details omitted ...
9650    /// }
9651    /// ```
9652    #[derive(Clone, Debug)]
9653    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
9654
9655    impl ListOperations {
9656        pub(crate) fn new(
9657            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9658        ) -> Self {
9659            Self(RequestBuilder::new(stub))
9660        }
9661
9662        /// Sets the full request, replacing any prior values.
9663        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
9664            mut self,
9665            v: V,
9666        ) -> Self {
9667            self.0.request = v.into();
9668            self
9669        }
9670
9671        /// Sets all the options, replacing any prior values.
9672        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9673            self.0.options = v.into();
9674            self
9675        }
9676
9677        /// Sends the request.
9678        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
9679            (*self.0.stub)
9680                .list_operations(self.0.request, self.0.options)
9681                .await
9682                .map(gax::response::Response::into_body)
9683        }
9684
9685        /// Streams each page in the collection.
9686        pub fn by_page(
9687            self,
9688        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
9689        {
9690            use std::clone::Clone;
9691            let token = self.0.request.page_token.clone();
9692            let execute = move |token: String| {
9693                let mut builder = self.clone();
9694                builder.0.request = builder.0.request.set_page_token(token);
9695                builder.send()
9696            };
9697            gax::paginator::internal::new_paginator(token, execute)
9698        }
9699
9700        /// Streams each item in the collection.
9701        pub fn by_item(
9702            self,
9703        ) -> impl gax::paginator::ItemPaginator<
9704            longrunning::model::ListOperationsResponse,
9705            gax::error::Error,
9706        > {
9707            use gax::paginator::Paginator;
9708            self.by_page().items()
9709        }
9710
9711        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
9712        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9713            self.0.request.name = v.into();
9714            self
9715        }
9716
9717        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
9718        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
9719            self.0.request.filter = v.into();
9720            self
9721        }
9722
9723        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
9724        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
9725            self.0.request.page_size = v.into();
9726            self
9727        }
9728
9729        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
9730        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
9731            self.0.request.page_token = v.into();
9732            self
9733        }
9734    }
9735
9736    #[doc(hidden)]
9737    impl gax::options::internal::RequestBuilder for ListOperations {
9738        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9739            &mut self.0.options
9740        }
9741    }
9742
9743    /// The request builder for [InternalRangeService::get_operation][crate::client::InternalRangeService::get_operation] calls.
9744    ///
9745    /// # Example
9746    /// ```no_run
9747    /// # use google_cloud_networkconnectivity_v1::builder;
9748    /// use builder::internal_range_service::GetOperation;
9749    /// # tokio_test::block_on(async {
9750    ///
9751    /// let builder = prepare_request_builder();
9752    /// let response = builder.send().await?;
9753    /// # gax::Result::<()>::Ok(()) });
9754    ///
9755    /// fn prepare_request_builder() -> GetOperation {
9756    ///   # panic!();
9757    ///   // ... details omitted ...
9758    /// }
9759    /// ```
9760    #[derive(Clone, Debug)]
9761    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
9762
9763    impl GetOperation {
9764        pub(crate) fn new(
9765            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9766        ) -> Self {
9767            Self(RequestBuilder::new(stub))
9768        }
9769
9770        /// Sets the full request, replacing any prior values.
9771        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
9772            mut self,
9773            v: V,
9774        ) -> Self {
9775            self.0.request = v.into();
9776            self
9777        }
9778
9779        /// Sets all the options, replacing any prior values.
9780        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9781            self.0.options = v.into();
9782            self
9783        }
9784
9785        /// Sends the request.
9786        pub async fn send(self) -> Result<longrunning::model::Operation> {
9787            (*self.0.stub)
9788                .get_operation(self.0.request, self.0.options)
9789                .await
9790                .map(gax::response::Response::into_body)
9791        }
9792
9793        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
9794        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9795            self.0.request.name = v.into();
9796            self
9797        }
9798    }
9799
9800    #[doc(hidden)]
9801    impl gax::options::internal::RequestBuilder for GetOperation {
9802        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9803            &mut self.0.options
9804        }
9805    }
9806
9807    /// The request builder for [InternalRangeService::delete_operation][crate::client::InternalRangeService::delete_operation] calls.
9808    ///
9809    /// # Example
9810    /// ```no_run
9811    /// # use google_cloud_networkconnectivity_v1::builder;
9812    /// use builder::internal_range_service::DeleteOperation;
9813    /// # tokio_test::block_on(async {
9814    ///
9815    /// let builder = prepare_request_builder();
9816    /// let response = builder.send().await?;
9817    /// # gax::Result::<()>::Ok(()) });
9818    ///
9819    /// fn prepare_request_builder() -> DeleteOperation {
9820    ///   # panic!();
9821    ///   // ... details omitted ...
9822    /// }
9823    /// ```
9824    #[derive(Clone, Debug)]
9825    pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
9826
9827    impl DeleteOperation {
9828        pub(crate) fn new(
9829            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9830        ) -> Self {
9831            Self(RequestBuilder::new(stub))
9832        }
9833
9834        /// Sets the full request, replacing any prior values.
9835        pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
9836            mut self,
9837            v: V,
9838        ) -> Self {
9839            self.0.request = v.into();
9840            self
9841        }
9842
9843        /// Sets all the options, replacing any prior values.
9844        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9845            self.0.options = v.into();
9846            self
9847        }
9848
9849        /// Sends the request.
9850        pub async fn send(self) -> Result<()> {
9851            (*self.0.stub)
9852                .delete_operation(self.0.request, self.0.options)
9853                .await
9854                .map(gax::response::Response::into_body)
9855        }
9856
9857        /// Sets the value of [name][longrunning::model::DeleteOperationRequest::name].
9858        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9859            self.0.request.name = v.into();
9860            self
9861        }
9862    }
9863
9864    #[doc(hidden)]
9865    impl gax::options::internal::RequestBuilder for DeleteOperation {
9866        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9867            &mut self.0.options
9868        }
9869    }
9870
9871    /// The request builder for [InternalRangeService::cancel_operation][crate::client::InternalRangeService::cancel_operation] calls.
9872    ///
9873    /// # Example
9874    /// ```no_run
9875    /// # use google_cloud_networkconnectivity_v1::builder;
9876    /// use builder::internal_range_service::CancelOperation;
9877    /// # tokio_test::block_on(async {
9878    ///
9879    /// let builder = prepare_request_builder();
9880    /// let response = builder.send().await?;
9881    /// # gax::Result::<()>::Ok(()) });
9882    ///
9883    /// fn prepare_request_builder() -> CancelOperation {
9884    ///   # panic!();
9885    ///   // ... details omitted ...
9886    /// }
9887    /// ```
9888    #[derive(Clone, Debug)]
9889    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
9890
9891    impl CancelOperation {
9892        pub(crate) fn new(
9893            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9894        ) -> Self {
9895            Self(RequestBuilder::new(stub))
9896        }
9897
9898        /// Sets the full request, replacing any prior values.
9899        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
9900            mut self,
9901            v: V,
9902        ) -> Self {
9903            self.0.request = v.into();
9904            self
9905        }
9906
9907        /// Sets all the options, replacing any prior values.
9908        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9909            self.0.options = v.into();
9910            self
9911        }
9912
9913        /// Sends the request.
9914        pub async fn send(self) -> Result<()> {
9915            (*self.0.stub)
9916                .cancel_operation(self.0.request, self.0.options)
9917                .await
9918                .map(gax::response::Response::into_body)
9919        }
9920
9921        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
9922        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9923            self.0.request.name = v.into();
9924            self
9925        }
9926    }
9927
9928    #[doc(hidden)]
9929    impl gax::options::internal::RequestBuilder for CancelOperation {
9930        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9931            &mut self.0.options
9932        }
9933    }
9934}
9935
9936pub mod policy_based_routing_service {
9937    use crate::Result;
9938
9939    /// A builder for [PolicyBasedRoutingService][crate::client::PolicyBasedRoutingService].
9940    ///
9941    /// ```
9942    /// # tokio_test::block_on(async {
9943    /// # use google_cloud_networkconnectivity_v1::*;
9944    /// # use builder::policy_based_routing_service::ClientBuilder;
9945    /// # use client::PolicyBasedRoutingService;
9946    /// let builder : ClientBuilder = PolicyBasedRoutingService::builder();
9947    /// let client = builder
9948    ///     .with_endpoint("https://networkconnectivity.googleapis.com")
9949    ///     .build().await?;
9950    /// # gax::client_builder::Result::<()>::Ok(()) });
9951    /// ```
9952    pub type ClientBuilder =
9953        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
9954
9955    pub(crate) mod client {
9956        use super::super::super::client::PolicyBasedRoutingService;
9957        pub struct Factory;
9958        impl gax::client_builder::internal::ClientFactory for Factory {
9959            type Client = PolicyBasedRoutingService;
9960            type Credentials = gaxi::options::Credentials;
9961            async fn build(
9962                self,
9963                config: gaxi::options::ClientConfig,
9964            ) -> gax::client_builder::Result<Self::Client> {
9965                Self::Client::new(config).await
9966            }
9967        }
9968    }
9969
9970    /// Common implementation for [crate::client::PolicyBasedRoutingService] request builders.
9971    #[derive(Clone, Debug)]
9972    pub(crate) struct RequestBuilder<R: std::default::Default> {
9973        stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
9974        request: R,
9975        options: gax::options::RequestOptions,
9976    }
9977
9978    impl<R> RequestBuilder<R>
9979    where
9980        R: std::default::Default,
9981    {
9982        pub(crate) fn new(
9983            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
9984        ) -> Self {
9985            Self {
9986                stub,
9987                request: R::default(),
9988                options: gax::options::RequestOptions::default(),
9989            }
9990        }
9991    }
9992
9993    /// The request builder for [PolicyBasedRoutingService::list_policy_based_routes][crate::client::PolicyBasedRoutingService::list_policy_based_routes] calls.
9994    ///
9995    /// # Example
9996    /// ```no_run
9997    /// # use google_cloud_networkconnectivity_v1::builder;
9998    /// use builder::policy_based_routing_service::ListPolicyBasedRoutes;
9999    /// # tokio_test::block_on(async {
10000    /// use gax::paginator::ItemPaginator;
10001    ///
10002    /// let builder = prepare_request_builder();
10003    /// let mut items = builder.by_item();
10004    /// while let Some(result) = items.next().await {
10005    ///   let item = result?;
10006    /// }
10007    /// # gax::Result::<()>::Ok(()) });
10008    ///
10009    /// fn prepare_request_builder() -> ListPolicyBasedRoutes {
10010    ///   # panic!();
10011    ///   // ... details omitted ...
10012    /// }
10013    /// ```
10014    #[derive(Clone, Debug)]
10015    pub struct ListPolicyBasedRoutes(RequestBuilder<crate::model::ListPolicyBasedRoutesRequest>);
10016
10017    impl ListPolicyBasedRoutes {
10018        pub(crate) fn new(
10019            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10020        ) -> Self {
10021            Self(RequestBuilder::new(stub))
10022        }
10023
10024        /// Sets the full request, replacing any prior values.
10025        pub fn with_request<V: Into<crate::model::ListPolicyBasedRoutesRequest>>(
10026            mut self,
10027            v: V,
10028        ) -> Self {
10029            self.0.request = v.into();
10030            self
10031        }
10032
10033        /// Sets all the options, replacing any prior values.
10034        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10035            self.0.options = v.into();
10036            self
10037        }
10038
10039        /// Sends the request.
10040        pub async fn send(self) -> Result<crate::model::ListPolicyBasedRoutesResponse> {
10041            (*self.0.stub)
10042                .list_policy_based_routes(self.0.request, self.0.options)
10043                .await
10044                .map(gax::response::Response::into_body)
10045        }
10046
10047        /// Streams each page in the collection.
10048        pub fn by_page(
10049            self,
10050        ) -> impl gax::paginator::Paginator<crate::model::ListPolicyBasedRoutesResponse, gax::error::Error>
10051        {
10052            use std::clone::Clone;
10053            let token = self.0.request.page_token.clone();
10054            let execute = move |token: String| {
10055                let mut builder = self.clone();
10056                builder.0.request = builder.0.request.set_page_token(token);
10057                builder.send()
10058            };
10059            gax::paginator::internal::new_paginator(token, execute)
10060        }
10061
10062        /// Streams each item in the collection.
10063        pub fn by_item(
10064            self,
10065        ) -> impl gax::paginator::ItemPaginator<
10066            crate::model::ListPolicyBasedRoutesResponse,
10067            gax::error::Error,
10068        > {
10069            use gax::paginator::Paginator;
10070            self.by_page().items()
10071        }
10072
10073        /// Sets the value of [parent][crate::model::ListPolicyBasedRoutesRequest::parent].
10074        ///
10075        /// This is a **required** field for requests.
10076        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
10077            self.0.request.parent = v.into();
10078            self
10079        }
10080
10081        /// Sets the value of [page_size][crate::model::ListPolicyBasedRoutesRequest::page_size].
10082        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
10083            self.0.request.page_size = v.into();
10084            self
10085        }
10086
10087        /// Sets the value of [page_token][crate::model::ListPolicyBasedRoutesRequest::page_token].
10088        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
10089            self.0.request.page_token = v.into();
10090            self
10091        }
10092
10093        /// Sets the value of [filter][crate::model::ListPolicyBasedRoutesRequest::filter].
10094        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
10095            self.0.request.filter = v.into();
10096            self
10097        }
10098
10099        /// Sets the value of [order_by][crate::model::ListPolicyBasedRoutesRequest::order_by].
10100        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
10101            self.0.request.order_by = v.into();
10102            self
10103        }
10104    }
10105
10106    #[doc(hidden)]
10107    impl gax::options::internal::RequestBuilder for ListPolicyBasedRoutes {
10108        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10109            &mut self.0.options
10110        }
10111    }
10112
10113    /// The request builder for [PolicyBasedRoutingService::get_policy_based_route][crate::client::PolicyBasedRoutingService::get_policy_based_route] calls.
10114    ///
10115    /// # Example
10116    /// ```no_run
10117    /// # use google_cloud_networkconnectivity_v1::builder;
10118    /// use builder::policy_based_routing_service::GetPolicyBasedRoute;
10119    /// # tokio_test::block_on(async {
10120    ///
10121    /// let builder = prepare_request_builder();
10122    /// let response = builder.send().await?;
10123    /// # gax::Result::<()>::Ok(()) });
10124    ///
10125    /// fn prepare_request_builder() -> GetPolicyBasedRoute {
10126    ///   # panic!();
10127    ///   // ... details omitted ...
10128    /// }
10129    /// ```
10130    #[derive(Clone, Debug)]
10131    pub struct GetPolicyBasedRoute(RequestBuilder<crate::model::GetPolicyBasedRouteRequest>);
10132
10133    impl GetPolicyBasedRoute {
10134        pub(crate) fn new(
10135            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10136        ) -> Self {
10137            Self(RequestBuilder::new(stub))
10138        }
10139
10140        /// Sets the full request, replacing any prior values.
10141        pub fn with_request<V: Into<crate::model::GetPolicyBasedRouteRequest>>(
10142            mut self,
10143            v: V,
10144        ) -> Self {
10145            self.0.request = v.into();
10146            self
10147        }
10148
10149        /// Sets all the options, replacing any prior values.
10150        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10151            self.0.options = v.into();
10152            self
10153        }
10154
10155        /// Sends the request.
10156        pub async fn send(self) -> Result<crate::model::PolicyBasedRoute> {
10157            (*self.0.stub)
10158                .get_policy_based_route(self.0.request, self.0.options)
10159                .await
10160                .map(gax::response::Response::into_body)
10161        }
10162
10163        /// Sets the value of [name][crate::model::GetPolicyBasedRouteRequest::name].
10164        ///
10165        /// This is a **required** field for requests.
10166        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10167            self.0.request.name = v.into();
10168            self
10169        }
10170    }
10171
10172    #[doc(hidden)]
10173    impl gax::options::internal::RequestBuilder for GetPolicyBasedRoute {
10174        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10175            &mut self.0.options
10176        }
10177    }
10178
10179    /// The request builder for [PolicyBasedRoutingService::create_policy_based_route][crate::client::PolicyBasedRoutingService::create_policy_based_route] calls.
10180    ///
10181    /// # Example
10182    /// ```no_run
10183    /// # use google_cloud_networkconnectivity_v1::builder;
10184    /// use builder::policy_based_routing_service::CreatePolicyBasedRoute;
10185    /// # tokio_test::block_on(async {
10186    /// use lro::Poller;
10187    ///
10188    /// let builder = prepare_request_builder();
10189    /// let response = builder.poller().until_done().await?;
10190    /// # gax::Result::<()>::Ok(()) });
10191    ///
10192    /// fn prepare_request_builder() -> CreatePolicyBasedRoute {
10193    ///   # panic!();
10194    ///   // ... details omitted ...
10195    /// }
10196    /// ```
10197    #[derive(Clone, Debug)]
10198    pub struct CreatePolicyBasedRoute(RequestBuilder<crate::model::CreatePolicyBasedRouteRequest>);
10199
10200    impl CreatePolicyBasedRoute {
10201        pub(crate) fn new(
10202            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10203        ) -> Self {
10204            Self(RequestBuilder::new(stub))
10205        }
10206
10207        /// Sets the full request, replacing any prior values.
10208        pub fn with_request<V: Into<crate::model::CreatePolicyBasedRouteRequest>>(
10209            mut self,
10210            v: V,
10211        ) -> Self {
10212            self.0.request = v.into();
10213            self
10214        }
10215
10216        /// Sets all the options, replacing any prior values.
10217        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10218            self.0.options = v.into();
10219            self
10220        }
10221
10222        /// Sends the request.
10223        ///
10224        /// # Long running operations
10225        ///
10226        /// This starts, but does not poll, a longrunning operation. More information
10227        /// on [create_policy_based_route][crate::client::PolicyBasedRoutingService::create_policy_based_route].
10228        pub async fn send(self) -> Result<longrunning::model::Operation> {
10229            (*self.0.stub)
10230                .create_policy_based_route(self.0.request, self.0.options)
10231                .await
10232                .map(gax::response::Response::into_body)
10233        }
10234
10235        /// Creates a [Poller][lro::Poller] to work with `create_policy_based_route`.
10236        pub fn poller(
10237            self,
10238        ) -> impl lro::Poller<crate::model::PolicyBasedRoute, crate::model::OperationMetadata>
10239        {
10240            type Operation = lro::internal::Operation<
10241                crate::model::PolicyBasedRoute,
10242                crate::model::OperationMetadata,
10243            >;
10244            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
10245            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
10246
10247            let stub = self.0.stub.clone();
10248            let mut options = self.0.options.clone();
10249            options.set_retry_policy(gax::retry_policy::NeverRetry);
10250            let query = move |name| {
10251                let stub = stub.clone();
10252                let options = options.clone();
10253                async {
10254                    let op = GetOperation::new(stub)
10255                        .set_name(name)
10256                        .with_options(options)
10257                        .send()
10258                        .await?;
10259                    Ok(Operation::new(op))
10260                }
10261            };
10262
10263            let start = move || async {
10264                let op = self.send().await?;
10265                Ok(Operation::new(op))
10266            };
10267
10268            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
10269        }
10270
10271        /// Sets the value of [parent][crate::model::CreatePolicyBasedRouteRequest::parent].
10272        ///
10273        /// This is a **required** field for requests.
10274        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
10275            self.0.request.parent = v.into();
10276            self
10277        }
10278
10279        /// Sets the value of [policy_based_route_id][crate::model::CreatePolicyBasedRouteRequest::policy_based_route_id].
10280        ///
10281        /// This is a **required** field for requests.
10282        pub fn set_policy_based_route_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
10283            self.0.request.policy_based_route_id = v.into();
10284            self
10285        }
10286
10287        /// Sets the value of [policy_based_route][crate::model::CreatePolicyBasedRouteRequest::policy_based_route].
10288        ///
10289        /// This is a **required** field for requests.
10290        pub fn set_policy_based_route<T>(mut self, v: T) -> Self
10291        where
10292            T: std::convert::Into<crate::model::PolicyBasedRoute>,
10293        {
10294            self.0.request.policy_based_route = std::option::Option::Some(v.into());
10295            self
10296        }
10297
10298        /// Sets or clears the value of [policy_based_route][crate::model::CreatePolicyBasedRouteRequest::policy_based_route].
10299        ///
10300        /// This is a **required** field for requests.
10301        pub fn set_or_clear_policy_based_route<T>(mut self, v: std::option::Option<T>) -> Self
10302        where
10303            T: std::convert::Into<crate::model::PolicyBasedRoute>,
10304        {
10305            self.0.request.policy_based_route = v.map(|x| x.into());
10306            self
10307        }
10308
10309        /// Sets the value of [request_id][crate::model::CreatePolicyBasedRouteRequest::request_id].
10310        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
10311            self.0.request.request_id = v.into();
10312            self
10313        }
10314    }
10315
10316    #[doc(hidden)]
10317    impl gax::options::internal::RequestBuilder for CreatePolicyBasedRoute {
10318        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10319            &mut self.0.options
10320        }
10321    }
10322
10323    /// The request builder for [PolicyBasedRoutingService::delete_policy_based_route][crate::client::PolicyBasedRoutingService::delete_policy_based_route] calls.
10324    ///
10325    /// # Example
10326    /// ```no_run
10327    /// # use google_cloud_networkconnectivity_v1::builder;
10328    /// use builder::policy_based_routing_service::DeletePolicyBasedRoute;
10329    /// # tokio_test::block_on(async {
10330    /// use lro::Poller;
10331    ///
10332    /// let builder = prepare_request_builder();
10333    /// let response = builder.poller().until_done().await?;
10334    /// # gax::Result::<()>::Ok(()) });
10335    ///
10336    /// fn prepare_request_builder() -> DeletePolicyBasedRoute {
10337    ///   # panic!();
10338    ///   // ... details omitted ...
10339    /// }
10340    /// ```
10341    #[derive(Clone, Debug)]
10342    pub struct DeletePolicyBasedRoute(RequestBuilder<crate::model::DeletePolicyBasedRouteRequest>);
10343
10344    impl DeletePolicyBasedRoute {
10345        pub(crate) fn new(
10346            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10347        ) -> Self {
10348            Self(RequestBuilder::new(stub))
10349        }
10350
10351        /// Sets the full request, replacing any prior values.
10352        pub fn with_request<V: Into<crate::model::DeletePolicyBasedRouteRequest>>(
10353            mut self,
10354            v: V,
10355        ) -> Self {
10356            self.0.request = v.into();
10357            self
10358        }
10359
10360        /// Sets all the options, replacing any prior values.
10361        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10362            self.0.options = v.into();
10363            self
10364        }
10365
10366        /// Sends the request.
10367        ///
10368        /// # Long running operations
10369        ///
10370        /// This starts, but does not poll, a longrunning operation. More information
10371        /// on [delete_policy_based_route][crate::client::PolicyBasedRoutingService::delete_policy_based_route].
10372        pub async fn send(self) -> Result<longrunning::model::Operation> {
10373            (*self.0.stub)
10374                .delete_policy_based_route(self.0.request, self.0.options)
10375                .await
10376                .map(gax::response::Response::into_body)
10377        }
10378
10379        /// Creates a [Poller][lro::Poller] to work with `delete_policy_based_route`.
10380        pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
10381            type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
10382            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
10383            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
10384
10385            let stub = self.0.stub.clone();
10386            let mut options = self.0.options.clone();
10387            options.set_retry_policy(gax::retry_policy::NeverRetry);
10388            let query = move |name| {
10389                let stub = stub.clone();
10390                let options = options.clone();
10391                async {
10392                    let op = GetOperation::new(stub)
10393                        .set_name(name)
10394                        .with_options(options)
10395                        .send()
10396                        .await?;
10397                    Ok(Operation::new(op))
10398                }
10399            };
10400
10401            let start = move || async {
10402                let op = self.send().await?;
10403                Ok(Operation::new(op))
10404            };
10405
10406            lro::internal::new_unit_response_poller(
10407                polling_error_policy,
10408                polling_backoff_policy,
10409                start,
10410                query,
10411            )
10412        }
10413
10414        /// Sets the value of [name][crate::model::DeletePolicyBasedRouteRequest::name].
10415        ///
10416        /// This is a **required** field for requests.
10417        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10418            self.0.request.name = v.into();
10419            self
10420        }
10421
10422        /// Sets the value of [request_id][crate::model::DeletePolicyBasedRouteRequest::request_id].
10423        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
10424            self.0.request.request_id = v.into();
10425            self
10426        }
10427    }
10428
10429    #[doc(hidden)]
10430    impl gax::options::internal::RequestBuilder for DeletePolicyBasedRoute {
10431        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10432            &mut self.0.options
10433        }
10434    }
10435
10436    /// The request builder for [PolicyBasedRoutingService::list_locations][crate::client::PolicyBasedRoutingService::list_locations] calls.
10437    ///
10438    /// # Example
10439    /// ```no_run
10440    /// # use google_cloud_networkconnectivity_v1::builder;
10441    /// use builder::policy_based_routing_service::ListLocations;
10442    /// # tokio_test::block_on(async {
10443    /// use gax::paginator::ItemPaginator;
10444    ///
10445    /// let builder = prepare_request_builder();
10446    /// let mut items = builder.by_item();
10447    /// while let Some(result) = items.next().await {
10448    ///   let item = result?;
10449    /// }
10450    /// # gax::Result::<()>::Ok(()) });
10451    ///
10452    /// fn prepare_request_builder() -> ListLocations {
10453    ///   # panic!();
10454    ///   // ... details omitted ...
10455    /// }
10456    /// ```
10457    #[derive(Clone, Debug)]
10458    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
10459
10460    impl ListLocations {
10461        pub(crate) fn new(
10462            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10463        ) -> Self {
10464            Self(RequestBuilder::new(stub))
10465        }
10466
10467        /// Sets the full request, replacing any prior values.
10468        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
10469            mut self,
10470            v: V,
10471        ) -> Self {
10472            self.0.request = v.into();
10473            self
10474        }
10475
10476        /// Sets all the options, replacing any prior values.
10477        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10478            self.0.options = v.into();
10479            self
10480        }
10481
10482        /// Sends the request.
10483        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
10484            (*self.0.stub)
10485                .list_locations(self.0.request, self.0.options)
10486                .await
10487                .map(gax::response::Response::into_body)
10488        }
10489
10490        /// Streams each page in the collection.
10491        pub fn by_page(
10492            self,
10493        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
10494        {
10495            use std::clone::Clone;
10496            let token = self.0.request.page_token.clone();
10497            let execute = move |token: String| {
10498                let mut builder = self.clone();
10499                builder.0.request = builder.0.request.set_page_token(token);
10500                builder.send()
10501            };
10502            gax::paginator::internal::new_paginator(token, execute)
10503        }
10504
10505        /// Streams each item in the collection.
10506        pub fn by_item(
10507            self,
10508        ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
10509        {
10510            use gax::paginator::Paginator;
10511            self.by_page().items()
10512        }
10513
10514        /// Sets the value of [name][location::model::ListLocationsRequest::name].
10515        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10516            self.0.request.name = v.into();
10517            self
10518        }
10519
10520        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
10521        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
10522            self.0.request.filter = v.into();
10523            self
10524        }
10525
10526        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
10527        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
10528            self.0.request.page_size = v.into();
10529            self
10530        }
10531
10532        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
10533        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
10534            self.0.request.page_token = v.into();
10535            self
10536        }
10537    }
10538
10539    #[doc(hidden)]
10540    impl gax::options::internal::RequestBuilder for ListLocations {
10541        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10542            &mut self.0.options
10543        }
10544    }
10545
10546    /// The request builder for [PolicyBasedRoutingService::get_location][crate::client::PolicyBasedRoutingService::get_location] calls.
10547    ///
10548    /// # Example
10549    /// ```no_run
10550    /// # use google_cloud_networkconnectivity_v1::builder;
10551    /// use builder::policy_based_routing_service::GetLocation;
10552    /// # tokio_test::block_on(async {
10553    ///
10554    /// let builder = prepare_request_builder();
10555    /// let response = builder.send().await?;
10556    /// # gax::Result::<()>::Ok(()) });
10557    ///
10558    /// fn prepare_request_builder() -> GetLocation {
10559    ///   # panic!();
10560    ///   // ... details omitted ...
10561    /// }
10562    /// ```
10563    #[derive(Clone, Debug)]
10564    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
10565
10566    impl GetLocation {
10567        pub(crate) fn new(
10568            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10569        ) -> Self {
10570            Self(RequestBuilder::new(stub))
10571        }
10572
10573        /// Sets the full request, replacing any prior values.
10574        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
10575            self.0.request = v.into();
10576            self
10577        }
10578
10579        /// Sets all the options, replacing any prior values.
10580        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10581            self.0.options = v.into();
10582            self
10583        }
10584
10585        /// Sends the request.
10586        pub async fn send(self) -> Result<location::model::Location> {
10587            (*self.0.stub)
10588                .get_location(self.0.request, self.0.options)
10589                .await
10590                .map(gax::response::Response::into_body)
10591        }
10592
10593        /// Sets the value of [name][location::model::GetLocationRequest::name].
10594        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10595            self.0.request.name = v.into();
10596            self
10597        }
10598    }
10599
10600    #[doc(hidden)]
10601    impl gax::options::internal::RequestBuilder for GetLocation {
10602        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10603            &mut self.0.options
10604        }
10605    }
10606
10607    /// The request builder for [PolicyBasedRoutingService::set_iam_policy][crate::client::PolicyBasedRoutingService::set_iam_policy] calls.
10608    ///
10609    /// # Example
10610    /// ```no_run
10611    /// # use google_cloud_networkconnectivity_v1::builder;
10612    /// use builder::policy_based_routing_service::SetIamPolicy;
10613    /// # tokio_test::block_on(async {
10614    ///
10615    /// let builder = prepare_request_builder();
10616    /// let response = builder.send().await?;
10617    /// # gax::Result::<()>::Ok(()) });
10618    ///
10619    /// fn prepare_request_builder() -> SetIamPolicy {
10620    ///   # panic!();
10621    ///   // ... details omitted ...
10622    /// }
10623    /// ```
10624    #[derive(Clone, Debug)]
10625    pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
10626
10627    impl SetIamPolicy {
10628        pub(crate) fn new(
10629            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10630        ) -> Self {
10631            Self(RequestBuilder::new(stub))
10632        }
10633
10634        /// Sets the full request, replacing any prior values.
10635        pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
10636            self.0.request = v.into();
10637            self
10638        }
10639
10640        /// Sets all the options, replacing any prior values.
10641        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10642            self.0.options = v.into();
10643            self
10644        }
10645
10646        /// Sends the request.
10647        pub async fn send(self) -> Result<iam_v1::model::Policy> {
10648            (*self.0.stub)
10649                .set_iam_policy(self.0.request, self.0.options)
10650                .await
10651                .map(gax::response::Response::into_body)
10652        }
10653
10654        /// Sets the value of [resource][iam_v1::model::SetIamPolicyRequest::resource].
10655        ///
10656        /// This is a **required** field for requests.
10657        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
10658            self.0.request.resource = v.into();
10659            self
10660        }
10661
10662        /// Sets the value of [policy][iam_v1::model::SetIamPolicyRequest::policy].
10663        ///
10664        /// This is a **required** field for requests.
10665        pub fn set_policy<T>(mut self, v: T) -> Self
10666        where
10667            T: std::convert::Into<iam_v1::model::Policy>,
10668        {
10669            self.0.request.policy = std::option::Option::Some(v.into());
10670            self
10671        }
10672
10673        /// Sets or clears the value of [policy][iam_v1::model::SetIamPolicyRequest::policy].
10674        ///
10675        /// This is a **required** field for requests.
10676        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
10677        where
10678            T: std::convert::Into<iam_v1::model::Policy>,
10679        {
10680            self.0.request.policy = v.map(|x| x.into());
10681            self
10682        }
10683
10684        /// Sets the value of [update_mask][iam_v1::model::SetIamPolicyRequest::update_mask].
10685        pub fn set_update_mask<T>(mut self, v: T) -> Self
10686        where
10687            T: std::convert::Into<wkt::FieldMask>,
10688        {
10689            self.0.request.update_mask = std::option::Option::Some(v.into());
10690            self
10691        }
10692
10693        /// Sets or clears the value of [update_mask][iam_v1::model::SetIamPolicyRequest::update_mask].
10694        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
10695        where
10696            T: std::convert::Into<wkt::FieldMask>,
10697        {
10698            self.0.request.update_mask = v.map(|x| x.into());
10699            self
10700        }
10701    }
10702
10703    #[doc(hidden)]
10704    impl gax::options::internal::RequestBuilder for SetIamPolicy {
10705        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10706            &mut self.0.options
10707        }
10708    }
10709
10710    /// The request builder for [PolicyBasedRoutingService::get_iam_policy][crate::client::PolicyBasedRoutingService::get_iam_policy] calls.
10711    ///
10712    /// # Example
10713    /// ```no_run
10714    /// # use google_cloud_networkconnectivity_v1::builder;
10715    /// use builder::policy_based_routing_service::GetIamPolicy;
10716    /// # tokio_test::block_on(async {
10717    ///
10718    /// let builder = prepare_request_builder();
10719    /// let response = builder.send().await?;
10720    /// # gax::Result::<()>::Ok(()) });
10721    ///
10722    /// fn prepare_request_builder() -> GetIamPolicy {
10723    ///   # panic!();
10724    ///   // ... details omitted ...
10725    /// }
10726    /// ```
10727    #[derive(Clone, Debug)]
10728    pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
10729
10730    impl GetIamPolicy {
10731        pub(crate) fn new(
10732            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10733        ) -> Self {
10734            Self(RequestBuilder::new(stub))
10735        }
10736
10737        /// Sets the full request, replacing any prior values.
10738        pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
10739            self.0.request = v.into();
10740            self
10741        }
10742
10743        /// Sets all the options, replacing any prior values.
10744        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10745            self.0.options = v.into();
10746            self
10747        }
10748
10749        /// Sends the request.
10750        pub async fn send(self) -> Result<iam_v1::model::Policy> {
10751            (*self.0.stub)
10752                .get_iam_policy(self.0.request, self.0.options)
10753                .await
10754                .map(gax::response::Response::into_body)
10755        }
10756
10757        /// Sets the value of [resource][iam_v1::model::GetIamPolicyRequest::resource].
10758        ///
10759        /// This is a **required** field for requests.
10760        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
10761            self.0.request.resource = v.into();
10762            self
10763        }
10764
10765        /// Sets the value of [options][iam_v1::model::GetIamPolicyRequest::options].
10766        pub fn set_options<T>(mut self, v: T) -> Self
10767        where
10768            T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
10769        {
10770            self.0.request.options = std::option::Option::Some(v.into());
10771            self
10772        }
10773
10774        /// Sets or clears the value of [options][iam_v1::model::GetIamPolicyRequest::options].
10775        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
10776        where
10777            T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
10778        {
10779            self.0.request.options = v.map(|x| x.into());
10780            self
10781        }
10782    }
10783
10784    #[doc(hidden)]
10785    impl gax::options::internal::RequestBuilder for GetIamPolicy {
10786        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10787            &mut self.0.options
10788        }
10789    }
10790
10791    /// The request builder for [PolicyBasedRoutingService::test_iam_permissions][crate::client::PolicyBasedRoutingService::test_iam_permissions] calls.
10792    ///
10793    /// # Example
10794    /// ```no_run
10795    /// # use google_cloud_networkconnectivity_v1::builder;
10796    /// use builder::policy_based_routing_service::TestIamPermissions;
10797    /// # tokio_test::block_on(async {
10798    ///
10799    /// let builder = prepare_request_builder();
10800    /// let response = builder.send().await?;
10801    /// # gax::Result::<()>::Ok(()) });
10802    ///
10803    /// fn prepare_request_builder() -> TestIamPermissions {
10804    ///   # panic!();
10805    ///   // ... details omitted ...
10806    /// }
10807    /// ```
10808    #[derive(Clone, Debug)]
10809    pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
10810
10811    impl TestIamPermissions {
10812        pub(crate) fn new(
10813            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10814        ) -> Self {
10815            Self(RequestBuilder::new(stub))
10816        }
10817
10818        /// Sets the full request, replacing any prior values.
10819        pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
10820            mut self,
10821            v: V,
10822        ) -> Self {
10823            self.0.request = v.into();
10824            self
10825        }
10826
10827        /// Sets all the options, replacing any prior values.
10828        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10829            self.0.options = v.into();
10830            self
10831        }
10832
10833        /// Sends the request.
10834        pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
10835            (*self.0.stub)
10836                .test_iam_permissions(self.0.request, self.0.options)
10837                .await
10838                .map(gax::response::Response::into_body)
10839        }
10840
10841        /// Sets the value of [resource][iam_v1::model::TestIamPermissionsRequest::resource].
10842        ///
10843        /// This is a **required** field for requests.
10844        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
10845            self.0.request.resource = v.into();
10846            self
10847        }
10848
10849        /// Sets the value of [permissions][iam_v1::model::TestIamPermissionsRequest::permissions].
10850        ///
10851        /// This is a **required** field for requests.
10852        pub fn set_permissions<T, V>(mut self, v: T) -> Self
10853        where
10854            T: std::iter::IntoIterator<Item = V>,
10855            V: std::convert::Into<std::string::String>,
10856        {
10857            use std::iter::Iterator;
10858            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
10859            self
10860        }
10861    }
10862
10863    #[doc(hidden)]
10864    impl gax::options::internal::RequestBuilder for TestIamPermissions {
10865        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10866            &mut self.0.options
10867        }
10868    }
10869
10870    /// The request builder for [PolicyBasedRoutingService::list_operations][crate::client::PolicyBasedRoutingService::list_operations] calls.
10871    ///
10872    /// # Example
10873    /// ```no_run
10874    /// # use google_cloud_networkconnectivity_v1::builder;
10875    /// use builder::policy_based_routing_service::ListOperations;
10876    /// # tokio_test::block_on(async {
10877    /// use gax::paginator::ItemPaginator;
10878    ///
10879    /// let builder = prepare_request_builder();
10880    /// let mut items = builder.by_item();
10881    /// while let Some(result) = items.next().await {
10882    ///   let item = result?;
10883    /// }
10884    /// # gax::Result::<()>::Ok(()) });
10885    ///
10886    /// fn prepare_request_builder() -> ListOperations {
10887    ///   # panic!();
10888    ///   // ... details omitted ...
10889    /// }
10890    /// ```
10891    #[derive(Clone, Debug)]
10892    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
10893
10894    impl ListOperations {
10895        pub(crate) fn new(
10896            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10897        ) -> Self {
10898            Self(RequestBuilder::new(stub))
10899        }
10900
10901        /// Sets the full request, replacing any prior values.
10902        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
10903            mut self,
10904            v: V,
10905        ) -> Self {
10906            self.0.request = v.into();
10907            self
10908        }
10909
10910        /// Sets all the options, replacing any prior values.
10911        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10912            self.0.options = v.into();
10913            self
10914        }
10915
10916        /// Sends the request.
10917        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
10918            (*self.0.stub)
10919                .list_operations(self.0.request, self.0.options)
10920                .await
10921                .map(gax::response::Response::into_body)
10922        }
10923
10924        /// Streams each page in the collection.
10925        pub fn by_page(
10926            self,
10927        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
10928        {
10929            use std::clone::Clone;
10930            let token = self.0.request.page_token.clone();
10931            let execute = move |token: String| {
10932                let mut builder = self.clone();
10933                builder.0.request = builder.0.request.set_page_token(token);
10934                builder.send()
10935            };
10936            gax::paginator::internal::new_paginator(token, execute)
10937        }
10938
10939        /// Streams each item in the collection.
10940        pub fn by_item(
10941            self,
10942        ) -> impl gax::paginator::ItemPaginator<
10943            longrunning::model::ListOperationsResponse,
10944            gax::error::Error,
10945        > {
10946            use gax::paginator::Paginator;
10947            self.by_page().items()
10948        }
10949
10950        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
10951        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10952            self.0.request.name = v.into();
10953            self
10954        }
10955
10956        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
10957        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
10958            self.0.request.filter = v.into();
10959            self
10960        }
10961
10962        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
10963        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
10964            self.0.request.page_size = v.into();
10965            self
10966        }
10967
10968        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
10969        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
10970            self.0.request.page_token = v.into();
10971            self
10972        }
10973    }
10974
10975    #[doc(hidden)]
10976    impl gax::options::internal::RequestBuilder for ListOperations {
10977        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10978            &mut self.0.options
10979        }
10980    }
10981
10982    /// The request builder for [PolicyBasedRoutingService::get_operation][crate::client::PolicyBasedRoutingService::get_operation] calls.
10983    ///
10984    /// # Example
10985    /// ```no_run
10986    /// # use google_cloud_networkconnectivity_v1::builder;
10987    /// use builder::policy_based_routing_service::GetOperation;
10988    /// # tokio_test::block_on(async {
10989    ///
10990    /// let builder = prepare_request_builder();
10991    /// let response = builder.send().await?;
10992    /// # gax::Result::<()>::Ok(()) });
10993    ///
10994    /// fn prepare_request_builder() -> GetOperation {
10995    ///   # panic!();
10996    ///   // ... details omitted ...
10997    /// }
10998    /// ```
10999    #[derive(Clone, Debug)]
11000    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
11001
11002    impl GetOperation {
11003        pub(crate) fn new(
11004            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
11005        ) -> Self {
11006            Self(RequestBuilder::new(stub))
11007        }
11008
11009        /// Sets the full request, replacing any prior values.
11010        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
11011            mut self,
11012            v: V,
11013        ) -> Self {
11014            self.0.request = v.into();
11015            self
11016        }
11017
11018        /// Sets all the options, replacing any prior values.
11019        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11020            self.0.options = v.into();
11021            self
11022        }
11023
11024        /// Sends the request.
11025        pub async fn send(self) -> Result<longrunning::model::Operation> {
11026            (*self.0.stub)
11027                .get_operation(self.0.request, self.0.options)
11028                .await
11029                .map(gax::response::Response::into_body)
11030        }
11031
11032        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
11033        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11034            self.0.request.name = v.into();
11035            self
11036        }
11037    }
11038
11039    #[doc(hidden)]
11040    impl gax::options::internal::RequestBuilder for GetOperation {
11041        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11042            &mut self.0.options
11043        }
11044    }
11045
11046    /// The request builder for [PolicyBasedRoutingService::delete_operation][crate::client::PolicyBasedRoutingService::delete_operation] calls.
11047    ///
11048    /// # Example
11049    /// ```no_run
11050    /// # use google_cloud_networkconnectivity_v1::builder;
11051    /// use builder::policy_based_routing_service::DeleteOperation;
11052    /// # tokio_test::block_on(async {
11053    ///
11054    /// let builder = prepare_request_builder();
11055    /// let response = builder.send().await?;
11056    /// # gax::Result::<()>::Ok(()) });
11057    ///
11058    /// fn prepare_request_builder() -> DeleteOperation {
11059    ///   # panic!();
11060    ///   // ... details omitted ...
11061    /// }
11062    /// ```
11063    #[derive(Clone, Debug)]
11064    pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
11065
11066    impl DeleteOperation {
11067        pub(crate) fn new(
11068            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
11069        ) -> Self {
11070            Self(RequestBuilder::new(stub))
11071        }
11072
11073        /// Sets the full request, replacing any prior values.
11074        pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
11075            mut self,
11076            v: V,
11077        ) -> Self {
11078            self.0.request = v.into();
11079            self
11080        }
11081
11082        /// Sets all the options, replacing any prior values.
11083        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11084            self.0.options = v.into();
11085            self
11086        }
11087
11088        /// Sends the request.
11089        pub async fn send(self) -> Result<()> {
11090            (*self.0.stub)
11091                .delete_operation(self.0.request, self.0.options)
11092                .await
11093                .map(gax::response::Response::into_body)
11094        }
11095
11096        /// Sets the value of [name][longrunning::model::DeleteOperationRequest::name].
11097        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11098            self.0.request.name = v.into();
11099            self
11100        }
11101    }
11102
11103    #[doc(hidden)]
11104    impl gax::options::internal::RequestBuilder for DeleteOperation {
11105        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11106            &mut self.0.options
11107        }
11108    }
11109
11110    /// The request builder for [PolicyBasedRoutingService::cancel_operation][crate::client::PolicyBasedRoutingService::cancel_operation] calls.
11111    ///
11112    /// # Example
11113    /// ```no_run
11114    /// # use google_cloud_networkconnectivity_v1::builder;
11115    /// use builder::policy_based_routing_service::CancelOperation;
11116    /// # tokio_test::block_on(async {
11117    ///
11118    /// let builder = prepare_request_builder();
11119    /// let response = builder.send().await?;
11120    /// # gax::Result::<()>::Ok(()) });
11121    ///
11122    /// fn prepare_request_builder() -> CancelOperation {
11123    ///   # panic!();
11124    ///   // ... details omitted ...
11125    /// }
11126    /// ```
11127    #[derive(Clone, Debug)]
11128    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
11129
11130    impl CancelOperation {
11131        pub(crate) fn new(
11132            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
11133        ) -> Self {
11134            Self(RequestBuilder::new(stub))
11135        }
11136
11137        /// Sets the full request, replacing any prior values.
11138        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
11139            mut self,
11140            v: V,
11141        ) -> Self {
11142            self.0.request = v.into();
11143            self
11144        }
11145
11146        /// Sets all the options, replacing any prior values.
11147        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11148            self.0.options = v.into();
11149            self
11150        }
11151
11152        /// Sends the request.
11153        pub async fn send(self) -> Result<()> {
11154            (*self.0.stub)
11155                .cancel_operation(self.0.request, self.0.options)
11156                .await
11157                .map(gax::response::Response::into_body)
11158        }
11159
11160        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
11161        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11162            self.0.request.name = v.into();
11163            self
11164        }
11165    }
11166
11167    #[doc(hidden)]
11168    impl gax::options::internal::RequestBuilder for CancelOperation {
11169        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11170            &mut self.0.options
11171        }
11172    }
11173}