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