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