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    use std::sync::Arc;
20
21    /// A builder for [CrossNetworkAutomationService][super::super::client::CrossNetworkAutomationService].
22    ///
23    /// ```
24    /// # tokio_test::block_on(async {
25    /// # use google_cloud_networkconnectivity_v1::*;
26    /// # use builder::cross_network_automation_service::ClientBuilder;
27    /// # use client::CrossNetworkAutomationService;
28    /// let builder : ClientBuilder = CrossNetworkAutomationService::builder();
29    /// let client = builder
30    ///     .with_endpoint("https://networkconnectivity.googleapis.com")
31    ///     .build().await?;
32    /// # gax::Result::<()>::Ok(()) });
33    /// ```
34    pub type ClientBuilder =
35        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
36
37    pub(crate) mod client {
38        use super::super::super::client::CrossNetworkAutomationService;
39        pub struct Factory;
40        impl gax::client_builder::internal::ClientFactory for Factory {
41            type Client = CrossNetworkAutomationService;
42            type Credentials = gaxi::options::Credentials;
43            async fn build(self, config: gaxi::options::ClientConfig) -> gax::Result<Self::Client> {
44                Self::Client::new(config).await
45            }
46        }
47    }
48
49    /// Common implementation for [super::super::client::CrossNetworkAutomationService] request builders.
50    #[derive(Clone, Debug)]
51    pub(crate) struct RequestBuilder<R: std::default::Default> {
52        stub: Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
53        request: R,
54        options: gax::options::RequestOptions,
55    }
56
57    impl<R> RequestBuilder<R>
58    where
59        R: std::default::Default,
60    {
61        pub(crate) fn new(
62            stub: Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
63        ) -> Self {
64            Self {
65                stub,
66                request: R::default(),
67                options: gax::options::RequestOptions::default(),
68            }
69        }
70    }
71
72    /// The request builder for [CrossNetworkAutomationService::list_service_connection_maps][super::super::client::CrossNetworkAutomationService::list_service_connection_maps] calls.
73    #[derive(Clone, Debug)]
74    pub struct ListServiceConnectionMaps(
75        RequestBuilder<crate::model::ListServiceConnectionMapsRequest>,
76    );
77
78    impl ListServiceConnectionMaps {
79        pub(crate) fn new(
80            stub: Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
81        ) -> Self {
82            Self(RequestBuilder::new(stub))
83        }
84
85        /// Sets the full request, replacing any prior values.
86        pub fn with_request<V: Into<crate::model::ListServiceConnectionMapsRequest>>(
87            mut self,
88            v: V,
89        ) -> Self {
90            self.0.request = v.into();
91            self
92        }
93
94        /// Sets all the options, replacing any prior values.
95        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
96            self.0.options = v.into();
97            self
98        }
99
100        /// Sends the request.
101        pub async fn send(self) -> Result<crate::model::ListServiceConnectionMapsResponse> {
102            (*self.0.stub)
103                .list_service_connection_maps(self.0.request, self.0.options)
104                .await
105                .map(gax::response::Response::into_body)
106        }
107
108        /// Streams the responses back.
109        pub async fn paginator(
110            self,
111        ) -> impl gax::paginator::Paginator<
112            crate::model::ListServiceConnectionMapsResponse,
113            gax::error::Error,
114        > {
115            use std::clone::Clone;
116            let token = self.0.request.page_token.clone();
117            let execute = move |token: String| {
118                let mut builder = self.clone();
119                builder.0.request = builder.0.request.set_page_token(token);
120                builder.send()
121            };
122            gax::paginator::internal::new_paginator(token, execute)
123        }
124
125        /// Sets the value of [parent][crate::model::ListServiceConnectionMapsRequest::parent].
126        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
127            self.0.request.parent = v.into();
128            self
129        }
130
131        /// Sets the value of [page_size][crate::model::ListServiceConnectionMapsRequest::page_size].
132        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
133            self.0.request.page_size = v.into();
134            self
135        }
136
137        /// Sets the value of [page_token][crate::model::ListServiceConnectionMapsRequest::page_token].
138        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
139            self.0.request.page_token = v.into();
140            self
141        }
142
143        /// Sets the value of [filter][crate::model::ListServiceConnectionMapsRequest::filter].
144        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
145            self.0.request.filter = v.into();
146            self
147        }
148
149        /// Sets the value of [order_by][crate::model::ListServiceConnectionMapsRequest::order_by].
150        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
151            self.0.request.order_by = v.into();
152            self
153        }
154    }
155
156    #[doc(hidden)]
157    impl gax::options::internal::RequestBuilder for ListServiceConnectionMaps {
158        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
159            &mut self.0.options
160        }
161    }
162
163    /// The request builder for [CrossNetworkAutomationService::get_service_connection_map][super::super::client::CrossNetworkAutomationService::get_service_connection_map] calls.
164    #[derive(Clone, Debug)]
165    pub struct GetServiceConnectionMap(
166        RequestBuilder<crate::model::GetServiceConnectionMapRequest>,
167    );
168
169    impl GetServiceConnectionMap {
170        pub(crate) fn new(
171            stub: Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
172        ) -> Self {
173            Self(RequestBuilder::new(stub))
174        }
175
176        /// Sets the full request, replacing any prior values.
177        pub fn with_request<V: Into<crate::model::GetServiceConnectionMapRequest>>(
178            mut self,
179            v: V,
180        ) -> Self {
181            self.0.request = v.into();
182            self
183        }
184
185        /// Sets all the options, replacing any prior values.
186        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
187            self.0.options = v.into();
188            self
189        }
190
191        /// Sends the request.
192        pub async fn send(self) -> Result<crate::model::ServiceConnectionMap> {
193            (*self.0.stub)
194                .get_service_connection_map(self.0.request, self.0.options)
195                .await
196                .map(gax::response::Response::into_body)
197        }
198
199        /// Sets the value of [name][crate::model::GetServiceConnectionMapRequest::name].
200        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
201            self.0.request.name = v.into();
202            self
203        }
204    }
205
206    #[doc(hidden)]
207    impl gax::options::internal::RequestBuilder for GetServiceConnectionMap {
208        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
209            &mut self.0.options
210        }
211    }
212
213    /// The request builder for [CrossNetworkAutomationService::create_service_connection_map][super::super::client::CrossNetworkAutomationService::create_service_connection_map] calls.
214    #[derive(Clone, Debug)]
215    pub struct CreateServiceConnectionMap(
216        RequestBuilder<crate::model::CreateServiceConnectionMapRequest>,
217    );
218
219    impl CreateServiceConnectionMap {
220        pub(crate) fn new(
221            stub: Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
222        ) -> Self {
223            Self(RequestBuilder::new(stub))
224        }
225
226        /// Sets the full request, replacing any prior values.
227        pub fn with_request<V: Into<crate::model::CreateServiceConnectionMapRequest>>(
228            mut self,
229            v: V,
230        ) -> Self {
231            self.0.request = v.into();
232            self
233        }
234
235        /// Sets all the options, replacing any prior values.
236        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
237            self.0.options = v.into();
238            self
239        }
240
241        /// Sends the request.
242        ///
243        /// # Long running operations
244        ///
245        /// This starts, but does not poll, a longrunning operation. More information
246        /// on [create_service_connection_map][super::super::client::CrossNetworkAutomationService::create_service_connection_map].
247        pub async fn send(self) -> Result<longrunning::model::Operation> {
248            (*self.0.stub)
249                .create_service_connection_map(self.0.request, self.0.options)
250                .await
251                .map(gax::response::Response::into_body)
252        }
253
254        /// Creates a [Poller][lro::Poller] to work with `create_service_connection_map`.
255        pub fn poller(
256            self,
257        ) -> impl lro::Poller<crate::model::ServiceConnectionMap, crate::model::OperationMetadata>
258        {
259            type Operation =
260                lro::Operation<crate::model::ServiceConnectionMap, crate::model::OperationMetadata>;
261            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
262            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
263
264            let stub = self.0.stub.clone();
265            let mut options = self.0.options.clone();
266            options.set_retry_policy(gax::retry_policy::NeverRetry);
267            let query = move |name| {
268                let stub = stub.clone();
269                let options = options.clone();
270                async {
271                    let op = GetOperation::new(stub)
272                        .set_name(name)
273                        .with_options(options)
274                        .send()
275                        .await?;
276                    Ok(Operation::new(op))
277                }
278            };
279
280            let start = move || async {
281                let op = self.send().await?;
282                Ok(Operation::new(op))
283            };
284
285            lro::new_poller(polling_error_policy, polling_backoff_policy, start, query)
286        }
287
288        /// Sets the value of [parent][crate::model::CreateServiceConnectionMapRequest::parent].
289        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
290            self.0.request.parent = v.into();
291            self
292        }
293
294        /// Sets the value of [service_connection_map_id][crate::model::CreateServiceConnectionMapRequest::service_connection_map_id].
295        pub fn set_service_connection_map_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
296            self.0.request.service_connection_map_id = v.into();
297            self
298        }
299
300        /// Sets the value of [service_connection_map][crate::model::CreateServiceConnectionMapRequest::service_connection_map].
301        pub fn set_service_connection_map<
302            T: Into<std::option::Option<crate::model::ServiceConnectionMap>>,
303        >(
304            mut self,
305            v: T,
306        ) -> Self {
307            self.0.request.service_connection_map = v.into();
308            self
309        }
310
311        /// Sets the value of [request_id][crate::model::CreateServiceConnectionMapRequest::request_id].
312        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
313            self.0.request.request_id = v.into();
314            self
315        }
316    }
317
318    #[doc(hidden)]
319    impl gax::options::internal::RequestBuilder for CreateServiceConnectionMap {
320        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
321            &mut self.0.options
322        }
323    }
324
325    /// The request builder for [CrossNetworkAutomationService::update_service_connection_map][super::super::client::CrossNetworkAutomationService::update_service_connection_map] calls.
326    #[derive(Clone, Debug)]
327    pub struct UpdateServiceConnectionMap(
328        RequestBuilder<crate::model::UpdateServiceConnectionMapRequest>,
329    );
330
331    impl UpdateServiceConnectionMap {
332        pub(crate) fn new(
333            stub: Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
334        ) -> Self {
335            Self(RequestBuilder::new(stub))
336        }
337
338        /// Sets the full request, replacing any prior values.
339        pub fn with_request<V: Into<crate::model::UpdateServiceConnectionMapRequest>>(
340            mut self,
341            v: V,
342        ) -> Self {
343            self.0.request = v.into();
344            self
345        }
346
347        /// Sets all the options, replacing any prior values.
348        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
349            self.0.options = v.into();
350            self
351        }
352
353        /// Sends the request.
354        ///
355        /// # Long running operations
356        ///
357        /// This starts, but does not poll, a longrunning operation. More information
358        /// on [update_service_connection_map][super::super::client::CrossNetworkAutomationService::update_service_connection_map].
359        pub async fn send(self) -> Result<longrunning::model::Operation> {
360            (*self.0.stub)
361                .update_service_connection_map(self.0.request, self.0.options)
362                .await
363                .map(gax::response::Response::into_body)
364        }
365
366        /// Creates a [Poller][lro::Poller] to work with `update_service_connection_map`.
367        pub fn poller(
368            self,
369        ) -> impl lro::Poller<crate::model::ServiceConnectionMap, crate::model::OperationMetadata>
370        {
371            type Operation =
372                lro::Operation<crate::model::ServiceConnectionMap, crate::model::OperationMetadata>;
373            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
374            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
375
376            let stub = self.0.stub.clone();
377            let mut options = self.0.options.clone();
378            options.set_retry_policy(gax::retry_policy::NeverRetry);
379            let query = move |name| {
380                let stub = stub.clone();
381                let options = options.clone();
382                async {
383                    let op = GetOperation::new(stub)
384                        .set_name(name)
385                        .with_options(options)
386                        .send()
387                        .await?;
388                    Ok(Operation::new(op))
389                }
390            };
391
392            let start = move || async {
393                let op = self.send().await?;
394                Ok(Operation::new(op))
395            };
396
397            lro::new_poller(polling_error_policy, polling_backoff_policy, start, query)
398        }
399
400        /// Sets the value of [update_mask][crate::model::UpdateServiceConnectionMapRequest::update_mask].
401        pub fn set_update_mask<T: Into<std::option::Option<wkt::FieldMask>>>(
402            mut self,
403            v: T,
404        ) -> Self {
405            self.0.request.update_mask = v.into();
406            self
407        }
408
409        /// Sets the value of [service_connection_map][crate::model::UpdateServiceConnectionMapRequest::service_connection_map].
410        pub fn set_service_connection_map<
411            T: Into<std::option::Option<crate::model::ServiceConnectionMap>>,
412        >(
413            mut self,
414            v: T,
415        ) -> Self {
416            self.0.request.service_connection_map = v.into();
417            self
418        }
419
420        /// Sets the value of [request_id][crate::model::UpdateServiceConnectionMapRequest::request_id].
421        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
422            self.0.request.request_id = v.into();
423            self
424        }
425    }
426
427    #[doc(hidden)]
428    impl gax::options::internal::RequestBuilder for UpdateServiceConnectionMap {
429        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
430            &mut self.0.options
431        }
432    }
433
434    /// The request builder for [CrossNetworkAutomationService::delete_service_connection_map][super::super::client::CrossNetworkAutomationService::delete_service_connection_map] calls.
435    #[derive(Clone, Debug)]
436    pub struct DeleteServiceConnectionMap(
437        RequestBuilder<crate::model::DeleteServiceConnectionMapRequest>,
438    );
439
440    impl DeleteServiceConnectionMap {
441        pub(crate) fn new(
442            stub: Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
443        ) -> Self {
444            Self(RequestBuilder::new(stub))
445        }
446
447        /// Sets the full request, replacing any prior values.
448        pub fn with_request<V: Into<crate::model::DeleteServiceConnectionMapRequest>>(
449            mut self,
450            v: V,
451        ) -> Self {
452            self.0.request = v.into();
453            self
454        }
455
456        /// Sets all the options, replacing any prior values.
457        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
458            self.0.options = v.into();
459            self
460        }
461
462        /// Sends the request.
463        ///
464        /// # Long running operations
465        ///
466        /// This starts, but does not poll, a longrunning operation. More information
467        /// on [delete_service_connection_map][super::super::client::CrossNetworkAutomationService::delete_service_connection_map].
468        pub async fn send(self) -> Result<longrunning::model::Operation> {
469            (*self.0.stub)
470                .delete_service_connection_map(self.0.request, self.0.options)
471                .await
472                .map(gax::response::Response::into_body)
473        }
474
475        /// Creates a [Poller][lro::Poller] to work with `delete_service_connection_map`.
476        pub fn poller(self) -> impl lro::Poller<wkt::Empty, crate::model::OperationMetadata> {
477            type Operation = lro::Operation<wkt::Empty, crate::model::OperationMetadata>;
478            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
479            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
480
481            let stub = self.0.stub.clone();
482            let mut options = self.0.options.clone();
483            options.set_retry_policy(gax::retry_policy::NeverRetry);
484            let query = move |name| {
485                let stub = stub.clone();
486                let options = options.clone();
487                async {
488                    let op = GetOperation::new(stub)
489                        .set_name(name)
490                        .with_options(options)
491                        .send()
492                        .await?;
493                    Ok(Operation::new(op))
494                }
495            };
496
497            let start = move || async {
498                let op = self.send().await?;
499                Ok(Operation::new(op))
500            };
501
502            lro::new_poller(polling_error_policy, polling_backoff_policy, start, query)
503        }
504
505        /// Sets the value of [name][crate::model::DeleteServiceConnectionMapRequest::name].
506        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
507            self.0.request.name = v.into();
508            self
509        }
510
511        /// Sets the value of [request_id][crate::model::DeleteServiceConnectionMapRequest::request_id].
512        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
513            self.0.request.request_id = v.into();
514            self
515        }
516
517        /// Sets the value of [etag][crate::model::DeleteServiceConnectionMapRequest::etag].
518        pub fn set_etag<T: Into<std::option::Option<std::string::String>>>(mut self, v: T) -> Self {
519            self.0.request.etag = v.into();
520            self
521        }
522    }
523
524    #[doc(hidden)]
525    impl gax::options::internal::RequestBuilder for DeleteServiceConnectionMap {
526        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
527            &mut self.0.options
528        }
529    }
530
531    /// The request builder for [CrossNetworkAutomationService::list_service_connection_policies][super::super::client::CrossNetworkAutomationService::list_service_connection_policies] calls.
532    #[derive(Clone, Debug)]
533    pub struct ListServiceConnectionPolicies(
534        RequestBuilder<crate::model::ListServiceConnectionPoliciesRequest>,
535    );
536
537    impl ListServiceConnectionPolicies {
538        pub(crate) fn new(
539            stub: Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
540        ) -> Self {
541            Self(RequestBuilder::new(stub))
542        }
543
544        /// Sets the full request, replacing any prior values.
545        pub fn with_request<V: Into<crate::model::ListServiceConnectionPoliciesRequest>>(
546            mut self,
547            v: V,
548        ) -> Self {
549            self.0.request = v.into();
550            self
551        }
552
553        /// Sets all the options, replacing any prior values.
554        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
555            self.0.options = v.into();
556            self
557        }
558
559        /// Sends the request.
560        pub async fn send(self) -> Result<crate::model::ListServiceConnectionPoliciesResponse> {
561            (*self.0.stub)
562                .list_service_connection_policies(self.0.request, self.0.options)
563                .await
564                .map(gax::response::Response::into_body)
565        }
566
567        /// Streams the responses back.
568        pub async fn paginator(
569            self,
570        ) -> impl gax::paginator::Paginator<
571            crate::model::ListServiceConnectionPoliciesResponse,
572            gax::error::Error,
573        > {
574            use std::clone::Clone;
575            let token = self.0.request.page_token.clone();
576            let execute = move |token: String| {
577                let mut builder = self.clone();
578                builder.0.request = builder.0.request.set_page_token(token);
579                builder.send()
580            };
581            gax::paginator::internal::new_paginator(token, execute)
582        }
583
584        /// Sets the value of [parent][crate::model::ListServiceConnectionPoliciesRequest::parent].
585        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
586            self.0.request.parent = v.into();
587            self
588        }
589
590        /// Sets the value of [page_size][crate::model::ListServiceConnectionPoliciesRequest::page_size].
591        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
592            self.0.request.page_size = v.into();
593            self
594        }
595
596        /// Sets the value of [page_token][crate::model::ListServiceConnectionPoliciesRequest::page_token].
597        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
598            self.0.request.page_token = v.into();
599            self
600        }
601
602        /// Sets the value of [filter][crate::model::ListServiceConnectionPoliciesRequest::filter].
603        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
604            self.0.request.filter = v.into();
605            self
606        }
607
608        /// Sets the value of [order_by][crate::model::ListServiceConnectionPoliciesRequest::order_by].
609        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
610            self.0.request.order_by = v.into();
611            self
612        }
613    }
614
615    #[doc(hidden)]
616    impl gax::options::internal::RequestBuilder for ListServiceConnectionPolicies {
617        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
618            &mut self.0.options
619        }
620    }
621
622    /// The request builder for [CrossNetworkAutomationService::get_service_connection_policy][super::super::client::CrossNetworkAutomationService::get_service_connection_policy] calls.
623    #[derive(Clone, Debug)]
624    pub struct GetServiceConnectionPolicy(
625        RequestBuilder<crate::model::GetServiceConnectionPolicyRequest>,
626    );
627
628    impl GetServiceConnectionPolicy {
629        pub(crate) fn new(
630            stub: Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
631        ) -> Self {
632            Self(RequestBuilder::new(stub))
633        }
634
635        /// Sets the full request, replacing any prior values.
636        pub fn with_request<V: Into<crate::model::GetServiceConnectionPolicyRequest>>(
637            mut self,
638            v: V,
639        ) -> Self {
640            self.0.request = v.into();
641            self
642        }
643
644        /// Sets all the options, replacing any prior values.
645        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
646            self.0.options = v.into();
647            self
648        }
649
650        /// Sends the request.
651        pub async fn send(self) -> Result<crate::model::ServiceConnectionPolicy> {
652            (*self.0.stub)
653                .get_service_connection_policy(self.0.request, self.0.options)
654                .await
655                .map(gax::response::Response::into_body)
656        }
657
658        /// Sets the value of [name][crate::model::GetServiceConnectionPolicyRequest::name].
659        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
660            self.0.request.name = v.into();
661            self
662        }
663    }
664
665    #[doc(hidden)]
666    impl gax::options::internal::RequestBuilder for GetServiceConnectionPolicy {
667        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
668            &mut self.0.options
669        }
670    }
671
672    /// The request builder for [CrossNetworkAutomationService::create_service_connection_policy][super::super::client::CrossNetworkAutomationService::create_service_connection_policy] calls.
673    #[derive(Clone, Debug)]
674    pub struct CreateServiceConnectionPolicy(
675        RequestBuilder<crate::model::CreateServiceConnectionPolicyRequest>,
676    );
677
678    impl CreateServiceConnectionPolicy {
679        pub(crate) fn new(
680            stub: Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
681        ) -> Self {
682            Self(RequestBuilder::new(stub))
683        }
684
685        /// Sets the full request, replacing any prior values.
686        pub fn with_request<V: Into<crate::model::CreateServiceConnectionPolicyRequest>>(
687            mut self,
688            v: V,
689        ) -> Self {
690            self.0.request = v.into();
691            self
692        }
693
694        /// Sets all the options, replacing any prior values.
695        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
696            self.0.options = v.into();
697            self
698        }
699
700        /// Sends the request.
701        ///
702        /// # Long running operations
703        ///
704        /// This starts, but does not poll, a longrunning operation. More information
705        /// on [create_service_connection_policy][super::super::client::CrossNetworkAutomationService::create_service_connection_policy].
706        pub async fn send(self) -> Result<longrunning::model::Operation> {
707            (*self.0.stub)
708                .create_service_connection_policy(self.0.request, self.0.options)
709                .await
710                .map(gax::response::Response::into_body)
711        }
712
713        /// Creates a [Poller][lro::Poller] to work with `create_service_connection_policy`.
714        pub fn poller(
715            self,
716        ) -> impl lro::Poller<crate::model::ServiceConnectionPolicy, crate::model::OperationMetadata>
717        {
718            type Operation = lro::Operation<
719                crate::model::ServiceConnectionPolicy,
720                crate::model::OperationMetadata,
721            >;
722            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
723            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
724
725            let stub = self.0.stub.clone();
726            let mut options = self.0.options.clone();
727            options.set_retry_policy(gax::retry_policy::NeverRetry);
728            let query = move |name| {
729                let stub = stub.clone();
730                let options = options.clone();
731                async {
732                    let op = GetOperation::new(stub)
733                        .set_name(name)
734                        .with_options(options)
735                        .send()
736                        .await?;
737                    Ok(Operation::new(op))
738                }
739            };
740
741            let start = move || async {
742                let op = self.send().await?;
743                Ok(Operation::new(op))
744            };
745
746            lro::new_poller(polling_error_policy, polling_backoff_policy, start, query)
747        }
748
749        /// Sets the value of [parent][crate::model::CreateServiceConnectionPolicyRequest::parent].
750        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
751            self.0.request.parent = v.into();
752            self
753        }
754
755        /// Sets the value of [service_connection_policy_id][crate::model::CreateServiceConnectionPolicyRequest::service_connection_policy_id].
756        pub fn set_service_connection_policy_id<T: Into<std::string::String>>(
757            mut self,
758            v: T,
759        ) -> Self {
760            self.0.request.service_connection_policy_id = v.into();
761            self
762        }
763
764        /// Sets the value of [service_connection_policy][crate::model::CreateServiceConnectionPolicyRequest::service_connection_policy].
765        pub fn set_service_connection_policy<
766            T: Into<std::option::Option<crate::model::ServiceConnectionPolicy>>,
767        >(
768            mut self,
769            v: T,
770        ) -> Self {
771            self.0.request.service_connection_policy = v.into();
772            self
773        }
774
775        /// Sets the value of [request_id][crate::model::CreateServiceConnectionPolicyRequest::request_id].
776        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
777            self.0.request.request_id = v.into();
778            self
779        }
780    }
781
782    #[doc(hidden)]
783    impl gax::options::internal::RequestBuilder for CreateServiceConnectionPolicy {
784        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
785            &mut self.0.options
786        }
787    }
788
789    /// The request builder for [CrossNetworkAutomationService::update_service_connection_policy][super::super::client::CrossNetworkAutomationService::update_service_connection_policy] calls.
790    #[derive(Clone, Debug)]
791    pub struct UpdateServiceConnectionPolicy(
792        RequestBuilder<crate::model::UpdateServiceConnectionPolicyRequest>,
793    );
794
795    impl UpdateServiceConnectionPolicy {
796        pub(crate) fn new(
797            stub: Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
798        ) -> Self {
799            Self(RequestBuilder::new(stub))
800        }
801
802        /// Sets the full request, replacing any prior values.
803        pub fn with_request<V: Into<crate::model::UpdateServiceConnectionPolicyRequest>>(
804            mut self,
805            v: V,
806        ) -> Self {
807            self.0.request = v.into();
808            self
809        }
810
811        /// Sets all the options, replacing any prior values.
812        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
813            self.0.options = v.into();
814            self
815        }
816
817        /// Sends the request.
818        ///
819        /// # Long running operations
820        ///
821        /// This starts, but does not poll, a longrunning operation. More information
822        /// on [update_service_connection_policy][super::super::client::CrossNetworkAutomationService::update_service_connection_policy].
823        pub async fn send(self) -> Result<longrunning::model::Operation> {
824            (*self.0.stub)
825                .update_service_connection_policy(self.0.request, self.0.options)
826                .await
827                .map(gax::response::Response::into_body)
828        }
829
830        /// Creates a [Poller][lro::Poller] to work with `update_service_connection_policy`.
831        pub fn poller(
832            self,
833        ) -> impl lro::Poller<crate::model::ServiceConnectionPolicy, crate::model::OperationMetadata>
834        {
835            type Operation = lro::Operation<
836                crate::model::ServiceConnectionPolicy,
837                crate::model::OperationMetadata,
838            >;
839            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
840            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
841
842            let stub = self.0.stub.clone();
843            let mut options = self.0.options.clone();
844            options.set_retry_policy(gax::retry_policy::NeverRetry);
845            let query = move |name| {
846                let stub = stub.clone();
847                let options = options.clone();
848                async {
849                    let op = GetOperation::new(stub)
850                        .set_name(name)
851                        .with_options(options)
852                        .send()
853                        .await?;
854                    Ok(Operation::new(op))
855                }
856            };
857
858            let start = move || async {
859                let op = self.send().await?;
860                Ok(Operation::new(op))
861            };
862
863            lro::new_poller(polling_error_policy, polling_backoff_policy, start, query)
864        }
865
866        /// Sets the value of [update_mask][crate::model::UpdateServiceConnectionPolicyRequest::update_mask].
867        pub fn set_update_mask<T: Into<std::option::Option<wkt::FieldMask>>>(
868            mut self,
869            v: T,
870        ) -> Self {
871            self.0.request.update_mask = v.into();
872            self
873        }
874
875        /// Sets the value of [service_connection_policy][crate::model::UpdateServiceConnectionPolicyRequest::service_connection_policy].
876        pub fn set_service_connection_policy<
877            T: Into<std::option::Option<crate::model::ServiceConnectionPolicy>>,
878        >(
879            mut self,
880            v: T,
881        ) -> Self {
882            self.0.request.service_connection_policy = v.into();
883            self
884        }
885
886        /// Sets the value of [request_id][crate::model::UpdateServiceConnectionPolicyRequest::request_id].
887        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
888            self.0.request.request_id = v.into();
889            self
890        }
891    }
892
893    #[doc(hidden)]
894    impl gax::options::internal::RequestBuilder for UpdateServiceConnectionPolicy {
895        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
896            &mut self.0.options
897        }
898    }
899
900    /// The request builder for [CrossNetworkAutomationService::delete_service_connection_policy][super::super::client::CrossNetworkAutomationService::delete_service_connection_policy] calls.
901    #[derive(Clone, Debug)]
902    pub struct DeleteServiceConnectionPolicy(
903        RequestBuilder<crate::model::DeleteServiceConnectionPolicyRequest>,
904    );
905
906    impl DeleteServiceConnectionPolicy {
907        pub(crate) fn new(
908            stub: Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
909        ) -> Self {
910            Self(RequestBuilder::new(stub))
911        }
912
913        /// Sets the full request, replacing any prior values.
914        pub fn with_request<V: Into<crate::model::DeleteServiceConnectionPolicyRequest>>(
915            mut self,
916            v: V,
917        ) -> Self {
918            self.0.request = v.into();
919            self
920        }
921
922        /// Sets all the options, replacing any prior values.
923        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
924            self.0.options = v.into();
925            self
926        }
927
928        /// Sends the request.
929        ///
930        /// # Long running operations
931        ///
932        /// This starts, but does not poll, a longrunning operation. More information
933        /// on [delete_service_connection_policy][super::super::client::CrossNetworkAutomationService::delete_service_connection_policy].
934        pub async fn send(self) -> Result<longrunning::model::Operation> {
935            (*self.0.stub)
936                .delete_service_connection_policy(self.0.request, self.0.options)
937                .await
938                .map(gax::response::Response::into_body)
939        }
940
941        /// Creates a [Poller][lro::Poller] to work with `delete_service_connection_policy`.
942        pub fn poller(self) -> impl lro::Poller<wkt::Empty, crate::model::OperationMetadata> {
943            type Operation = lro::Operation<wkt::Empty, crate::model::OperationMetadata>;
944            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
945            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
946
947            let stub = self.0.stub.clone();
948            let mut options = self.0.options.clone();
949            options.set_retry_policy(gax::retry_policy::NeverRetry);
950            let query = move |name| {
951                let stub = stub.clone();
952                let options = options.clone();
953                async {
954                    let op = GetOperation::new(stub)
955                        .set_name(name)
956                        .with_options(options)
957                        .send()
958                        .await?;
959                    Ok(Operation::new(op))
960                }
961            };
962
963            let start = move || async {
964                let op = self.send().await?;
965                Ok(Operation::new(op))
966            };
967
968            lro::new_poller(polling_error_policy, polling_backoff_policy, start, query)
969        }
970
971        /// Sets the value of [name][crate::model::DeleteServiceConnectionPolicyRequest::name].
972        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
973            self.0.request.name = v.into();
974            self
975        }
976
977        /// Sets the value of [request_id][crate::model::DeleteServiceConnectionPolicyRequest::request_id].
978        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
979            self.0.request.request_id = v.into();
980            self
981        }
982
983        /// Sets the value of [etag][crate::model::DeleteServiceConnectionPolicyRequest::etag].
984        pub fn set_etag<T: Into<std::option::Option<std::string::String>>>(mut self, v: T) -> Self {
985            self.0.request.etag = v.into();
986            self
987        }
988    }
989
990    #[doc(hidden)]
991    impl gax::options::internal::RequestBuilder for DeleteServiceConnectionPolicy {
992        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
993            &mut self.0.options
994        }
995    }
996
997    /// The request builder for [CrossNetworkAutomationService::list_service_classes][super::super::client::CrossNetworkAutomationService::list_service_classes] calls.
998    #[derive(Clone, Debug)]
999    pub struct ListServiceClasses(RequestBuilder<crate::model::ListServiceClassesRequest>);
1000
1001    impl ListServiceClasses {
1002        pub(crate) fn new(
1003            stub: Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1004        ) -> Self {
1005            Self(RequestBuilder::new(stub))
1006        }
1007
1008        /// Sets the full request, replacing any prior values.
1009        pub fn with_request<V: Into<crate::model::ListServiceClassesRequest>>(
1010            mut self,
1011            v: V,
1012        ) -> Self {
1013            self.0.request = v.into();
1014            self
1015        }
1016
1017        /// Sets all the options, replacing any prior values.
1018        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1019            self.0.options = v.into();
1020            self
1021        }
1022
1023        /// Sends the request.
1024        pub async fn send(self) -> Result<crate::model::ListServiceClassesResponse> {
1025            (*self.0.stub)
1026                .list_service_classes(self.0.request, self.0.options)
1027                .await
1028                .map(gax::response::Response::into_body)
1029        }
1030
1031        /// Streams the responses back.
1032        pub async fn paginator(
1033            self,
1034        ) -> impl gax::paginator::Paginator<crate::model::ListServiceClassesResponse, gax::error::Error>
1035        {
1036            use std::clone::Clone;
1037            let token = self.0.request.page_token.clone();
1038            let execute = move |token: String| {
1039                let mut builder = self.clone();
1040                builder.0.request = builder.0.request.set_page_token(token);
1041                builder.send()
1042            };
1043            gax::paginator::internal::new_paginator(token, execute)
1044        }
1045
1046        /// Sets the value of [parent][crate::model::ListServiceClassesRequest::parent].
1047        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1048            self.0.request.parent = v.into();
1049            self
1050        }
1051
1052        /// Sets the value of [page_size][crate::model::ListServiceClassesRequest::page_size].
1053        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1054            self.0.request.page_size = v.into();
1055            self
1056        }
1057
1058        /// Sets the value of [page_token][crate::model::ListServiceClassesRequest::page_token].
1059        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1060            self.0.request.page_token = v.into();
1061            self
1062        }
1063
1064        /// Sets the value of [filter][crate::model::ListServiceClassesRequest::filter].
1065        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1066            self.0.request.filter = v.into();
1067            self
1068        }
1069
1070        /// Sets the value of [order_by][crate::model::ListServiceClassesRequest::order_by].
1071        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1072            self.0.request.order_by = v.into();
1073            self
1074        }
1075    }
1076
1077    #[doc(hidden)]
1078    impl gax::options::internal::RequestBuilder for ListServiceClasses {
1079        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1080            &mut self.0.options
1081        }
1082    }
1083
1084    /// The request builder for [CrossNetworkAutomationService::get_service_class][super::super::client::CrossNetworkAutomationService::get_service_class] calls.
1085    #[derive(Clone, Debug)]
1086    pub struct GetServiceClass(RequestBuilder<crate::model::GetServiceClassRequest>);
1087
1088    impl GetServiceClass {
1089        pub(crate) fn new(
1090            stub: Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1091        ) -> Self {
1092            Self(RequestBuilder::new(stub))
1093        }
1094
1095        /// Sets the full request, replacing any prior values.
1096        pub fn with_request<V: Into<crate::model::GetServiceClassRequest>>(mut self, v: V) -> Self {
1097            self.0.request = v.into();
1098            self
1099        }
1100
1101        /// Sets all the options, replacing any prior values.
1102        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1103            self.0.options = v.into();
1104            self
1105        }
1106
1107        /// Sends the request.
1108        pub async fn send(self) -> Result<crate::model::ServiceClass> {
1109            (*self.0.stub)
1110                .get_service_class(self.0.request, self.0.options)
1111                .await
1112                .map(gax::response::Response::into_body)
1113        }
1114
1115        /// Sets the value of [name][crate::model::GetServiceClassRequest::name].
1116        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1117            self.0.request.name = v.into();
1118            self
1119        }
1120    }
1121
1122    #[doc(hidden)]
1123    impl gax::options::internal::RequestBuilder for GetServiceClass {
1124        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1125            &mut self.0.options
1126        }
1127    }
1128
1129    /// The request builder for [CrossNetworkAutomationService::update_service_class][super::super::client::CrossNetworkAutomationService::update_service_class] calls.
1130    #[derive(Clone, Debug)]
1131    pub struct UpdateServiceClass(RequestBuilder<crate::model::UpdateServiceClassRequest>);
1132
1133    impl UpdateServiceClass {
1134        pub(crate) fn new(
1135            stub: Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1136        ) -> Self {
1137            Self(RequestBuilder::new(stub))
1138        }
1139
1140        /// Sets the full request, replacing any prior values.
1141        pub fn with_request<V: Into<crate::model::UpdateServiceClassRequest>>(
1142            mut self,
1143            v: V,
1144        ) -> Self {
1145            self.0.request = v.into();
1146            self
1147        }
1148
1149        /// Sets all the options, replacing any prior values.
1150        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1151            self.0.options = v.into();
1152            self
1153        }
1154
1155        /// Sends the request.
1156        ///
1157        /// # Long running operations
1158        ///
1159        /// This starts, but does not poll, a longrunning operation. More information
1160        /// on [update_service_class][super::super::client::CrossNetworkAutomationService::update_service_class].
1161        pub async fn send(self) -> Result<longrunning::model::Operation> {
1162            (*self.0.stub)
1163                .update_service_class(self.0.request, self.0.options)
1164                .await
1165                .map(gax::response::Response::into_body)
1166        }
1167
1168        /// Creates a [Poller][lro::Poller] to work with `update_service_class`.
1169        pub fn poller(
1170            self,
1171        ) -> impl lro::Poller<crate::model::ServiceClass, crate::model::OperationMetadata> {
1172            type Operation =
1173                lro::Operation<crate::model::ServiceClass, crate::model::OperationMetadata>;
1174            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1175            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1176
1177            let stub = self.0.stub.clone();
1178            let mut options = self.0.options.clone();
1179            options.set_retry_policy(gax::retry_policy::NeverRetry);
1180            let query = move |name| {
1181                let stub = stub.clone();
1182                let options = options.clone();
1183                async {
1184                    let op = GetOperation::new(stub)
1185                        .set_name(name)
1186                        .with_options(options)
1187                        .send()
1188                        .await?;
1189                    Ok(Operation::new(op))
1190                }
1191            };
1192
1193            let start = move || async {
1194                let op = self.send().await?;
1195                Ok(Operation::new(op))
1196            };
1197
1198            lro::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1199        }
1200
1201        /// Sets the value of [update_mask][crate::model::UpdateServiceClassRequest::update_mask].
1202        pub fn set_update_mask<T: Into<std::option::Option<wkt::FieldMask>>>(
1203            mut self,
1204            v: T,
1205        ) -> Self {
1206            self.0.request.update_mask = v.into();
1207            self
1208        }
1209
1210        /// Sets the value of [service_class][crate::model::UpdateServiceClassRequest::service_class].
1211        pub fn set_service_class<T: Into<std::option::Option<crate::model::ServiceClass>>>(
1212            mut self,
1213            v: T,
1214        ) -> Self {
1215            self.0.request.service_class = v.into();
1216            self
1217        }
1218
1219        /// Sets the value of [request_id][crate::model::UpdateServiceClassRequest::request_id].
1220        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1221            self.0.request.request_id = v.into();
1222            self
1223        }
1224    }
1225
1226    #[doc(hidden)]
1227    impl gax::options::internal::RequestBuilder for UpdateServiceClass {
1228        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1229            &mut self.0.options
1230        }
1231    }
1232
1233    /// The request builder for [CrossNetworkAutomationService::delete_service_class][super::super::client::CrossNetworkAutomationService::delete_service_class] calls.
1234    #[derive(Clone, Debug)]
1235    pub struct DeleteServiceClass(RequestBuilder<crate::model::DeleteServiceClassRequest>);
1236
1237    impl DeleteServiceClass {
1238        pub(crate) fn new(
1239            stub: Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1240        ) -> Self {
1241            Self(RequestBuilder::new(stub))
1242        }
1243
1244        /// Sets the full request, replacing any prior values.
1245        pub fn with_request<V: Into<crate::model::DeleteServiceClassRequest>>(
1246            mut self,
1247            v: V,
1248        ) -> Self {
1249            self.0.request = v.into();
1250            self
1251        }
1252
1253        /// Sets all the options, replacing any prior values.
1254        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1255            self.0.options = v.into();
1256            self
1257        }
1258
1259        /// Sends the request.
1260        ///
1261        /// # Long running operations
1262        ///
1263        /// This starts, but does not poll, a longrunning operation. More information
1264        /// on [delete_service_class][super::super::client::CrossNetworkAutomationService::delete_service_class].
1265        pub async fn send(self) -> Result<longrunning::model::Operation> {
1266            (*self.0.stub)
1267                .delete_service_class(self.0.request, self.0.options)
1268                .await
1269                .map(gax::response::Response::into_body)
1270        }
1271
1272        /// Creates a [Poller][lro::Poller] to work with `delete_service_class`.
1273        pub fn poller(self) -> impl lro::Poller<wkt::Empty, crate::model::OperationMetadata> {
1274            type Operation = lro::Operation<wkt::Empty, crate::model::OperationMetadata>;
1275            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1276            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1277
1278            let stub = self.0.stub.clone();
1279            let mut options = self.0.options.clone();
1280            options.set_retry_policy(gax::retry_policy::NeverRetry);
1281            let query = move |name| {
1282                let stub = stub.clone();
1283                let options = options.clone();
1284                async {
1285                    let op = GetOperation::new(stub)
1286                        .set_name(name)
1287                        .with_options(options)
1288                        .send()
1289                        .await?;
1290                    Ok(Operation::new(op))
1291                }
1292            };
1293
1294            let start = move || async {
1295                let op = self.send().await?;
1296                Ok(Operation::new(op))
1297            };
1298
1299            lro::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1300        }
1301
1302        /// Sets the value of [name][crate::model::DeleteServiceClassRequest::name].
1303        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1304            self.0.request.name = v.into();
1305            self
1306        }
1307
1308        /// Sets the value of [request_id][crate::model::DeleteServiceClassRequest::request_id].
1309        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1310            self.0.request.request_id = v.into();
1311            self
1312        }
1313
1314        /// Sets the value of [etag][crate::model::DeleteServiceClassRequest::etag].
1315        pub fn set_etag<T: Into<std::option::Option<std::string::String>>>(mut self, v: T) -> Self {
1316            self.0.request.etag = v.into();
1317            self
1318        }
1319    }
1320
1321    #[doc(hidden)]
1322    impl gax::options::internal::RequestBuilder for DeleteServiceClass {
1323        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1324            &mut self.0.options
1325        }
1326    }
1327
1328    /// The request builder for [CrossNetworkAutomationService::get_service_connection_token][super::super::client::CrossNetworkAutomationService::get_service_connection_token] calls.
1329    #[derive(Clone, Debug)]
1330    pub struct GetServiceConnectionToken(
1331        RequestBuilder<crate::model::GetServiceConnectionTokenRequest>,
1332    );
1333
1334    impl GetServiceConnectionToken {
1335        pub(crate) fn new(
1336            stub: Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1337        ) -> Self {
1338            Self(RequestBuilder::new(stub))
1339        }
1340
1341        /// Sets the full request, replacing any prior values.
1342        pub fn with_request<V: Into<crate::model::GetServiceConnectionTokenRequest>>(
1343            mut self,
1344            v: V,
1345        ) -> Self {
1346            self.0.request = v.into();
1347            self
1348        }
1349
1350        /// Sets all the options, replacing any prior values.
1351        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1352            self.0.options = v.into();
1353            self
1354        }
1355
1356        /// Sends the request.
1357        pub async fn send(self) -> Result<crate::model::ServiceConnectionToken> {
1358            (*self.0.stub)
1359                .get_service_connection_token(self.0.request, self.0.options)
1360                .await
1361                .map(gax::response::Response::into_body)
1362        }
1363
1364        /// Sets the value of [name][crate::model::GetServiceConnectionTokenRequest::name].
1365        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1366            self.0.request.name = v.into();
1367            self
1368        }
1369    }
1370
1371    #[doc(hidden)]
1372    impl gax::options::internal::RequestBuilder for GetServiceConnectionToken {
1373        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1374            &mut self.0.options
1375        }
1376    }
1377
1378    /// The request builder for [CrossNetworkAutomationService::list_service_connection_tokens][super::super::client::CrossNetworkAutomationService::list_service_connection_tokens] calls.
1379    #[derive(Clone, Debug)]
1380    pub struct ListServiceConnectionTokens(
1381        RequestBuilder<crate::model::ListServiceConnectionTokensRequest>,
1382    );
1383
1384    impl ListServiceConnectionTokens {
1385        pub(crate) fn new(
1386            stub: Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1387        ) -> Self {
1388            Self(RequestBuilder::new(stub))
1389        }
1390
1391        /// Sets the full request, replacing any prior values.
1392        pub fn with_request<V: Into<crate::model::ListServiceConnectionTokensRequest>>(
1393            mut self,
1394            v: V,
1395        ) -> Self {
1396            self.0.request = v.into();
1397            self
1398        }
1399
1400        /// Sets all the options, replacing any prior values.
1401        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1402            self.0.options = v.into();
1403            self
1404        }
1405
1406        /// Sends the request.
1407        pub async fn send(self) -> Result<crate::model::ListServiceConnectionTokensResponse> {
1408            (*self.0.stub)
1409                .list_service_connection_tokens(self.0.request, self.0.options)
1410                .await
1411                .map(gax::response::Response::into_body)
1412        }
1413
1414        /// Streams the responses back.
1415        pub async fn paginator(
1416            self,
1417        ) -> impl gax::paginator::Paginator<
1418            crate::model::ListServiceConnectionTokensResponse,
1419            gax::error::Error,
1420        > {
1421            use std::clone::Clone;
1422            let token = self.0.request.page_token.clone();
1423            let execute = move |token: String| {
1424                let mut builder = self.clone();
1425                builder.0.request = builder.0.request.set_page_token(token);
1426                builder.send()
1427            };
1428            gax::paginator::internal::new_paginator(token, execute)
1429        }
1430
1431        /// Sets the value of [parent][crate::model::ListServiceConnectionTokensRequest::parent].
1432        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1433            self.0.request.parent = v.into();
1434            self
1435        }
1436
1437        /// Sets the value of [page_size][crate::model::ListServiceConnectionTokensRequest::page_size].
1438        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1439            self.0.request.page_size = v.into();
1440            self
1441        }
1442
1443        /// Sets the value of [page_token][crate::model::ListServiceConnectionTokensRequest::page_token].
1444        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1445            self.0.request.page_token = v.into();
1446            self
1447        }
1448
1449        /// Sets the value of [filter][crate::model::ListServiceConnectionTokensRequest::filter].
1450        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1451            self.0.request.filter = v.into();
1452            self
1453        }
1454
1455        /// Sets the value of [order_by][crate::model::ListServiceConnectionTokensRequest::order_by].
1456        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1457            self.0.request.order_by = v.into();
1458            self
1459        }
1460    }
1461
1462    #[doc(hidden)]
1463    impl gax::options::internal::RequestBuilder for ListServiceConnectionTokens {
1464        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1465            &mut self.0.options
1466        }
1467    }
1468
1469    /// The request builder for [CrossNetworkAutomationService::create_service_connection_token][super::super::client::CrossNetworkAutomationService::create_service_connection_token] calls.
1470    #[derive(Clone, Debug)]
1471    pub struct CreateServiceConnectionToken(
1472        RequestBuilder<crate::model::CreateServiceConnectionTokenRequest>,
1473    );
1474
1475    impl CreateServiceConnectionToken {
1476        pub(crate) fn new(
1477            stub: Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1478        ) -> Self {
1479            Self(RequestBuilder::new(stub))
1480        }
1481
1482        /// Sets the full request, replacing any prior values.
1483        pub fn with_request<V: Into<crate::model::CreateServiceConnectionTokenRequest>>(
1484            mut self,
1485            v: V,
1486        ) -> Self {
1487            self.0.request = v.into();
1488            self
1489        }
1490
1491        /// Sets all the options, replacing any prior values.
1492        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1493            self.0.options = v.into();
1494            self
1495        }
1496
1497        /// Sends the request.
1498        ///
1499        /// # Long running operations
1500        ///
1501        /// This starts, but does not poll, a longrunning operation. More information
1502        /// on [create_service_connection_token][super::super::client::CrossNetworkAutomationService::create_service_connection_token].
1503        pub async fn send(self) -> Result<longrunning::model::Operation> {
1504            (*self.0.stub)
1505                .create_service_connection_token(self.0.request, self.0.options)
1506                .await
1507                .map(gax::response::Response::into_body)
1508        }
1509
1510        /// Creates a [Poller][lro::Poller] to work with `create_service_connection_token`.
1511        pub fn poller(
1512            self,
1513        ) -> impl lro::Poller<crate::model::ServiceConnectionToken, crate::model::OperationMetadata>
1514        {
1515            type Operation = lro::Operation<
1516                crate::model::ServiceConnectionToken,
1517                crate::model::OperationMetadata,
1518            >;
1519            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1520            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1521
1522            let stub = self.0.stub.clone();
1523            let mut options = self.0.options.clone();
1524            options.set_retry_policy(gax::retry_policy::NeverRetry);
1525            let query = move |name| {
1526                let stub = stub.clone();
1527                let options = options.clone();
1528                async {
1529                    let op = GetOperation::new(stub)
1530                        .set_name(name)
1531                        .with_options(options)
1532                        .send()
1533                        .await?;
1534                    Ok(Operation::new(op))
1535                }
1536            };
1537
1538            let start = move || async {
1539                let op = self.send().await?;
1540                Ok(Operation::new(op))
1541            };
1542
1543            lro::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1544        }
1545
1546        /// Sets the value of [parent][crate::model::CreateServiceConnectionTokenRequest::parent].
1547        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1548            self.0.request.parent = v.into();
1549            self
1550        }
1551
1552        /// Sets the value of [service_connection_token_id][crate::model::CreateServiceConnectionTokenRequest::service_connection_token_id].
1553        pub fn set_service_connection_token_id<T: Into<std::string::String>>(
1554            mut self,
1555            v: T,
1556        ) -> Self {
1557            self.0.request.service_connection_token_id = v.into();
1558            self
1559        }
1560
1561        /// Sets the value of [service_connection_token][crate::model::CreateServiceConnectionTokenRequest::service_connection_token].
1562        pub fn set_service_connection_token<
1563            T: Into<std::option::Option<crate::model::ServiceConnectionToken>>,
1564        >(
1565            mut self,
1566            v: T,
1567        ) -> Self {
1568            self.0.request.service_connection_token = v.into();
1569            self
1570        }
1571
1572        /// Sets the value of [request_id][crate::model::CreateServiceConnectionTokenRequest::request_id].
1573        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1574            self.0.request.request_id = v.into();
1575            self
1576        }
1577    }
1578
1579    #[doc(hidden)]
1580    impl gax::options::internal::RequestBuilder for CreateServiceConnectionToken {
1581        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1582            &mut self.0.options
1583        }
1584    }
1585
1586    /// The request builder for [CrossNetworkAutomationService::delete_service_connection_token][super::super::client::CrossNetworkAutomationService::delete_service_connection_token] calls.
1587    #[derive(Clone, Debug)]
1588    pub struct DeleteServiceConnectionToken(
1589        RequestBuilder<crate::model::DeleteServiceConnectionTokenRequest>,
1590    );
1591
1592    impl DeleteServiceConnectionToken {
1593        pub(crate) fn new(
1594            stub: Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1595        ) -> Self {
1596            Self(RequestBuilder::new(stub))
1597        }
1598
1599        /// Sets the full request, replacing any prior values.
1600        pub fn with_request<V: Into<crate::model::DeleteServiceConnectionTokenRequest>>(
1601            mut self,
1602            v: V,
1603        ) -> Self {
1604            self.0.request = v.into();
1605            self
1606        }
1607
1608        /// Sets all the options, replacing any prior values.
1609        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1610            self.0.options = v.into();
1611            self
1612        }
1613
1614        /// Sends the request.
1615        ///
1616        /// # Long running operations
1617        ///
1618        /// This starts, but does not poll, a longrunning operation. More information
1619        /// on [delete_service_connection_token][super::super::client::CrossNetworkAutomationService::delete_service_connection_token].
1620        pub async fn send(self) -> Result<longrunning::model::Operation> {
1621            (*self.0.stub)
1622                .delete_service_connection_token(self.0.request, self.0.options)
1623                .await
1624                .map(gax::response::Response::into_body)
1625        }
1626
1627        /// Creates a [Poller][lro::Poller] to work with `delete_service_connection_token`.
1628        pub fn poller(self) -> impl lro::Poller<wkt::Empty, crate::model::OperationMetadata> {
1629            type Operation = lro::Operation<wkt::Empty, crate::model::OperationMetadata>;
1630            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1631            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1632
1633            let stub = self.0.stub.clone();
1634            let mut options = self.0.options.clone();
1635            options.set_retry_policy(gax::retry_policy::NeverRetry);
1636            let query = move |name| {
1637                let stub = stub.clone();
1638                let options = options.clone();
1639                async {
1640                    let op = GetOperation::new(stub)
1641                        .set_name(name)
1642                        .with_options(options)
1643                        .send()
1644                        .await?;
1645                    Ok(Operation::new(op))
1646                }
1647            };
1648
1649            let start = move || async {
1650                let op = self.send().await?;
1651                Ok(Operation::new(op))
1652            };
1653
1654            lro::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1655        }
1656
1657        /// Sets the value of [name][crate::model::DeleteServiceConnectionTokenRequest::name].
1658        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1659            self.0.request.name = v.into();
1660            self
1661        }
1662
1663        /// Sets the value of [request_id][crate::model::DeleteServiceConnectionTokenRequest::request_id].
1664        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1665            self.0.request.request_id = v.into();
1666            self
1667        }
1668
1669        /// Sets the value of [etag][crate::model::DeleteServiceConnectionTokenRequest::etag].
1670        pub fn set_etag<T: Into<std::option::Option<std::string::String>>>(mut self, v: T) -> Self {
1671            self.0.request.etag = v.into();
1672            self
1673        }
1674    }
1675
1676    #[doc(hidden)]
1677    impl gax::options::internal::RequestBuilder for DeleteServiceConnectionToken {
1678        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1679            &mut self.0.options
1680        }
1681    }
1682
1683    /// The request builder for [CrossNetworkAutomationService::list_locations][super::super::client::CrossNetworkAutomationService::list_locations] calls.
1684    #[derive(Clone, Debug)]
1685    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
1686
1687    impl ListLocations {
1688        pub(crate) fn new(
1689            stub: Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1690        ) -> Self {
1691            Self(RequestBuilder::new(stub))
1692        }
1693
1694        /// Sets the full request, replacing any prior values.
1695        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
1696            mut self,
1697            v: V,
1698        ) -> Self {
1699            self.0.request = v.into();
1700            self
1701        }
1702
1703        /// Sets all the options, replacing any prior values.
1704        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1705            self.0.options = v.into();
1706            self
1707        }
1708
1709        /// Sends the request.
1710        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
1711            (*self.0.stub)
1712                .list_locations(self.0.request, self.0.options)
1713                .await
1714                .map(gax::response::Response::into_body)
1715        }
1716
1717        /// Streams the responses back.
1718        pub async fn paginator(
1719            self,
1720        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
1721        {
1722            use std::clone::Clone;
1723            let token = self.0.request.page_token.clone();
1724            let execute = move |token: String| {
1725                let mut builder = self.clone();
1726                builder.0.request = builder.0.request.set_page_token(token);
1727                builder.send()
1728            };
1729            gax::paginator::internal::new_paginator(token, execute)
1730        }
1731
1732        /// Sets the value of [name][location::model::ListLocationsRequest::name].
1733        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1734            self.0.request.name = v.into();
1735            self
1736        }
1737
1738        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
1739        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1740            self.0.request.filter = v.into();
1741            self
1742        }
1743
1744        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
1745        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1746            self.0.request.page_size = v.into();
1747            self
1748        }
1749
1750        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
1751        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1752            self.0.request.page_token = v.into();
1753            self
1754        }
1755    }
1756
1757    #[doc(hidden)]
1758    impl gax::options::internal::RequestBuilder for ListLocations {
1759        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1760            &mut self.0.options
1761        }
1762    }
1763
1764    /// The request builder for [CrossNetworkAutomationService::get_location][super::super::client::CrossNetworkAutomationService::get_location] calls.
1765    #[derive(Clone, Debug)]
1766    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
1767
1768    impl GetLocation {
1769        pub(crate) fn new(
1770            stub: Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1771        ) -> Self {
1772            Self(RequestBuilder::new(stub))
1773        }
1774
1775        /// Sets the full request, replacing any prior values.
1776        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
1777            self.0.request = v.into();
1778            self
1779        }
1780
1781        /// Sets all the options, replacing any prior values.
1782        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1783            self.0.options = v.into();
1784            self
1785        }
1786
1787        /// Sends the request.
1788        pub async fn send(self) -> Result<location::model::Location> {
1789            (*self.0.stub)
1790                .get_location(self.0.request, self.0.options)
1791                .await
1792                .map(gax::response::Response::into_body)
1793        }
1794
1795        /// Sets the value of [name][location::model::GetLocationRequest::name].
1796        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1797            self.0.request.name = v.into();
1798            self
1799        }
1800    }
1801
1802    #[doc(hidden)]
1803    impl gax::options::internal::RequestBuilder for GetLocation {
1804        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1805            &mut self.0.options
1806        }
1807    }
1808
1809    /// The request builder for [CrossNetworkAutomationService::set_iam_policy][super::super::client::CrossNetworkAutomationService::set_iam_policy] calls.
1810    #[derive(Clone, Debug)]
1811    pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
1812
1813    impl SetIamPolicy {
1814        pub(crate) fn new(
1815            stub: Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1816        ) -> Self {
1817            Self(RequestBuilder::new(stub))
1818        }
1819
1820        /// Sets the full request, replacing any prior values.
1821        pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
1822            self.0.request = v.into();
1823            self
1824        }
1825
1826        /// Sets all the options, replacing any prior values.
1827        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1828            self.0.options = v.into();
1829            self
1830        }
1831
1832        /// Sends the request.
1833        pub async fn send(self) -> Result<iam_v1::model::Policy> {
1834            (*self.0.stub)
1835                .set_iam_policy(self.0.request, self.0.options)
1836                .await
1837                .map(gax::response::Response::into_body)
1838        }
1839
1840        /// Sets the value of [resource][iam_v1::model::SetIamPolicyRequest::resource].
1841        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1842            self.0.request.resource = v.into();
1843            self
1844        }
1845
1846        /// Sets the value of [policy][iam_v1::model::SetIamPolicyRequest::policy].
1847        pub fn set_policy<T: Into<std::option::Option<iam_v1::model::Policy>>>(
1848            mut self,
1849            v: T,
1850        ) -> Self {
1851            self.0.request.policy = v.into();
1852            self
1853        }
1854
1855        /// Sets the value of [update_mask][iam_v1::model::SetIamPolicyRequest::update_mask].
1856        pub fn set_update_mask<T: Into<std::option::Option<wkt::FieldMask>>>(
1857            mut self,
1858            v: T,
1859        ) -> Self {
1860            self.0.request.update_mask = v.into();
1861            self
1862        }
1863    }
1864
1865    #[doc(hidden)]
1866    impl gax::options::internal::RequestBuilder for SetIamPolicy {
1867        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1868            &mut self.0.options
1869        }
1870    }
1871
1872    /// The request builder for [CrossNetworkAutomationService::get_iam_policy][super::super::client::CrossNetworkAutomationService::get_iam_policy] calls.
1873    #[derive(Clone, Debug)]
1874    pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
1875
1876    impl GetIamPolicy {
1877        pub(crate) fn new(
1878            stub: Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1879        ) -> Self {
1880            Self(RequestBuilder::new(stub))
1881        }
1882
1883        /// Sets the full request, replacing any prior values.
1884        pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
1885            self.0.request = v.into();
1886            self
1887        }
1888
1889        /// Sets all the options, replacing any prior values.
1890        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1891            self.0.options = v.into();
1892            self
1893        }
1894
1895        /// Sends the request.
1896        pub async fn send(self) -> Result<iam_v1::model::Policy> {
1897            (*self.0.stub)
1898                .get_iam_policy(self.0.request, self.0.options)
1899                .await
1900                .map(gax::response::Response::into_body)
1901        }
1902
1903        /// Sets the value of [resource][iam_v1::model::GetIamPolicyRequest::resource].
1904        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1905            self.0.request.resource = v.into();
1906            self
1907        }
1908
1909        /// Sets the value of [options][iam_v1::model::GetIamPolicyRequest::options].
1910        pub fn set_options<T: Into<std::option::Option<iam_v1::model::GetPolicyOptions>>>(
1911            mut self,
1912            v: T,
1913        ) -> Self {
1914            self.0.request.options = v.into();
1915            self
1916        }
1917    }
1918
1919    #[doc(hidden)]
1920    impl gax::options::internal::RequestBuilder for GetIamPolicy {
1921        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1922            &mut self.0.options
1923        }
1924    }
1925
1926    /// The request builder for [CrossNetworkAutomationService::test_iam_permissions][super::super::client::CrossNetworkAutomationService::test_iam_permissions] calls.
1927    #[derive(Clone, Debug)]
1928    pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
1929
1930    impl TestIamPermissions {
1931        pub(crate) fn new(
1932            stub: Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1933        ) -> Self {
1934            Self(RequestBuilder::new(stub))
1935        }
1936
1937        /// Sets the full request, replacing any prior values.
1938        pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
1939            mut self,
1940            v: V,
1941        ) -> Self {
1942            self.0.request = v.into();
1943            self
1944        }
1945
1946        /// Sets all the options, replacing any prior values.
1947        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1948            self.0.options = v.into();
1949            self
1950        }
1951
1952        /// Sends the request.
1953        pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
1954            (*self.0.stub)
1955                .test_iam_permissions(self.0.request, self.0.options)
1956                .await
1957                .map(gax::response::Response::into_body)
1958        }
1959
1960        /// Sets the value of [resource][iam_v1::model::TestIamPermissionsRequest::resource].
1961        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1962            self.0.request.resource = v.into();
1963            self
1964        }
1965
1966        /// Sets the value of [permissions][iam_v1::model::TestIamPermissionsRequest::permissions].
1967        pub fn set_permissions<T, V>(mut self, v: T) -> Self
1968        where
1969            T: std::iter::IntoIterator<Item = V>,
1970            V: std::convert::Into<std::string::String>,
1971        {
1972            use std::iter::Iterator;
1973            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
1974            self
1975        }
1976    }
1977
1978    #[doc(hidden)]
1979    impl gax::options::internal::RequestBuilder for TestIamPermissions {
1980        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1981            &mut self.0.options
1982        }
1983    }
1984
1985    /// The request builder for [CrossNetworkAutomationService::list_operations][super::super::client::CrossNetworkAutomationService::list_operations] calls.
1986    #[derive(Clone, Debug)]
1987    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
1988
1989    impl ListOperations {
1990        pub(crate) fn new(
1991            stub: Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1992        ) -> Self {
1993            Self(RequestBuilder::new(stub))
1994        }
1995
1996        /// Sets the full request, replacing any prior values.
1997        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
1998            mut self,
1999            v: V,
2000        ) -> Self {
2001            self.0.request = v.into();
2002            self
2003        }
2004
2005        /// Sets all the options, replacing any prior values.
2006        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2007            self.0.options = v.into();
2008            self
2009        }
2010
2011        /// Sends the request.
2012        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
2013            (*self.0.stub)
2014                .list_operations(self.0.request, self.0.options)
2015                .await
2016                .map(gax::response::Response::into_body)
2017        }
2018
2019        /// Streams the responses back.
2020        pub async fn paginator(
2021            self,
2022        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
2023        {
2024            use std::clone::Clone;
2025            let token = self.0.request.page_token.clone();
2026            let execute = move |token: String| {
2027                let mut builder = self.clone();
2028                builder.0.request = builder.0.request.set_page_token(token);
2029                builder.send()
2030            };
2031            gax::paginator::internal::new_paginator(token, execute)
2032        }
2033
2034        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
2035        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2036            self.0.request.name = v.into();
2037            self
2038        }
2039
2040        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
2041        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2042            self.0.request.filter = v.into();
2043            self
2044        }
2045
2046        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
2047        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2048            self.0.request.page_size = v.into();
2049            self
2050        }
2051
2052        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
2053        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2054            self.0.request.page_token = v.into();
2055            self
2056        }
2057    }
2058
2059    #[doc(hidden)]
2060    impl gax::options::internal::RequestBuilder for ListOperations {
2061        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2062            &mut self.0.options
2063        }
2064    }
2065
2066    /// The request builder for [CrossNetworkAutomationService::get_operation][super::super::client::CrossNetworkAutomationService::get_operation] calls.
2067    #[derive(Clone, Debug)]
2068    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
2069
2070    impl GetOperation {
2071        pub(crate) fn new(
2072            stub: Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2073        ) -> Self {
2074            Self(RequestBuilder::new(stub))
2075        }
2076
2077        /// Sets the full request, replacing any prior values.
2078        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
2079            mut self,
2080            v: V,
2081        ) -> Self {
2082            self.0.request = v.into();
2083            self
2084        }
2085
2086        /// Sets all the options, replacing any prior values.
2087        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2088            self.0.options = v.into();
2089            self
2090        }
2091
2092        /// Sends the request.
2093        pub async fn send(self) -> Result<longrunning::model::Operation> {
2094            (*self.0.stub)
2095                .get_operation(self.0.request, self.0.options)
2096                .await
2097                .map(gax::response::Response::into_body)
2098        }
2099
2100        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
2101        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2102            self.0.request.name = v.into();
2103            self
2104        }
2105    }
2106
2107    #[doc(hidden)]
2108    impl gax::options::internal::RequestBuilder for GetOperation {
2109        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2110            &mut self.0.options
2111        }
2112    }
2113
2114    /// The request builder for [CrossNetworkAutomationService::delete_operation][super::super::client::CrossNetworkAutomationService::delete_operation] calls.
2115    #[derive(Clone, Debug)]
2116    pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
2117
2118    impl DeleteOperation {
2119        pub(crate) fn new(
2120            stub: Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2121        ) -> Self {
2122            Self(RequestBuilder::new(stub))
2123        }
2124
2125        /// Sets the full request, replacing any prior values.
2126        pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
2127            mut self,
2128            v: V,
2129        ) -> Self {
2130            self.0.request = v.into();
2131            self
2132        }
2133
2134        /// Sets all the options, replacing any prior values.
2135        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2136            self.0.options = v.into();
2137            self
2138        }
2139
2140        /// Sends the request.
2141        pub async fn send(self) -> Result<()> {
2142            (*self.0.stub)
2143                .delete_operation(self.0.request, self.0.options)
2144                .await
2145                .map(gax::response::Response::into_body)
2146        }
2147
2148        /// Sets the value of [name][longrunning::model::DeleteOperationRequest::name].
2149        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2150            self.0.request.name = v.into();
2151            self
2152        }
2153    }
2154
2155    #[doc(hidden)]
2156    impl gax::options::internal::RequestBuilder for DeleteOperation {
2157        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2158            &mut self.0.options
2159        }
2160    }
2161
2162    /// The request builder for [CrossNetworkAutomationService::cancel_operation][super::super::client::CrossNetworkAutomationService::cancel_operation] calls.
2163    #[derive(Clone, Debug)]
2164    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
2165
2166    impl CancelOperation {
2167        pub(crate) fn new(
2168            stub: Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2169        ) -> Self {
2170            Self(RequestBuilder::new(stub))
2171        }
2172
2173        /// Sets the full request, replacing any prior values.
2174        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
2175            mut self,
2176            v: V,
2177        ) -> Self {
2178            self.0.request = v.into();
2179            self
2180        }
2181
2182        /// Sets all the options, replacing any prior values.
2183        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2184            self.0.options = v.into();
2185            self
2186        }
2187
2188        /// Sends the request.
2189        pub async fn send(self) -> Result<()> {
2190            (*self.0.stub)
2191                .cancel_operation(self.0.request, self.0.options)
2192                .await
2193                .map(gax::response::Response::into_body)
2194        }
2195
2196        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
2197        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2198            self.0.request.name = v.into();
2199            self
2200        }
2201    }
2202
2203    #[doc(hidden)]
2204    impl gax::options::internal::RequestBuilder for CancelOperation {
2205        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2206            &mut self.0.options
2207        }
2208    }
2209}
2210
2211pub mod hub_service {
2212    use crate::Result;
2213    use std::sync::Arc;
2214
2215    /// A builder for [HubService][super::super::client::HubService].
2216    ///
2217    /// ```
2218    /// # tokio_test::block_on(async {
2219    /// # use google_cloud_networkconnectivity_v1::*;
2220    /// # use builder::hub_service::ClientBuilder;
2221    /// # use client::HubService;
2222    /// let builder : ClientBuilder = HubService::builder();
2223    /// let client = builder
2224    ///     .with_endpoint("https://networkconnectivity.googleapis.com")
2225    ///     .build().await?;
2226    /// # gax::Result::<()>::Ok(()) });
2227    /// ```
2228    pub type ClientBuilder =
2229        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
2230
2231    pub(crate) mod client {
2232        use super::super::super::client::HubService;
2233        pub struct Factory;
2234        impl gax::client_builder::internal::ClientFactory for Factory {
2235            type Client = HubService;
2236            type Credentials = gaxi::options::Credentials;
2237            async fn build(self, config: gaxi::options::ClientConfig) -> gax::Result<Self::Client> {
2238                Self::Client::new(config).await
2239            }
2240        }
2241    }
2242
2243    /// Common implementation for [super::super::client::HubService] request builders.
2244    #[derive(Clone, Debug)]
2245    pub(crate) struct RequestBuilder<R: std::default::Default> {
2246        stub: Arc<dyn super::super::stub::dynamic::HubService>,
2247        request: R,
2248        options: gax::options::RequestOptions,
2249    }
2250
2251    impl<R> RequestBuilder<R>
2252    where
2253        R: std::default::Default,
2254    {
2255        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::HubService>) -> Self {
2256            Self {
2257                stub,
2258                request: R::default(),
2259                options: gax::options::RequestOptions::default(),
2260            }
2261        }
2262    }
2263
2264    /// The request builder for [HubService::list_hubs][super::super::client::HubService::list_hubs] calls.
2265    #[derive(Clone, Debug)]
2266    pub struct ListHubs(RequestBuilder<crate::model::ListHubsRequest>);
2267
2268    impl ListHubs {
2269        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::HubService>) -> Self {
2270            Self(RequestBuilder::new(stub))
2271        }
2272
2273        /// Sets the full request, replacing any prior values.
2274        pub fn with_request<V: Into<crate::model::ListHubsRequest>>(mut self, v: V) -> Self {
2275            self.0.request = v.into();
2276            self
2277        }
2278
2279        /// Sets all the options, replacing any prior values.
2280        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2281            self.0.options = v.into();
2282            self
2283        }
2284
2285        /// Sends the request.
2286        pub async fn send(self) -> Result<crate::model::ListHubsResponse> {
2287            (*self.0.stub)
2288                .list_hubs(self.0.request, self.0.options)
2289                .await
2290                .map(gax::response::Response::into_body)
2291        }
2292
2293        /// Streams the responses back.
2294        pub async fn paginator(
2295            self,
2296        ) -> impl gax::paginator::Paginator<crate::model::ListHubsResponse, gax::error::Error>
2297        {
2298            use std::clone::Clone;
2299            let token = self.0.request.page_token.clone();
2300            let execute = move |token: String| {
2301                let mut builder = self.clone();
2302                builder.0.request = builder.0.request.set_page_token(token);
2303                builder.send()
2304            };
2305            gax::paginator::internal::new_paginator(token, execute)
2306        }
2307
2308        /// Sets the value of [parent][crate::model::ListHubsRequest::parent].
2309        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2310            self.0.request.parent = v.into();
2311            self
2312        }
2313
2314        /// Sets the value of [page_size][crate::model::ListHubsRequest::page_size].
2315        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2316            self.0.request.page_size = v.into();
2317            self
2318        }
2319
2320        /// Sets the value of [page_token][crate::model::ListHubsRequest::page_token].
2321        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2322            self.0.request.page_token = v.into();
2323            self
2324        }
2325
2326        /// Sets the value of [filter][crate::model::ListHubsRequest::filter].
2327        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2328            self.0.request.filter = v.into();
2329            self
2330        }
2331
2332        /// Sets the value of [order_by][crate::model::ListHubsRequest::order_by].
2333        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
2334            self.0.request.order_by = v.into();
2335            self
2336        }
2337    }
2338
2339    #[doc(hidden)]
2340    impl gax::options::internal::RequestBuilder for ListHubs {
2341        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2342            &mut self.0.options
2343        }
2344    }
2345
2346    /// The request builder for [HubService::get_hub][super::super::client::HubService::get_hub] calls.
2347    #[derive(Clone, Debug)]
2348    pub struct GetHub(RequestBuilder<crate::model::GetHubRequest>);
2349
2350    impl GetHub {
2351        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::HubService>) -> Self {
2352            Self(RequestBuilder::new(stub))
2353        }
2354
2355        /// Sets the full request, replacing any prior values.
2356        pub fn with_request<V: Into<crate::model::GetHubRequest>>(mut self, v: V) -> Self {
2357            self.0.request = v.into();
2358            self
2359        }
2360
2361        /// Sets all the options, replacing any prior values.
2362        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2363            self.0.options = v.into();
2364            self
2365        }
2366
2367        /// Sends the request.
2368        pub async fn send(self) -> Result<crate::model::Hub> {
2369            (*self.0.stub)
2370                .get_hub(self.0.request, self.0.options)
2371                .await
2372                .map(gax::response::Response::into_body)
2373        }
2374
2375        /// Sets the value of [name][crate::model::GetHubRequest::name].
2376        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2377            self.0.request.name = v.into();
2378            self
2379        }
2380    }
2381
2382    #[doc(hidden)]
2383    impl gax::options::internal::RequestBuilder for GetHub {
2384        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2385            &mut self.0.options
2386        }
2387    }
2388
2389    /// The request builder for [HubService::create_hub][super::super::client::HubService::create_hub] calls.
2390    #[derive(Clone, Debug)]
2391    pub struct CreateHub(RequestBuilder<crate::model::CreateHubRequest>);
2392
2393    impl CreateHub {
2394        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::HubService>) -> Self {
2395            Self(RequestBuilder::new(stub))
2396        }
2397
2398        /// Sets the full request, replacing any prior values.
2399        pub fn with_request<V: Into<crate::model::CreateHubRequest>>(mut self, v: V) -> Self {
2400            self.0.request = v.into();
2401            self
2402        }
2403
2404        /// Sets all the options, replacing any prior values.
2405        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2406            self.0.options = v.into();
2407            self
2408        }
2409
2410        /// Sends the request.
2411        ///
2412        /// # Long running operations
2413        ///
2414        /// This starts, but does not poll, a longrunning operation. More information
2415        /// on [create_hub][super::super::client::HubService::create_hub].
2416        pub async fn send(self) -> Result<longrunning::model::Operation> {
2417            (*self.0.stub)
2418                .create_hub(self.0.request, self.0.options)
2419                .await
2420                .map(gax::response::Response::into_body)
2421        }
2422
2423        /// Creates a [Poller][lro::Poller] to work with `create_hub`.
2424        pub fn poller(
2425            self,
2426        ) -> impl lro::Poller<crate::model::Hub, crate::model::OperationMetadata> {
2427            type Operation = lro::Operation<crate::model::Hub, crate::model::OperationMetadata>;
2428            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2429            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2430
2431            let stub = self.0.stub.clone();
2432            let mut options = self.0.options.clone();
2433            options.set_retry_policy(gax::retry_policy::NeverRetry);
2434            let query = move |name| {
2435                let stub = stub.clone();
2436                let options = options.clone();
2437                async {
2438                    let op = GetOperation::new(stub)
2439                        .set_name(name)
2440                        .with_options(options)
2441                        .send()
2442                        .await?;
2443                    Ok(Operation::new(op))
2444                }
2445            };
2446
2447            let start = move || async {
2448                let op = self.send().await?;
2449                Ok(Operation::new(op))
2450            };
2451
2452            lro::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2453        }
2454
2455        /// Sets the value of [parent][crate::model::CreateHubRequest::parent].
2456        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2457            self.0.request.parent = v.into();
2458            self
2459        }
2460
2461        /// Sets the value of [hub_id][crate::model::CreateHubRequest::hub_id].
2462        pub fn set_hub_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2463            self.0.request.hub_id = v.into();
2464            self
2465        }
2466
2467        /// Sets the value of [hub][crate::model::CreateHubRequest::hub].
2468        pub fn set_hub<T: Into<std::option::Option<crate::model::Hub>>>(mut self, v: T) -> Self {
2469            self.0.request.hub = v.into();
2470            self
2471        }
2472
2473        /// Sets the value of [request_id][crate::model::CreateHubRequest::request_id].
2474        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2475            self.0.request.request_id = v.into();
2476            self
2477        }
2478    }
2479
2480    #[doc(hidden)]
2481    impl gax::options::internal::RequestBuilder for CreateHub {
2482        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2483            &mut self.0.options
2484        }
2485    }
2486
2487    /// The request builder for [HubService::update_hub][super::super::client::HubService::update_hub] calls.
2488    #[derive(Clone, Debug)]
2489    pub struct UpdateHub(RequestBuilder<crate::model::UpdateHubRequest>);
2490
2491    impl UpdateHub {
2492        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::HubService>) -> Self {
2493            Self(RequestBuilder::new(stub))
2494        }
2495
2496        /// Sets the full request, replacing any prior values.
2497        pub fn with_request<V: Into<crate::model::UpdateHubRequest>>(mut self, v: V) -> Self {
2498            self.0.request = v.into();
2499            self
2500        }
2501
2502        /// Sets all the options, replacing any prior values.
2503        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2504            self.0.options = v.into();
2505            self
2506        }
2507
2508        /// Sends the request.
2509        ///
2510        /// # Long running operations
2511        ///
2512        /// This starts, but does not poll, a longrunning operation. More information
2513        /// on [update_hub][super::super::client::HubService::update_hub].
2514        pub async fn send(self) -> Result<longrunning::model::Operation> {
2515            (*self.0.stub)
2516                .update_hub(self.0.request, self.0.options)
2517                .await
2518                .map(gax::response::Response::into_body)
2519        }
2520
2521        /// Creates a [Poller][lro::Poller] to work with `update_hub`.
2522        pub fn poller(
2523            self,
2524        ) -> impl lro::Poller<crate::model::Hub, crate::model::OperationMetadata> {
2525            type Operation = lro::Operation<crate::model::Hub, crate::model::OperationMetadata>;
2526            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2527            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2528
2529            let stub = self.0.stub.clone();
2530            let mut options = self.0.options.clone();
2531            options.set_retry_policy(gax::retry_policy::NeverRetry);
2532            let query = move |name| {
2533                let stub = stub.clone();
2534                let options = options.clone();
2535                async {
2536                    let op = GetOperation::new(stub)
2537                        .set_name(name)
2538                        .with_options(options)
2539                        .send()
2540                        .await?;
2541                    Ok(Operation::new(op))
2542                }
2543            };
2544
2545            let start = move || async {
2546                let op = self.send().await?;
2547                Ok(Operation::new(op))
2548            };
2549
2550            lro::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2551        }
2552
2553        /// Sets the value of [update_mask][crate::model::UpdateHubRequest::update_mask].
2554        pub fn set_update_mask<T: Into<std::option::Option<wkt::FieldMask>>>(
2555            mut self,
2556            v: T,
2557        ) -> Self {
2558            self.0.request.update_mask = v.into();
2559            self
2560        }
2561
2562        /// Sets the value of [hub][crate::model::UpdateHubRequest::hub].
2563        pub fn set_hub<T: Into<std::option::Option<crate::model::Hub>>>(mut self, v: T) -> Self {
2564            self.0.request.hub = v.into();
2565            self
2566        }
2567
2568        /// Sets the value of [request_id][crate::model::UpdateHubRequest::request_id].
2569        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2570            self.0.request.request_id = v.into();
2571            self
2572        }
2573    }
2574
2575    #[doc(hidden)]
2576    impl gax::options::internal::RequestBuilder for UpdateHub {
2577        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2578            &mut self.0.options
2579        }
2580    }
2581
2582    /// The request builder for [HubService::delete_hub][super::super::client::HubService::delete_hub] calls.
2583    #[derive(Clone, Debug)]
2584    pub struct DeleteHub(RequestBuilder<crate::model::DeleteHubRequest>);
2585
2586    impl DeleteHub {
2587        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::HubService>) -> Self {
2588            Self(RequestBuilder::new(stub))
2589        }
2590
2591        /// Sets the full request, replacing any prior values.
2592        pub fn with_request<V: Into<crate::model::DeleteHubRequest>>(mut self, v: V) -> Self {
2593            self.0.request = v.into();
2594            self
2595        }
2596
2597        /// Sets all the options, replacing any prior values.
2598        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2599            self.0.options = v.into();
2600            self
2601        }
2602
2603        /// Sends the request.
2604        ///
2605        /// # Long running operations
2606        ///
2607        /// This starts, but does not poll, a longrunning operation. More information
2608        /// on [delete_hub][super::super::client::HubService::delete_hub].
2609        pub async fn send(self) -> Result<longrunning::model::Operation> {
2610            (*self.0.stub)
2611                .delete_hub(self.0.request, self.0.options)
2612                .await
2613                .map(gax::response::Response::into_body)
2614        }
2615
2616        /// Creates a [Poller][lro::Poller] to work with `delete_hub`.
2617        pub fn poller(self) -> impl lro::Poller<wkt::Empty, crate::model::OperationMetadata> {
2618            type Operation = lro::Operation<wkt::Empty, crate::model::OperationMetadata>;
2619            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2620            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2621
2622            let stub = self.0.stub.clone();
2623            let mut options = self.0.options.clone();
2624            options.set_retry_policy(gax::retry_policy::NeverRetry);
2625            let query = move |name| {
2626                let stub = stub.clone();
2627                let options = options.clone();
2628                async {
2629                    let op = GetOperation::new(stub)
2630                        .set_name(name)
2631                        .with_options(options)
2632                        .send()
2633                        .await?;
2634                    Ok(Operation::new(op))
2635                }
2636            };
2637
2638            let start = move || async {
2639                let op = self.send().await?;
2640                Ok(Operation::new(op))
2641            };
2642
2643            lro::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2644        }
2645
2646        /// Sets the value of [name][crate::model::DeleteHubRequest::name].
2647        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2648            self.0.request.name = v.into();
2649            self
2650        }
2651
2652        /// Sets the value of [request_id][crate::model::DeleteHubRequest::request_id].
2653        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2654            self.0.request.request_id = v.into();
2655            self
2656        }
2657    }
2658
2659    #[doc(hidden)]
2660    impl gax::options::internal::RequestBuilder for DeleteHub {
2661        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2662            &mut self.0.options
2663        }
2664    }
2665
2666    /// The request builder for [HubService::list_hub_spokes][super::super::client::HubService::list_hub_spokes] calls.
2667    #[derive(Clone, Debug)]
2668    pub struct ListHubSpokes(RequestBuilder<crate::model::ListHubSpokesRequest>);
2669
2670    impl ListHubSpokes {
2671        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::HubService>) -> Self {
2672            Self(RequestBuilder::new(stub))
2673        }
2674
2675        /// Sets the full request, replacing any prior values.
2676        pub fn with_request<V: Into<crate::model::ListHubSpokesRequest>>(mut self, v: V) -> Self {
2677            self.0.request = v.into();
2678            self
2679        }
2680
2681        /// Sets all the options, replacing any prior values.
2682        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2683            self.0.options = v.into();
2684            self
2685        }
2686
2687        /// Sends the request.
2688        pub async fn send(self) -> Result<crate::model::ListHubSpokesResponse> {
2689            (*self.0.stub)
2690                .list_hub_spokes(self.0.request, self.0.options)
2691                .await
2692                .map(gax::response::Response::into_body)
2693        }
2694
2695        /// Streams the responses back.
2696        pub async fn paginator(
2697            self,
2698        ) -> impl gax::paginator::Paginator<crate::model::ListHubSpokesResponse, gax::error::Error>
2699        {
2700            use std::clone::Clone;
2701            let token = self.0.request.page_token.clone();
2702            let execute = move |token: String| {
2703                let mut builder = self.clone();
2704                builder.0.request = builder.0.request.set_page_token(token);
2705                builder.send()
2706            };
2707            gax::paginator::internal::new_paginator(token, execute)
2708        }
2709
2710        /// Sets the value of [name][crate::model::ListHubSpokesRequest::name].
2711        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2712            self.0.request.name = v.into();
2713            self
2714        }
2715
2716        /// Sets the value of [page_size][crate::model::ListHubSpokesRequest::page_size].
2717        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2718            self.0.request.page_size = v.into();
2719            self
2720        }
2721
2722        /// Sets the value of [page_token][crate::model::ListHubSpokesRequest::page_token].
2723        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2724            self.0.request.page_token = v.into();
2725            self
2726        }
2727
2728        /// Sets the value of [filter][crate::model::ListHubSpokesRequest::filter].
2729        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2730            self.0.request.filter = v.into();
2731            self
2732        }
2733
2734        /// Sets the value of [order_by][crate::model::ListHubSpokesRequest::order_by].
2735        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
2736            self.0.request.order_by = v.into();
2737            self
2738        }
2739
2740        /// Sets the value of [view][crate::model::ListHubSpokesRequest::view].
2741        pub fn set_view<T: Into<crate::model::list_hub_spokes_request::SpokeView>>(
2742            mut self,
2743            v: T,
2744        ) -> Self {
2745            self.0.request.view = v.into();
2746            self
2747        }
2748
2749        /// Sets the value of [spoke_locations][crate::model::ListHubSpokesRequest::spoke_locations].
2750        pub fn set_spoke_locations<T, V>(mut self, v: T) -> Self
2751        where
2752            T: std::iter::IntoIterator<Item = V>,
2753            V: std::convert::Into<std::string::String>,
2754        {
2755            use std::iter::Iterator;
2756            self.0.request.spoke_locations = v.into_iter().map(|i| i.into()).collect();
2757            self
2758        }
2759    }
2760
2761    #[doc(hidden)]
2762    impl gax::options::internal::RequestBuilder for ListHubSpokes {
2763        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2764            &mut self.0.options
2765        }
2766    }
2767
2768    /// The request builder for [HubService::query_hub_status][super::super::client::HubService::query_hub_status] calls.
2769    #[derive(Clone, Debug)]
2770    pub struct QueryHubStatus(RequestBuilder<crate::model::QueryHubStatusRequest>);
2771
2772    impl QueryHubStatus {
2773        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::HubService>) -> Self {
2774            Self(RequestBuilder::new(stub))
2775        }
2776
2777        /// Sets the full request, replacing any prior values.
2778        pub fn with_request<V: Into<crate::model::QueryHubStatusRequest>>(mut self, v: V) -> Self {
2779            self.0.request = v.into();
2780            self
2781        }
2782
2783        /// Sets all the options, replacing any prior values.
2784        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2785            self.0.options = v.into();
2786            self
2787        }
2788
2789        /// Sends the request.
2790        pub async fn send(self) -> Result<crate::model::QueryHubStatusResponse> {
2791            (*self.0.stub)
2792                .query_hub_status(self.0.request, self.0.options)
2793                .await
2794                .map(gax::response::Response::into_body)
2795        }
2796
2797        /// Streams the responses back.
2798        pub async fn paginator(
2799            self,
2800        ) -> impl gax::paginator::Paginator<crate::model::QueryHubStatusResponse, gax::error::Error>
2801        {
2802            use std::clone::Clone;
2803            let token = self.0.request.page_token.clone();
2804            let execute = move |token: String| {
2805                let mut builder = self.clone();
2806                builder.0.request = builder.0.request.set_page_token(token);
2807                builder.send()
2808            };
2809            gax::paginator::internal::new_paginator(token, execute)
2810        }
2811
2812        /// Sets the value of [name][crate::model::QueryHubStatusRequest::name].
2813        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2814            self.0.request.name = v.into();
2815            self
2816        }
2817
2818        /// Sets the value of [page_size][crate::model::QueryHubStatusRequest::page_size].
2819        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2820            self.0.request.page_size = v.into();
2821            self
2822        }
2823
2824        /// Sets the value of [page_token][crate::model::QueryHubStatusRequest::page_token].
2825        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2826            self.0.request.page_token = v.into();
2827            self
2828        }
2829
2830        /// Sets the value of [filter][crate::model::QueryHubStatusRequest::filter].
2831        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2832            self.0.request.filter = v.into();
2833            self
2834        }
2835
2836        /// Sets the value of [order_by][crate::model::QueryHubStatusRequest::order_by].
2837        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
2838            self.0.request.order_by = v.into();
2839            self
2840        }
2841
2842        /// Sets the value of [group_by][crate::model::QueryHubStatusRequest::group_by].
2843        pub fn set_group_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
2844            self.0.request.group_by = v.into();
2845            self
2846        }
2847    }
2848
2849    #[doc(hidden)]
2850    impl gax::options::internal::RequestBuilder for QueryHubStatus {
2851        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2852            &mut self.0.options
2853        }
2854    }
2855
2856    /// The request builder for [HubService::list_spokes][super::super::client::HubService::list_spokes] calls.
2857    #[derive(Clone, Debug)]
2858    pub struct ListSpokes(RequestBuilder<crate::model::ListSpokesRequest>);
2859
2860    impl ListSpokes {
2861        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::HubService>) -> Self {
2862            Self(RequestBuilder::new(stub))
2863        }
2864
2865        /// Sets the full request, replacing any prior values.
2866        pub fn with_request<V: Into<crate::model::ListSpokesRequest>>(mut self, v: V) -> Self {
2867            self.0.request = v.into();
2868            self
2869        }
2870
2871        /// Sets all the options, replacing any prior values.
2872        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2873            self.0.options = v.into();
2874            self
2875        }
2876
2877        /// Sends the request.
2878        pub async fn send(self) -> Result<crate::model::ListSpokesResponse> {
2879            (*self.0.stub)
2880                .list_spokes(self.0.request, self.0.options)
2881                .await
2882                .map(gax::response::Response::into_body)
2883        }
2884
2885        /// Streams the responses back.
2886        pub async fn paginator(
2887            self,
2888        ) -> impl gax::paginator::Paginator<crate::model::ListSpokesResponse, gax::error::Error>
2889        {
2890            use std::clone::Clone;
2891            let token = self.0.request.page_token.clone();
2892            let execute = move |token: String| {
2893                let mut builder = self.clone();
2894                builder.0.request = builder.0.request.set_page_token(token);
2895                builder.send()
2896            };
2897            gax::paginator::internal::new_paginator(token, execute)
2898        }
2899
2900        /// Sets the value of [parent][crate::model::ListSpokesRequest::parent].
2901        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2902            self.0.request.parent = v.into();
2903            self
2904        }
2905
2906        /// Sets the value of [page_size][crate::model::ListSpokesRequest::page_size].
2907        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2908            self.0.request.page_size = v.into();
2909            self
2910        }
2911
2912        /// Sets the value of [page_token][crate::model::ListSpokesRequest::page_token].
2913        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2914            self.0.request.page_token = v.into();
2915            self
2916        }
2917
2918        /// Sets the value of [filter][crate::model::ListSpokesRequest::filter].
2919        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2920            self.0.request.filter = v.into();
2921            self
2922        }
2923
2924        /// Sets the value of [order_by][crate::model::ListSpokesRequest::order_by].
2925        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
2926            self.0.request.order_by = v.into();
2927            self
2928        }
2929    }
2930
2931    #[doc(hidden)]
2932    impl gax::options::internal::RequestBuilder for ListSpokes {
2933        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2934            &mut self.0.options
2935        }
2936    }
2937
2938    /// The request builder for [HubService::get_spoke][super::super::client::HubService::get_spoke] calls.
2939    #[derive(Clone, Debug)]
2940    pub struct GetSpoke(RequestBuilder<crate::model::GetSpokeRequest>);
2941
2942    impl GetSpoke {
2943        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::HubService>) -> Self {
2944            Self(RequestBuilder::new(stub))
2945        }
2946
2947        /// Sets the full request, replacing any prior values.
2948        pub fn with_request<V: Into<crate::model::GetSpokeRequest>>(mut self, v: V) -> Self {
2949            self.0.request = v.into();
2950            self
2951        }
2952
2953        /// Sets all the options, replacing any prior values.
2954        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2955            self.0.options = v.into();
2956            self
2957        }
2958
2959        /// Sends the request.
2960        pub async fn send(self) -> Result<crate::model::Spoke> {
2961            (*self.0.stub)
2962                .get_spoke(self.0.request, self.0.options)
2963                .await
2964                .map(gax::response::Response::into_body)
2965        }
2966
2967        /// Sets the value of [name][crate::model::GetSpokeRequest::name].
2968        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2969            self.0.request.name = v.into();
2970            self
2971        }
2972    }
2973
2974    #[doc(hidden)]
2975    impl gax::options::internal::RequestBuilder for GetSpoke {
2976        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2977            &mut self.0.options
2978        }
2979    }
2980
2981    /// The request builder for [HubService::create_spoke][super::super::client::HubService::create_spoke] calls.
2982    #[derive(Clone, Debug)]
2983    pub struct CreateSpoke(RequestBuilder<crate::model::CreateSpokeRequest>);
2984
2985    impl CreateSpoke {
2986        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::HubService>) -> Self {
2987            Self(RequestBuilder::new(stub))
2988        }
2989
2990        /// Sets the full request, replacing any prior values.
2991        pub fn with_request<V: Into<crate::model::CreateSpokeRequest>>(mut self, v: V) -> Self {
2992            self.0.request = v.into();
2993            self
2994        }
2995
2996        /// Sets all the options, replacing any prior values.
2997        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2998            self.0.options = v.into();
2999            self
3000        }
3001
3002        /// Sends the request.
3003        ///
3004        /// # Long running operations
3005        ///
3006        /// This starts, but does not poll, a longrunning operation. More information
3007        /// on [create_spoke][super::super::client::HubService::create_spoke].
3008        pub async fn send(self) -> Result<longrunning::model::Operation> {
3009            (*self.0.stub)
3010                .create_spoke(self.0.request, self.0.options)
3011                .await
3012                .map(gax::response::Response::into_body)
3013        }
3014
3015        /// Creates a [Poller][lro::Poller] to work with `create_spoke`.
3016        pub fn poller(
3017            self,
3018        ) -> impl lro::Poller<crate::model::Spoke, crate::model::OperationMetadata> {
3019            type Operation = lro::Operation<crate::model::Spoke, crate::model::OperationMetadata>;
3020            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3021            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3022
3023            let stub = self.0.stub.clone();
3024            let mut options = self.0.options.clone();
3025            options.set_retry_policy(gax::retry_policy::NeverRetry);
3026            let query = move |name| {
3027                let stub = stub.clone();
3028                let options = options.clone();
3029                async {
3030                    let op = GetOperation::new(stub)
3031                        .set_name(name)
3032                        .with_options(options)
3033                        .send()
3034                        .await?;
3035                    Ok(Operation::new(op))
3036                }
3037            };
3038
3039            let start = move || async {
3040                let op = self.send().await?;
3041                Ok(Operation::new(op))
3042            };
3043
3044            lro::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3045        }
3046
3047        /// Sets the value of [parent][crate::model::CreateSpokeRequest::parent].
3048        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3049            self.0.request.parent = v.into();
3050            self
3051        }
3052
3053        /// Sets the value of [spoke_id][crate::model::CreateSpokeRequest::spoke_id].
3054        pub fn set_spoke_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3055            self.0.request.spoke_id = v.into();
3056            self
3057        }
3058
3059        /// Sets the value of [spoke][crate::model::CreateSpokeRequest::spoke].
3060        pub fn set_spoke<T: Into<std::option::Option<crate::model::Spoke>>>(
3061            mut self,
3062            v: T,
3063        ) -> Self {
3064            self.0.request.spoke = v.into();
3065            self
3066        }
3067
3068        /// Sets the value of [request_id][crate::model::CreateSpokeRequest::request_id].
3069        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3070            self.0.request.request_id = v.into();
3071            self
3072        }
3073    }
3074
3075    #[doc(hidden)]
3076    impl gax::options::internal::RequestBuilder for CreateSpoke {
3077        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3078            &mut self.0.options
3079        }
3080    }
3081
3082    /// The request builder for [HubService::update_spoke][super::super::client::HubService::update_spoke] calls.
3083    #[derive(Clone, Debug)]
3084    pub struct UpdateSpoke(RequestBuilder<crate::model::UpdateSpokeRequest>);
3085
3086    impl UpdateSpoke {
3087        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::HubService>) -> Self {
3088            Self(RequestBuilder::new(stub))
3089        }
3090
3091        /// Sets the full request, replacing any prior values.
3092        pub fn with_request<V: Into<crate::model::UpdateSpokeRequest>>(mut self, v: V) -> Self {
3093            self.0.request = v.into();
3094            self
3095        }
3096
3097        /// Sets all the options, replacing any prior values.
3098        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3099            self.0.options = v.into();
3100            self
3101        }
3102
3103        /// Sends the request.
3104        ///
3105        /// # Long running operations
3106        ///
3107        /// This starts, but does not poll, a longrunning operation. More information
3108        /// on [update_spoke][super::super::client::HubService::update_spoke].
3109        pub async fn send(self) -> Result<longrunning::model::Operation> {
3110            (*self.0.stub)
3111                .update_spoke(self.0.request, self.0.options)
3112                .await
3113                .map(gax::response::Response::into_body)
3114        }
3115
3116        /// Creates a [Poller][lro::Poller] to work with `update_spoke`.
3117        pub fn poller(
3118            self,
3119        ) -> impl lro::Poller<crate::model::Spoke, crate::model::OperationMetadata> {
3120            type Operation = lro::Operation<crate::model::Spoke, crate::model::OperationMetadata>;
3121            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3122            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3123
3124            let stub = self.0.stub.clone();
3125            let mut options = self.0.options.clone();
3126            options.set_retry_policy(gax::retry_policy::NeverRetry);
3127            let query = move |name| {
3128                let stub = stub.clone();
3129                let options = options.clone();
3130                async {
3131                    let op = GetOperation::new(stub)
3132                        .set_name(name)
3133                        .with_options(options)
3134                        .send()
3135                        .await?;
3136                    Ok(Operation::new(op))
3137                }
3138            };
3139
3140            let start = move || async {
3141                let op = self.send().await?;
3142                Ok(Operation::new(op))
3143            };
3144
3145            lro::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3146        }
3147
3148        /// Sets the value of [update_mask][crate::model::UpdateSpokeRequest::update_mask].
3149        pub fn set_update_mask<T: Into<std::option::Option<wkt::FieldMask>>>(
3150            mut self,
3151            v: T,
3152        ) -> Self {
3153            self.0.request.update_mask = v.into();
3154            self
3155        }
3156
3157        /// Sets the value of [spoke][crate::model::UpdateSpokeRequest::spoke].
3158        pub fn set_spoke<T: Into<std::option::Option<crate::model::Spoke>>>(
3159            mut self,
3160            v: T,
3161        ) -> Self {
3162            self.0.request.spoke = v.into();
3163            self
3164        }
3165
3166        /// Sets the value of [request_id][crate::model::UpdateSpokeRequest::request_id].
3167        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3168            self.0.request.request_id = v.into();
3169            self
3170        }
3171    }
3172
3173    #[doc(hidden)]
3174    impl gax::options::internal::RequestBuilder for UpdateSpoke {
3175        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3176            &mut self.0.options
3177        }
3178    }
3179
3180    /// The request builder for [HubService::reject_hub_spoke][super::super::client::HubService::reject_hub_spoke] calls.
3181    #[derive(Clone, Debug)]
3182    pub struct RejectHubSpoke(RequestBuilder<crate::model::RejectHubSpokeRequest>);
3183
3184    impl RejectHubSpoke {
3185        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::HubService>) -> Self {
3186            Self(RequestBuilder::new(stub))
3187        }
3188
3189        /// Sets the full request, replacing any prior values.
3190        pub fn with_request<V: Into<crate::model::RejectHubSpokeRequest>>(mut self, v: V) -> Self {
3191            self.0.request = v.into();
3192            self
3193        }
3194
3195        /// Sets all the options, replacing any prior values.
3196        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3197            self.0.options = v.into();
3198            self
3199        }
3200
3201        /// Sends the request.
3202        ///
3203        /// # Long running operations
3204        ///
3205        /// This starts, but does not poll, a longrunning operation. More information
3206        /// on [reject_hub_spoke][super::super::client::HubService::reject_hub_spoke].
3207        pub async fn send(self) -> Result<longrunning::model::Operation> {
3208            (*self.0.stub)
3209                .reject_hub_spoke(self.0.request, self.0.options)
3210                .await
3211                .map(gax::response::Response::into_body)
3212        }
3213
3214        /// Creates a [Poller][lro::Poller] to work with `reject_hub_spoke`.
3215        pub fn poller(
3216            self,
3217        ) -> impl lro::Poller<crate::model::RejectHubSpokeResponse, crate::model::OperationMetadata>
3218        {
3219            type Operation = lro::Operation<
3220                crate::model::RejectHubSpokeResponse,
3221                crate::model::OperationMetadata,
3222            >;
3223            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3224            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3225
3226            let stub = self.0.stub.clone();
3227            let mut options = self.0.options.clone();
3228            options.set_retry_policy(gax::retry_policy::NeverRetry);
3229            let query = move |name| {
3230                let stub = stub.clone();
3231                let options = options.clone();
3232                async {
3233                    let op = GetOperation::new(stub)
3234                        .set_name(name)
3235                        .with_options(options)
3236                        .send()
3237                        .await?;
3238                    Ok(Operation::new(op))
3239                }
3240            };
3241
3242            let start = move || async {
3243                let op = self.send().await?;
3244                Ok(Operation::new(op))
3245            };
3246
3247            lro::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3248        }
3249
3250        /// Sets the value of [name][crate::model::RejectHubSpokeRequest::name].
3251        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3252            self.0.request.name = v.into();
3253            self
3254        }
3255
3256        /// Sets the value of [spoke_uri][crate::model::RejectHubSpokeRequest::spoke_uri].
3257        pub fn set_spoke_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
3258            self.0.request.spoke_uri = v.into();
3259            self
3260        }
3261
3262        /// Sets the value of [request_id][crate::model::RejectHubSpokeRequest::request_id].
3263        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3264            self.0.request.request_id = v.into();
3265            self
3266        }
3267
3268        /// Sets the value of [details][crate::model::RejectHubSpokeRequest::details].
3269        pub fn set_details<T: Into<std::string::String>>(mut self, v: T) -> Self {
3270            self.0.request.details = v.into();
3271            self
3272        }
3273    }
3274
3275    #[doc(hidden)]
3276    impl gax::options::internal::RequestBuilder for RejectHubSpoke {
3277        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3278            &mut self.0.options
3279        }
3280    }
3281
3282    /// The request builder for [HubService::accept_hub_spoke][super::super::client::HubService::accept_hub_spoke] calls.
3283    #[derive(Clone, Debug)]
3284    pub struct AcceptHubSpoke(RequestBuilder<crate::model::AcceptHubSpokeRequest>);
3285
3286    impl AcceptHubSpoke {
3287        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::HubService>) -> Self {
3288            Self(RequestBuilder::new(stub))
3289        }
3290
3291        /// Sets the full request, replacing any prior values.
3292        pub fn with_request<V: Into<crate::model::AcceptHubSpokeRequest>>(mut self, v: V) -> Self {
3293            self.0.request = v.into();
3294            self
3295        }
3296
3297        /// Sets all the options, replacing any prior values.
3298        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3299            self.0.options = v.into();
3300            self
3301        }
3302
3303        /// Sends the request.
3304        ///
3305        /// # Long running operations
3306        ///
3307        /// This starts, but does not poll, a longrunning operation. More information
3308        /// on [accept_hub_spoke][super::super::client::HubService::accept_hub_spoke].
3309        pub async fn send(self) -> Result<longrunning::model::Operation> {
3310            (*self.0.stub)
3311                .accept_hub_spoke(self.0.request, self.0.options)
3312                .await
3313                .map(gax::response::Response::into_body)
3314        }
3315
3316        /// Creates a [Poller][lro::Poller] to work with `accept_hub_spoke`.
3317        pub fn poller(
3318            self,
3319        ) -> impl lro::Poller<crate::model::AcceptHubSpokeResponse, crate::model::OperationMetadata>
3320        {
3321            type Operation = lro::Operation<
3322                crate::model::AcceptHubSpokeResponse,
3323                crate::model::OperationMetadata,
3324            >;
3325            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3326            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3327
3328            let stub = self.0.stub.clone();
3329            let mut options = self.0.options.clone();
3330            options.set_retry_policy(gax::retry_policy::NeverRetry);
3331            let query = move |name| {
3332                let stub = stub.clone();
3333                let options = options.clone();
3334                async {
3335                    let op = GetOperation::new(stub)
3336                        .set_name(name)
3337                        .with_options(options)
3338                        .send()
3339                        .await?;
3340                    Ok(Operation::new(op))
3341                }
3342            };
3343
3344            let start = move || async {
3345                let op = self.send().await?;
3346                Ok(Operation::new(op))
3347            };
3348
3349            lro::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3350        }
3351
3352        /// Sets the value of [name][crate::model::AcceptHubSpokeRequest::name].
3353        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3354            self.0.request.name = v.into();
3355            self
3356        }
3357
3358        /// Sets the value of [spoke_uri][crate::model::AcceptHubSpokeRequest::spoke_uri].
3359        pub fn set_spoke_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
3360            self.0.request.spoke_uri = v.into();
3361            self
3362        }
3363
3364        /// Sets the value of [request_id][crate::model::AcceptHubSpokeRequest::request_id].
3365        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3366            self.0.request.request_id = v.into();
3367            self
3368        }
3369    }
3370
3371    #[doc(hidden)]
3372    impl gax::options::internal::RequestBuilder for AcceptHubSpoke {
3373        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3374            &mut self.0.options
3375        }
3376    }
3377
3378    /// The request builder for [HubService::accept_spoke_update][super::super::client::HubService::accept_spoke_update] calls.
3379    #[derive(Clone, Debug)]
3380    pub struct AcceptSpokeUpdate(RequestBuilder<crate::model::AcceptSpokeUpdateRequest>);
3381
3382    impl AcceptSpokeUpdate {
3383        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::HubService>) -> Self {
3384            Self(RequestBuilder::new(stub))
3385        }
3386
3387        /// Sets the full request, replacing any prior values.
3388        pub fn with_request<V: Into<crate::model::AcceptSpokeUpdateRequest>>(
3389            mut self,
3390            v: V,
3391        ) -> Self {
3392            self.0.request = v.into();
3393            self
3394        }
3395
3396        /// Sets all the options, replacing any prior values.
3397        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3398            self.0.options = v.into();
3399            self
3400        }
3401
3402        /// Sends the request.
3403        ///
3404        /// # Long running operations
3405        ///
3406        /// This starts, but does not poll, a longrunning operation. More information
3407        /// on [accept_spoke_update][super::super::client::HubService::accept_spoke_update].
3408        pub async fn send(self) -> Result<longrunning::model::Operation> {
3409            (*self.0.stub)
3410                .accept_spoke_update(self.0.request, self.0.options)
3411                .await
3412                .map(gax::response::Response::into_body)
3413        }
3414
3415        /// Creates a [Poller][lro::Poller] to work with `accept_spoke_update`.
3416        pub fn poller(
3417            self,
3418        ) -> impl lro::Poller<crate::model::AcceptSpokeUpdateResponse, crate::model::OperationMetadata>
3419        {
3420            type Operation = lro::Operation<
3421                crate::model::AcceptSpokeUpdateResponse,
3422                crate::model::OperationMetadata,
3423            >;
3424            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3425            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3426
3427            let stub = self.0.stub.clone();
3428            let mut options = self.0.options.clone();
3429            options.set_retry_policy(gax::retry_policy::NeverRetry);
3430            let query = move |name| {
3431                let stub = stub.clone();
3432                let options = options.clone();
3433                async {
3434                    let op = GetOperation::new(stub)
3435                        .set_name(name)
3436                        .with_options(options)
3437                        .send()
3438                        .await?;
3439                    Ok(Operation::new(op))
3440                }
3441            };
3442
3443            let start = move || async {
3444                let op = self.send().await?;
3445                Ok(Operation::new(op))
3446            };
3447
3448            lro::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3449        }
3450
3451        /// Sets the value of [name][crate::model::AcceptSpokeUpdateRequest::name].
3452        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3453            self.0.request.name = v.into();
3454            self
3455        }
3456
3457        /// Sets the value of [spoke_uri][crate::model::AcceptSpokeUpdateRequest::spoke_uri].
3458        pub fn set_spoke_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
3459            self.0.request.spoke_uri = v.into();
3460            self
3461        }
3462
3463        /// Sets the value of [spoke_etag][crate::model::AcceptSpokeUpdateRequest::spoke_etag].
3464        pub fn set_spoke_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
3465            self.0.request.spoke_etag = v.into();
3466            self
3467        }
3468
3469        /// Sets the value of [request_id][crate::model::AcceptSpokeUpdateRequest::request_id].
3470        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3471            self.0.request.request_id = v.into();
3472            self
3473        }
3474    }
3475
3476    #[doc(hidden)]
3477    impl gax::options::internal::RequestBuilder for AcceptSpokeUpdate {
3478        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3479            &mut self.0.options
3480        }
3481    }
3482
3483    /// The request builder for [HubService::reject_spoke_update][super::super::client::HubService::reject_spoke_update] calls.
3484    #[derive(Clone, Debug)]
3485    pub struct RejectSpokeUpdate(RequestBuilder<crate::model::RejectSpokeUpdateRequest>);
3486
3487    impl RejectSpokeUpdate {
3488        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::HubService>) -> Self {
3489            Self(RequestBuilder::new(stub))
3490        }
3491
3492        /// Sets the full request, replacing any prior values.
3493        pub fn with_request<V: Into<crate::model::RejectSpokeUpdateRequest>>(
3494            mut self,
3495            v: V,
3496        ) -> Self {
3497            self.0.request = v.into();
3498            self
3499        }
3500
3501        /// Sets all the options, replacing any prior values.
3502        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3503            self.0.options = v.into();
3504            self
3505        }
3506
3507        /// Sends the request.
3508        ///
3509        /// # Long running operations
3510        ///
3511        /// This starts, but does not poll, a longrunning operation. More information
3512        /// on [reject_spoke_update][super::super::client::HubService::reject_spoke_update].
3513        pub async fn send(self) -> Result<longrunning::model::Operation> {
3514            (*self.0.stub)
3515                .reject_spoke_update(self.0.request, self.0.options)
3516                .await
3517                .map(gax::response::Response::into_body)
3518        }
3519
3520        /// Creates a [Poller][lro::Poller] to work with `reject_spoke_update`.
3521        pub fn poller(
3522            self,
3523        ) -> impl lro::Poller<crate::model::RejectSpokeUpdateResponse, crate::model::OperationMetadata>
3524        {
3525            type Operation = lro::Operation<
3526                crate::model::RejectSpokeUpdateResponse,
3527                crate::model::OperationMetadata,
3528            >;
3529            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3530            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3531
3532            let stub = self.0.stub.clone();
3533            let mut options = self.0.options.clone();
3534            options.set_retry_policy(gax::retry_policy::NeverRetry);
3535            let query = move |name| {
3536                let stub = stub.clone();
3537                let options = options.clone();
3538                async {
3539                    let op = GetOperation::new(stub)
3540                        .set_name(name)
3541                        .with_options(options)
3542                        .send()
3543                        .await?;
3544                    Ok(Operation::new(op))
3545                }
3546            };
3547
3548            let start = move || async {
3549                let op = self.send().await?;
3550                Ok(Operation::new(op))
3551            };
3552
3553            lro::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3554        }
3555
3556        /// Sets the value of [name][crate::model::RejectSpokeUpdateRequest::name].
3557        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3558            self.0.request.name = v.into();
3559            self
3560        }
3561
3562        /// Sets the value of [spoke_uri][crate::model::RejectSpokeUpdateRequest::spoke_uri].
3563        pub fn set_spoke_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
3564            self.0.request.spoke_uri = v.into();
3565            self
3566        }
3567
3568        /// Sets the value of [spoke_etag][crate::model::RejectSpokeUpdateRequest::spoke_etag].
3569        pub fn set_spoke_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
3570            self.0.request.spoke_etag = v.into();
3571            self
3572        }
3573
3574        /// Sets the value of [details][crate::model::RejectSpokeUpdateRequest::details].
3575        pub fn set_details<T: Into<std::string::String>>(mut self, v: T) -> Self {
3576            self.0.request.details = v.into();
3577            self
3578        }
3579
3580        /// Sets the value of [request_id][crate::model::RejectSpokeUpdateRequest::request_id].
3581        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3582            self.0.request.request_id = v.into();
3583            self
3584        }
3585    }
3586
3587    #[doc(hidden)]
3588    impl gax::options::internal::RequestBuilder for RejectSpokeUpdate {
3589        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3590            &mut self.0.options
3591        }
3592    }
3593
3594    /// The request builder for [HubService::delete_spoke][super::super::client::HubService::delete_spoke] calls.
3595    #[derive(Clone, Debug)]
3596    pub struct DeleteSpoke(RequestBuilder<crate::model::DeleteSpokeRequest>);
3597
3598    impl DeleteSpoke {
3599        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::HubService>) -> Self {
3600            Self(RequestBuilder::new(stub))
3601        }
3602
3603        /// Sets the full request, replacing any prior values.
3604        pub fn with_request<V: Into<crate::model::DeleteSpokeRequest>>(mut self, v: V) -> Self {
3605            self.0.request = v.into();
3606            self
3607        }
3608
3609        /// Sets all the options, replacing any prior values.
3610        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3611            self.0.options = v.into();
3612            self
3613        }
3614
3615        /// Sends the request.
3616        ///
3617        /// # Long running operations
3618        ///
3619        /// This starts, but does not poll, a longrunning operation. More information
3620        /// on [delete_spoke][super::super::client::HubService::delete_spoke].
3621        pub async fn send(self) -> Result<longrunning::model::Operation> {
3622            (*self.0.stub)
3623                .delete_spoke(self.0.request, self.0.options)
3624                .await
3625                .map(gax::response::Response::into_body)
3626        }
3627
3628        /// Creates a [Poller][lro::Poller] to work with `delete_spoke`.
3629        pub fn poller(self) -> impl lro::Poller<wkt::Empty, crate::model::OperationMetadata> {
3630            type Operation = lro::Operation<wkt::Empty, crate::model::OperationMetadata>;
3631            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3632            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3633
3634            let stub = self.0.stub.clone();
3635            let mut options = self.0.options.clone();
3636            options.set_retry_policy(gax::retry_policy::NeverRetry);
3637            let query = move |name| {
3638                let stub = stub.clone();
3639                let options = options.clone();
3640                async {
3641                    let op = GetOperation::new(stub)
3642                        .set_name(name)
3643                        .with_options(options)
3644                        .send()
3645                        .await?;
3646                    Ok(Operation::new(op))
3647                }
3648            };
3649
3650            let start = move || async {
3651                let op = self.send().await?;
3652                Ok(Operation::new(op))
3653            };
3654
3655            lro::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3656        }
3657
3658        /// Sets the value of [name][crate::model::DeleteSpokeRequest::name].
3659        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3660            self.0.request.name = v.into();
3661            self
3662        }
3663
3664        /// Sets the value of [request_id][crate::model::DeleteSpokeRequest::request_id].
3665        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3666            self.0.request.request_id = v.into();
3667            self
3668        }
3669    }
3670
3671    #[doc(hidden)]
3672    impl gax::options::internal::RequestBuilder for DeleteSpoke {
3673        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3674            &mut self.0.options
3675        }
3676    }
3677
3678    /// The request builder for [HubService::get_route_table][super::super::client::HubService::get_route_table] calls.
3679    #[derive(Clone, Debug)]
3680    pub struct GetRouteTable(RequestBuilder<crate::model::GetRouteTableRequest>);
3681
3682    impl GetRouteTable {
3683        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::HubService>) -> Self {
3684            Self(RequestBuilder::new(stub))
3685        }
3686
3687        /// Sets the full request, replacing any prior values.
3688        pub fn with_request<V: Into<crate::model::GetRouteTableRequest>>(mut self, v: V) -> Self {
3689            self.0.request = v.into();
3690            self
3691        }
3692
3693        /// Sets all the options, replacing any prior values.
3694        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3695            self.0.options = v.into();
3696            self
3697        }
3698
3699        /// Sends the request.
3700        pub async fn send(self) -> Result<crate::model::RouteTable> {
3701            (*self.0.stub)
3702                .get_route_table(self.0.request, self.0.options)
3703                .await
3704                .map(gax::response::Response::into_body)
3705        }
3706
3707        /// Sets the value of [name][crate::model::GetRouteTableRequest::name].
3708        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3709            self.0.request.name = v.into();
3710            self
3711        }
3712    }
3713
3714    #[doc(hidden)]
3715    impl gax::options::internal::RequestBuilder for GetRouteTable {
3716        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3717            &mut self.0.options
3718        }
3719    }
3720
3721    /// The request builder for [HubService::get_route][super::super::client::HubService::get_route] calls.
3722    #[derive(Clone, Debug)]
3723    pub struct GetRoute(RequestBuilder<crate::model::GetRouteRequest>);
3724
3725    impl GetRoute {
3726        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::HubService>) -> Self {
3727            Self(RequestBuilder::new(stub))
3728        }
3729
3730        /// Sets the full request, replacing any prior values.
3731        pub fn with_request<V: Into<crate::model::GetRouteRequest>>(mut self, v: V) -> Self {
3732            self.0.request = v.into();
3733            self
3734        }
3735
3736        /// Sets all the options, replacing any prior values.
3737        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3738            self.0.options = v.into();
3739            self
3740        }
3741
3742        /// Sends the request.
3743        pub async fn send(self) -> Result<crate::model::Route> {
3744            (*self.0.stub)
3745                .get_route(self.0.request, self.0.options)
3746                .await
3747                .map(gax::response::Response::into_body)
3748        }
3749
3750        /// Sets the value of [name][crate::model::GetRouteRequest::name].
3751        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3752            self.0.request.name = v.into();
3753            self
3754        }
3755    }
3756
3757    #[doc(hidden)]
3758    impl gax::options::internal::RequestBuilder for GetRoute {
3759        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3760            &mut self.0.options
3761        }
3762    }
3763
3764    /// The request builder for [HubService::list_routes][super::super::client::HubService::list_routes] calls.
3765    #[derive(Clone, Debug)]
3766    pub struct ListRoutes(RequestBuilder<crate::model::ListRoutesRequest>);
3767
3768    impl ListRoutes {
3769        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::HubService>) -> Self {
3770            Self(RequestBuilder::new(stub))
3771        }
3772
3773        /// Sets the full request, replacing any prior values.
3774        pub fn with_request<V: Into<crate::model::ListRoutesRequest>>(mut self, v: V) -> Self {
3775            self.0.request = v.into();
3776            self
3777        }
3778
3779        /// Sets all the options, replacing any prior values.
3780        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3781            self.0.options = v.into();
3782            self
3783        }
3784
3785        /// Sends the request.
3786        pub async fn send(self) -> Result<crate::model::ListRoutesResponse> {
3787            (*self.0.stub)
3788                .list_routes(self.0.request, self.0.options)
3789                .await
3790                .map(gax::response::Response::into_body)
3791        }
3792
3793        /// Streams the responses back.
3794        pub async fn paginator(
3795            self,
3796        ) -> impl gax::paginator::Paginator<crate::model::ListRoutesResponse, gax::error::Error>
3797        {
3798            use std::clone::Clone;
3799            let token = self.0.request.page_token.clone();
3800            let execute = move |token: String| {
3801                let mut builder = self.clone();
3802                builder.0.request = builder.0.request.set_page_token(token);
3803                builder.send()
3804            };
3805            gax::paginator::internal::new_paginator(token, execute)
3806        }
3807
3808        /// Sets the value of [parent][crate::model::ListRoutesRequest::parent].
3809        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3810            self.0.request.parent = v.into();
3811            self
3812        }
3813
3814        /// Sets the value of [page_size][crate::model::ListRoutesRequest::page_size].
3815        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3816            self.0.request.page_size = v.into();
3817            self
3818        }
3819
3820        /// Sets the value of [page_token][crate::model::ListRoutesRequest::page_token].
3821        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3822            self.0.request.page_token = v.into();
3823            self
3824        }
3825
3826        /// Sets the value of [filter][crate::model::ListRoutesRequest::filter].
3827        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3828            self.0.request.filter = v.into();
3829            self
3830        }
3831
3832        /// Sets the value of [order_by][crate::model::ListRoutesRequest::order_by].
3833        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3834            self.0.request.order_by = v.into();
3835            self
3836        }
3837    }
3838
3839    #[doc(hidden)]
3840    impl gax::options::internal::RequestBuilder for ListRoutes {
3841        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3842            &mut self.0.options
3843        }
3844    }
3845
3846    /// The request builder for [HubService::list_route_tables][super::super::client::HubService::list_route_tables] calls.
3847    #[derive(Clone, Debug)]
3848    pub struct ListRouteTables(RequestBuilder<crate::model::ListRouteTablesRequest>);
3849
3850    impl ListRouteTables {
3851        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::HubService>) -> Self {
3852            Self(RequestBuilder::new(stub))
3853        }
3854
3855        /// Sets the full request, replacing any prior values.
3856        pub fn with_request<V: Into<crate::model::ListRouteTablesRequest>>(mut self, v: V) -> Self {
3857            self.0.request = v.into();
3858            self
3859        }
3860
3861        /// Sets all the options, replacing any prior values.
3862        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3863            self.0.options = v.into();
3864            self
3865        }
3866
3867        /// Sends the request.
3868        pub async fn send(self) -> Result<crate::model::ListRouteTablesResponse> {
3869            (*self.0.stub)
3870                .list_route_tables(self.0.request, self.0.options)
3871                .await
3872                .map(gax::response::Response::into_body)
3873        }
3874
3875        /// Streams the responses back.
3876        pub async fn paginator(
3877            self,
3878        ) -> impl gax::paginator::Paginator<crate::model::ListRouteTablesResponse, gax::error::Error>
3879        {
3880            use std::clone::Clone;
3881            let token = self.0.request.page_token.clone();
3882            let execute = move |token: String| {
3883                let mut builder = self.clone();
3884                builder.0.request = builder.0.request.set_page_token(token);
3885                builder.send()
3886            };
3887            gax::paginator::internal::new_paginator(token, execute)
3888        }
3889
3890        /// Sets the value of [parent][crate::model::ListRouteTablesRequest::parent].
3891        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3892            self.0.request.parent = v.into();
3893            self
3894        }
3895
3896        /// Sets the value of [page_size][crate::model::ListRouteTablesRequest::page_size].
3897        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3898            self.0.request.page_size = v.into();
3899            self
3900        }
3901
3902        /// Sets the value of [page_token][crate::model::ListRouteTablesRequest::page_token].
3903        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3904            self.0.request.page_token = v.into();
3905            self
3906        }
3907
3908        /// Sets the value of [filter][crate::model::ListRouteTablesRequest::filter].
3909        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3910            self.0.request.filter = v.into();
3911            self
3912        }
3913
3914        /// Sets the value of [order_by][crate::model::ListRouteTablesRequest::order_by].
3915        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3916            self.0.request.order_by = v.into();
3917            self
3918        }
3919    }
3920
3921    #[doc(hidden)]
3922    impl gax::options::internal::RequestBuilder for ListRouteTables {
3923        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3924            &mut self.0.options
3925        }
3926    }
3927
3928    /// The request builder for [HubService::get_group][super::super::client::HubService::get_group] calls.
3929    #[derive(Clone, Debug)]
3930    pub struct GetGroup(RequestBuilder<crate::model::GetGroupRequest>);
3931
3932    impl GetGroup {
3933        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::HubService>) -> Self {
3934            Self(RequestBuilder::new(stub))
3935        }
3936
3937        /// Sets the full request, replacing any prior values.
3938        pub fn with_request<V: Into<crate::model::GetGroupRequest>>(mut self, v: V) -> Self {
3939            self.0.request = v.into();
3940            self
3941        }
3942
3943        /// Sets all the options, replacing any prior values.
3944        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3945            self.0.options = v.into();
3946            self
3947        }
3948
3949        /// Sends the request.
3950        pub async fn send(self) -> Result<crate::model::Group> {
3951            (*self.0.stub)
3952                .get_group(self.0.request, self.0.options)
3953                .await
3954                .map(gax::response::Response::into_body)
3955        }
3956
3957        /// Sets the value of [name][crate::model::GetGroupRequest::name].
3958        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3959            self.0.request.name = v.into();
3960            self
3961        }
3962    }
3963
3964    #[doc(hidden)]
3965    impl gax::options::internal::RequestBuilder for GetGroup {
3966        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3967            &mut self.0.options
3968        }
3969    }
3970
3971    /// The request builder for [HubService::list_groups][super::super::client::HubService::list_groups] calls.
3972    #[derive(Clone, Debug)]
3973    pub struct ListGroups(RequestBuilder<crate::model::ListGroupsRequest>);
3974
3975    impl ListGroups {
3976        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::HubService>) -> Self {
3977            Self(RequestBuilder::new(stub))
3978        }
3979
3980        /// Sets the full request, replacing any prior values.
3981        pub fn with_request<V: Into<crate::model::ListGroupsRequest>>(mut self, v: V) -> Self {
3982            self.0.request = v.into();
3983            self
3984        }
3985
3986        /// Sets all the options, replacing any prior values.
3987        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3988            self.0.options = v.into();
3989            self
3990        }
3991
3992        /// Sends the request.
3993        pub async fn send(self) -> Result<crate::model::ListGroupsResponse> {
3994            (*self.0.stub)
3995                .list_groups(self.0.request, self.0.options)
3996                .await
3997                .map(gax::response::Response::into_body)
3998        }
3999
4000        /// Streams the responses back.
4001        pub async fn paginator(
4002            self,
4003        ) -> impl gax::paginator::Paginator<crate::model::ListGroupsResponse, gax::error::Error>
4004        {
4005            use std::clone::Clone;
4006            let token = self.0.request.page_token.clone();
4007            let execute = move |token: String| {
4008                let mut builder = self.clone();
4009                builder.0.request = builder.0.request.set_page_token(token);
4010                builder.send()
4011            };
4012            gax::paginator::internal::new_paginator(token, execute)
4013        }
4014
4015        /// Sets the value of [parent][crate::model::ListGroupsRequest::parent].
4016        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4017            self.0.request.parent = v.into();
4018            self
4019        }
4020
4021        /// Sets the value of [page_size][crate::model::ListGroupsRequest::page_size].
4022        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4023            self.0.request.page_size = v.into();
4024            self
4025        }
4026
4027        /// Sets the value of [page_token][crate::model::ListGroupsRequest::page_token].
4028        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4029            self.0.request.page_token = v.into();
4030            self
4031        }
4032
4033        /// Sets the value of [filter][crate::model::ListGroupsRequest::filter].
4034        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4035            self.0.request.filter = v.into();
4036            self
4037        }
4038
4039        /// Sets the value of [order_by][crate::model::ListGroupsRequest::order_by].
4040        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
4041            self.0.request.order_by = v.into();
4042            self
4043        }
4044    }
4045
4046    #[doc(hidden)]
4047    impl gax::options::internal::RequestBuilder for ListGroups {
4048        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4049            &mut self.0.options
4050        }
4051    }
4052
4053    /// The request builder for [HubService::update_group][super::super::client::HubService::update_group] calls.
4054    #[derive(Clone, Debug)]
4055    pub struct UpdateGroup(RequestBuilder<crate::model::UpdateGroupRequest>);
4056
4057    impl UpdateGroup {
4058        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::HubService>) -> Self {
4059            Self(RequestBuilder::new(stub))
4060        }
4061
4062        /// Sets the full request, replacing any prior values.
4063        pub fn with_request<V: Into<crate::model::UpdateGroupRequest>>(mut self, v: V) -> Self {
4064            self.0.request = v.into();
4065            self
4066        }
4067
4068        /// Sets all the options, replacing any prior values.
4069        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4070            self.0.options = v.into();
4071            self
4072        }
4073
4074        /// Sends the request.
4075        ///
4076        /// # Long running operations
4077        ///
4078        /// This starts, but does not poll, a longrunning operation. More information
4079        /// on [update_group][super::super::client::HubService::update_group].
4080        pub async fn send(self) -> Result<longrunning::model::Operation> {
4081            (*self.0.stub)
4082                .update_group(self.0.request, self.0.options)
4083                .await
4084                .map(gax::response::Response::into_body)
4085        }
4086
4087        /// Creates a [Poller][lro::Poller] to work with `update_group`.
4088        pub fn poller(
4089            self,
4090        ) -> impl lro::Poller<crate::model::Group, crate::model::OperationMetadata> {
4091            type Operation = lro::Operation<crate::model::Group, crate::model::OperationMetadata>;
4092            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4093            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4094
4095            let stub = self.0.stub.clone();
4096            let mut options = self.0.options.clone();
4097            options.set_retry_policy(gax::retry_policy::NeverRetry);
4098            let query = move |name| {
4099                let stub = stub.clone();
4100                let options = options.clone();
4101                async {
4102                    let op = GetOperation::new(stub)
4103                        .set_name(name)
4104                        .with_options(options)
4105                        .send()
4106                        .await?;
4107                    Ok(Operation::new(op))
4108                }
4109            };
4110
4111            let start = move || async {
4112                let op = self.send().await?;
4113                Ok(Operation::new(op))
4114            };
4115
4116            lro::new_poller(polling_error_policy, polling_backoff_policy, start, query)
4117        }
4118
4119        /// Sets the value of [update_mask][crate::model::UpdateGroupRequest::update_mask].
4120        pub fn set_update_mask<T: Into<std::option::Option<wkt::FieldMask>>>(
4121            mut self,
4122            v: T,
4123        ) -> Self {
4124            self.0.request.update_mask = v.into();
4125            self
4126        }
4127
4128        /// Sets the value of [group][crate::model::UpdateGroupRequest::group].
4129        pub fn set_group<T: Into<std::option::Option<crate::model::Group>>>(
4130            mut self,
4131            v: T,
4132        ) -> Self {
4133            self.0.request.group = v.into();
4134            self
4135        }
4136
4137        /// Sets the value of [request_id][crate::model::UpdateGroupRequest::request_id].
4138        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4139            self.0.request.request_id = v.into();
4140            self
4141        }
4142    }
4143
4144    #[doc(hidden)]
4145    impl gax::options::internal::RequestBuilder for UpdateGroup {
4146        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4147            &mut self.0.options
4148        }
4149    }
4150
4151    /// The request builder for [HubService::list_locations][super::super::client::HubService::list_locations] calls.
4152    #[derive(Clone, Debug)]
4153    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
4154
4155    impl ListLocations {
4156        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::HubService>) -> Self {
4157            Self(RequestBuilder::new(stub))
4158        }
4159
4160        /// Sets the full request, replacing any prior values.
4161        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
4162            mut self,
4163            v: V,
4164        ) -> Self {
4165            self.0.request = v.into();
4166            self
4167        }
4168
4169        /// Sets all the options, replacing any prior values.
4170        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4171            self.0.options = v.into();
4172            self
4173        }
4174
4175        /// Sends the request.
4176        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
4177            (*self.0.stub)
4178                .list_locations(self.0.request, self.0.options)
4179                .await
4180                .map(gax::response::Response::into_body)
4181        }
4182
4183        /// Streams the responses back.
4184        pub async fn paginator(
4185            self,
4186        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
4187        {
4188            use std::clone::Clone;
4189            let token = self.0.request.page_token.clone();
4190            let execute = move |token: String| {
4191                let mut builder = self.clone();
4192                builder.0.request = builder.0.request.set_page_token(token);
4193                builder.send()
4194            };
4195            gax::paginator::internal::new_paginator(token, execute)
4196        }
4197
4198        /// Sets the value of [name][location::model::ListLocationsRequest::name].
4199        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4200            self.0.request.name = v.into();
4201            self
4202        }
4203
4204        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
4205        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4206            self.0.request.filter = v.into();
4207            self
4208        }
4209
4210        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
4211        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4212            self.0.request.page_size = v.into();
4213            self
4214        }
4215
4216        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
4217        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4218            self.0.request.page_token = v.into();
4219            self
4220        }
4221    }
4222
4223    #[doc(hidden)]
4224    impl gax::options::internal::RequestBuilder for ListLocations {
4225        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4226            &mut self.0.options
4227        }
4228    }
4229
4230    /// The request builder for [HubService::get_location][super::super::client::HubService::get_location] calls.
4231    #[derive(Clone, Debug)]
4232    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
4233
4234    impl GetLocation {
4235        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::HubService>) -> Self {
4236            Self(RequestBuilder::new(stub))
4237        }
4238
4239        /// Sets the full request, replacing any prior values.
4240        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
4241            self.0.request = v.into();
4242            self
4243        }
4244
4245        /// Sets all the options, replacing any prior values.
4246        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4247            self.0.options = v.into();
4248            self
4249        }
4250
4251        /// Sends the request.
4252        pub async fn send(self) -> Result<location::model::Location> {
4253            (*self.0.stub)
4254                .get_location(self.0.request, self.0.options)
4255                .await
4256                .map(gax::response::Response::into_body)
4257        }
4258
4259        /// Sets the value of [name][location::model::GetLocationRequest::name].
4260        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4261            self.0.request.name = v.into();
4262            self
4263        }
4264    }
4265
4266    #[doc(hidden)]
4267    impl gax::options::internal::RequestBuilder for GetLocation {
4268        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4269            &mut self.0.options
4270        }
4271    }
4272
4273    /// The request builder for [HubService::set_iam_policy][super::super::client::HubService::set_iam_policy] calls.
4274    #[derive(Clone, Debug)]
4275    pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
4276
4277    impl SetIamPolicy {
4278        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::HubService>) -> Self {
4279            Self(RequestBuilder::new(stub))
4280        }
4281
4282        /// Sets the full request, replacing any prior values.
4283        pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
4284            self.0.request = v.into();
4285            self
4286        }
4287
4288        /// Sets all the options, replacing any prior values.
4289        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4290            self.0.options = v.into();
4291            self
4292        }
4293
4294        /// Sends the request.
4295        pub async fn send(self) -> Result<iam_v1::model::Policy> {
4296            (*self.0.stub)
4297                .set_iam_policy(self.0.request, self.0.options)
4298                .await
4299                .map(gax::response::Response::into_body)
4300        }
4301
4302        /// Sets the value of [resource][iam_v1::model::SetIamPolicyRequest::resource].
4303        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4304            self.0.request.resource = v.into();
4305            self
4306        }
4307
4308        /// Sets the value of [policy][iam_v1::model::SetIamPolicyRequest::policy].
4309        pub fn set_policy<T: Into<std::option::Option<iam_v1::model::Policy>>>(
4310            mut self,
4311            v: T,
4312        ) -> Self {
4313            self.0.request.policy = v.into();
4314            self
4315        }
4316
4317        /// Sets the value of [update_mask][iam_v1::model::SetIamPolicyRequest::update_mask].
4318        pub fn set_update_mask<T: Into<std::option::Option<wkt::FieldMask>>>(
4319            mut self,
4320            v: T,
4321        ) -> Self {
4322            self.0.request.update_mask = v.into();
4323            self
4324        }
4325    }
4326
4327    #[doc(hidden)]
4328    impl gax::options::internal::RequestBuilder for SetIamPolicy {
4329        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4330            &mut self.0.options
4331        }
4332    }
4333
4334    /// The request builder for [HubService::get_iam_policy][super::super::client::HubService::get_iam_policy] calls.
4335    #[derive(Clone, Debug)]
4336    pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
4337
4338    impl GetIamPolicy {
4339        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::HubService>) -> Self {
4340            Self(RequestBuilder::new(stub))
4341        }
4342
4343        /// Sets the full request, replacing any prior values.
4344        pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
4345            self.0.request = v.into();
4346            self
4347        }
4348
4349        /// Sets all the options, replacing any prior values.
4350        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4351            self.0.options = v.into();
4352            self
4353        }
4354
4355        /// Sends the request.
4356        pub async fn send(self) -> Result<iam_v1::model::Policy> {
4357            (*self.0.stub)
4358                .get_iam_policy(self.0.request, self.0.options)
4359                .await
4360                .map(gax::response::Response::into_body)
4361        }
4362
4363        /// Sets the value of [resource][iam_v1::model::GetIamPolicyRequest::resource].
4364        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4365            self.0.request.resource = v.into();
4366            self
4367        }
4368
4369        /// Sets the value of [options][iam_v1::model::GetIamPolicyRequest::options].
4370        pub fn set_options<T: Into<std::option::Option<iam_v1::model::GetPolicyOptions>>>(
4371            mut self,
4372            v: T,
4373        ) -> Self {
4374            self.0.request.options = v.into();
4375            self
4376        }
4377    }
4378
4379    #[doc(hidden)]
4380    impl gax::options::internal::RequestBuilder for GetIamPolicy {
4381        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4382            &mut self.0.options
4383        }
4384    }
4385
4386    /// The request builder for [HubService::test_iam_permissions][super::super::client::HubService::test_iam_permissions] calls.
4387    #[derive(Clone, Debug)]
4388    pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
4389
4390    impl TestIamPermissions {
4391        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::HubService>) -> Self {
4392            Self(RequestBuilder::new(stub))
4393        }
4394
4395        /// Sets the full request, replacing any prior values.
4396        pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
4397            mut self,
4398            v: V,
4399        ) -> Self {
4400            self.0.request = v.into();
4401            self
4402        }
4403
4404        /// Sets all the options, replacing any prior values.
4405        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4406            self.0.options = v.into();
4407            self
4408        }
4409
4410        /// Sends the request.
4411        pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
4412            (*self.0.stub)
4413                .test_iam_permissions(self.0.request, self.0.options)
4414                .await
4415                .map(gax::response::Response::into_body)
4416        }
4417
4418        /// Sets the value of [resource][iam_v1::model::TestIamPermissionsRequest::resource].
4419        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4420            self.0.request.resource = v.into();
4421            self
4422        }
4423
4424        /// Sets the value of [permissions][iam_v1::model::TestIamPermissionsRequest::permissions].
4425        pub fn set_permissions<T, V>(mut self, v: T) -> Self
4426        where
4427            T: std::iter::IntoIterator<Item = V>,
4428            V: std::convert::Into<std::string::String>,
4429        {
4430            use std::iter::Iterator;
4431            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
4432            self
4433        }
4434    }
4435
4436    #[doc(hidden)]
4437    impl gax::options::internal::RequestBuilder for TestIamPermissions {
4438        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4439            &mut self.0.options
4440        }
4441    }
4442
4443    /// The request builder for [HubService::list_operations][super::super::client::HubService::list_operations] calls.
4444    #[derive(Clone, Debug)]
4445    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
4446
4447    impl ListOperations {
4448        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::HubService>) -> Self {
4449            Self(RequestBuilder::new(stub))
4450        }
4451
4452        /// Sets the full request, replacing any prior values.
4453        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
4454            mut self,
4455            v: V,
4456        ) -> Self {
4457            self.0.request = v.into();
4458            self
4459        }
4460
4461        /// Sets all the options, replacing any prior values.
4462        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4463            self.0.options = v.into();
4464            self
4465        }
4466
4467        /// Sends the request.
4468        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
4469            (*self.0.stub)
4470                .list_operations(self.0.request, self.0.options)
4471                .await
4472                .map(gax::response::Response::into_body)
4473        }
4474
4475        /// Streams the responses back.
4476        pub async fn paginator(
4477            self,
4478        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
4479        {
4480            use std::clone::Clone;
4481            let token = self.0.request.page_token.clone();
4482            let execute = move |token: String| {
4483                let mut builder = self.clone();
4484                builder.0.request = builder.0.request.set_page_token(token);
4485                builder.send()
4486            };
4487            gax::paginator::internal::new_paginator(token, execute)
4488        }
4489
4490        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
4491        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4492            self.0.request.name = v.into();
4493            self
4494        }
4495
4496        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
4497        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4498            self.0.request.filter = v.into();
4499            self
4500        }
4501
4502        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
4503        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4504            self.0.request.page_size = v.into();
4505            self
4506        }
4507
4508        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
4509        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4510            self.0.request.page_token = v.into();
4511            self
4512        }
4513    }
4514
4515    #[doc(hidden)]
4516    impl gax::options::internal::RequestBuilder for ListOperations {
4517        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4518            &mut self.0.options
4519        }
4520    }
4521
4522    /// The request builder for [HubService::get_operation][super::super::client::HubService::get_operation] calls.
4523    #[derive(Clone, Debug)]
4524    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
4525
4526    impl GetOperation {
4527        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::HubService>) -> Self {
4528            Self(RequestBuilder::new(stub))
4529        }
4530
4531        /// Sets the full request, replacing any prior values.
4532        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
4533            mut self,
4534            v: V,
4535        ) -> Self {
4536            self.0.request = v.into();
4537            self
4538        }
4539
4540        /// Sets all the options, replacing any prior values.
4541        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4542            self.0.options = v.into();
4543            self
4544        }
4545
4546        /// Sends the request.
4547        pub async fn send(self) -> Result<longrunning::model::Operation> {
4548            (*self.0.stub)
4549                .get_operation(self.0.request, self.0.options)
4550                .await
4551                .map(gax::response::Response::into_body)
4552        }
4553
4554        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
4555        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4556            self.0.request.name = v.into();
4557            self
4558        }
4559    }
4560
4561    #[doc(hidden)]
4562    impl gax::options::internal::RequestBuilder for GetOperation {
4563        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4564            &mut self.0.options
4565        }
4566    }
4567
4568    /// The request builder for [HubService::delete_operation][super::super::client::HubService::delete_operation] calls.
4569    #[derive(Clone, Debug)]
4570    pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
4571
4572    impl DeleteOperation {
4573        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::HubService>) -> Self {
4574            Self(RequestBuilder::new(stub))
4575        }
4576
4577        /// Sets the full request, replacing any prior values.
4578        pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
4579            mut self,
4580            v: V,
4581        ) -> Self {
4582            self.0.request = v.into();
4583            self
4584        }
4585
4586        /// Sets all the options, replacing any prior values.
4587        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4588            self.0.options = v.into();
4589            self
4590        }
4591
4592        /// Sends the request.
4593        pub async fn send(self) -> Result<()> {
4594            (*self.0.stub)
4595                .delete_operation(self.0.request, self.0.options)
4596                .await
4597                .map(gax::response::Response::into_body)
4598        }
4599
4600        /// Sets the value of [name][longrunning::model::DeleteOperationRequest::name].
4601        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4602            self.0.request.name = v.into();
4603            self
4604        }
4605    }
4606
4607    #[doc(hidden)]
4608    impl gax::options::internal::RequestBuilder for DeleteOperation {
4609        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4610            &mut self.0.options
4611        }
4612    }
4613
4614    /// The request builder for [HubService::cancel_operation][super::super::client::HubService::cancel_operation] calls.
4615    #[derive(Clone, Debug)]
4616    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
4617
4618    impl CancelOperation {
4619        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::HubService>) -> Self {
4620            Self(RequestBuilder::new(stub))
4621        }
4622
4623        /// Sets the full request, replacing any prior values.
4624        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
4625            mut self,
4626            v: V,
4627        ) -> Self {
4628            self.0.request = v.into();
4629            self
4630        }
4631
4632        /// Sets all the options, replacing any prior values.
4633        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4634            self.0.options = v.into();
4635            self
4636        }
4637
4638        /// Sends the request.
4639        pub async fn send(self) -> Result<()> {
4640            (*self.0.stub)
4641                .cancel_operation(self.0.request, self.0.options)
4642                .await
4643                .map(gax::response::Response::into_body)
4644        }
4645
4646        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
4647        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4648            self.0.request.name = v.into();
4649            self
4650        }
4651    }
4652
4653    #[doc(hidden)]
4654    impl gax::options::internal::RequestBuilder for CancelOperation {
4655        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4656            &mut self.0.options
4657        }
4658    }
4659}
4660
4661pub mod policy_based_routing_service {
4662    use crate::Result;
4663    use std::sync::Arc;
4664
4665    /// A builder for [PolicyBasedRoutingService][super::super::client::PolicyBasedRoutingService].
4666    ///
4667    /// ```
4668    /// # tokio_test::block_on(async {
4669    /// # use google_cloud_networkconnectivity_v1::*;
4670    /// # use builder::policy_based_routing_service::ClientBuilder;
4671    /// # use client::PolicyBasedRoutingService;
4672    /// let builder : ClientBuilder = PolicyBasedRoutingService::builder();
4673    /// let client = builder
4674    ///     .with_endpoint("https://networkconnectivity.googleapis.com")
4675    ///     .build().await?;
4676    /// # gax::Result::<()>::Ok(()) });
4677    /// ```
4678    pub type ClientBuilder =
4679        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
4680
4681    pub(crate) mod client {
4682        use super::super::super::client::PolicyBasedRoutingService;
4683        pub struct Factory;
4684        impl gax::client_builder::internal::ClientFactory for Factory {
4685            type Client = PolicyBasedRoutingService;
4686            type Credentials = gaxi::options::Credentials;
4687            async fn build(self, config: gaxi::options::ClientConfig) -> gax::Result<Self::Client> {
4688                Self::Client::new(config).await
4689            }
4690        }
4691    }
4692
4693    /// Common implementation for [super::super::client::PolicyBasedRoutingService] request builders.
4694    #[derive(Clone, Debug)]
4695    pub(crate) struct RequestBuilder<R: std::default::Default> {
4696        stub: Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
4697        request: R,
4698        options: gax::options::RequestOptions,
4699    }
4700
4701    impl<R> RequestBuilder<R>
4702    where
4703        R: std::default::Default,
4704    {
4705        pub(crate) fn new(
4706            stub: Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
4707        ) -> Self {
4708            Self {
4709                stub,
4710                request: R::default(),
4711                options: gax::options::RequestOptions::default(),
4712            }
4713        }
4714    }
4715
4716    /// The request builder for [PolicyBasedRoutingService::list_policy_based_routes][super::super::client::PolicyBasedRoutingService::list_policy_based_routes] calls.
4717    #[derive(Clone, Debug)]
4718    pub struct ListPolicyBasedRoutes(RequestBuilder<crate::model::ListPolicyBasedRoutesRequest>);
4719
4720    impl ListPolicyBasedRoutes {
4721        pub(crate) fn new(
4722            stub: Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
4723        ) -> Self {
4724            Self(RequestBuilder::new(stub))
4725        }
4726
4727        /// Sets the full request, replacing any prior values.
4728        pub fn with_request<V: Into<crate::model::ListPolicyBasedRoutesRequest>>(
4729            mut self,
4730            v: V,
4731        ) -> Self {
4732            self.0.request = v.into();
4733            self
4734        }
4735
4736        /// Sets all the options, replacing any prior values.
4737        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4738            self.0.options = v.into();
4739            self
4740        }
4741
4742        /// Sends the request.
4743        pub async fn send(self) -> Result<crate::model::ListPolicyBasedRoutesResponse> {
4744            (*self.0.stub)
4745                .list_policy_based_routes(self.0.request, self.0.options)
4746                .await
4747                .map(gax::response::Response::into_body)
4748        }
4749
4750        /// Streams the responses back.
4751        pub async fn paginator(
4752            self,
4753        ) -> impl gax::paginator::Paginator<crate::model::ListPolicyBasedRoutesResponse, gax::error::Error>
4754        {
4755            use std::clone::Clone;
4756            let token = self.0.request.page_token.clone();
4757            let execute = move |token: String| {
4758                let mut builder = self.clone();
4759                builder.0.request = builder.0.request.set_page_token(token);
4760                builder.send()
4761            };
4762            gax::paginator::internal::new_paginator(token, execute)
4763        }
4764
4765        /// Sets the value of [parent][crate::model::ListPolicyBasedRoutesRequest::parent].
4766        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4767            self.0.request.parent = v.into();
4768            self
4769        }
4770
4771        /// Sets the value of [page_size][crate::model::ListPolicyBasedRoutesRequest::page_size].
4772        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4773            self.0.request.page_size = v.into();
4774            self
4775        }
4776
4777        /// Sets the value of [page_token][crate::model::ListPolicyBasedRoutesRequest::page_token].
4778        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4779            self.0.request.page_token = v.into();
4780            self
4781        }
4782
4783        /// Sets the value of [filter][crate::model::ListPolicyBasedRoutesRequest::filter].
4784        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4785            self.0.request.filter = v.into();
4786            self
4787        }
4788
4789        /// Sets the value of [order_by][crate::model::ListPolicyBasedRoutesRequest::order_by].
4790        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
4791            self.0.request.order_by = v.into();
4792            self
4793        }
4794    }
4795
4796    #[doc(hidden)]
4797    impl gax::options::internal::RequestBuilder for ListPolicyBasedRoutes {
4798        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4799            &mut self.0.options
4800        }
4801    }
4802
4803    /// The request builder for [PolicyBasedRoutingService::get_policy_based_route][super::super::client::PolicyBasedRoutingService::get_policy_based_route] calls.
4804    #[derive(Clone, Debug)]
4805    pub struct GetPolicyBasedRoute(RequestBuilder<crate::model::GetPolicyBasedRouteRequest>);
4806
4807    impl GetPolicyBasedRoute {
4808        pub(crate) fn new(
4809            stub: Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
4810        ) -> Self {
4811            Self(RequestBuilder::new(stub))
4812        }
4813
4814        /// Sets the full request, replacing any prior values.
4815        pub fn with_request<V: Into<crate::model::GetPolicyBasedRouteRequest>>(
4816            mut self,
4817            v: V,
4818        ) -> Self {
4819            self.0.request = v.into();
4820            self
4821        }
4822
4823        /// Sets all the options, replacing any prior values.
4824        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4825            self.0.options = v.into();
4826            self
4827        }
4828
4829        /// Sends the request.
4830        pub async fn send(self) -> Result<crate::model::PolicyBasedRoute> {
4831            (*self.0.stub)
4832                .get_policy_based_route(self.0.request, self.0.options)
4833                .await
4834                .map(gax::response::Response::into_body)
4835        }
4836
4837        /// Sets the value of [name][crate::model::GetPolicyBasedRouteRequest::name].
4838        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4839            self.0.request.name = v.into();
4840            self
4841        }
4842    }
4843
4844    #[doc(hidden)]
4845    impl gax::options::internal::RequestBuilder for GetPolicyBasedRoute {
4846        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4847            &mut self.0.options
4848        }
4849    }
4850
4851    /// The request builder for [PolicyBasedRoutingService::create_policy_based_route][super::super::client::PolicyBasedRoutingService::create_policy_based_route] calls.
4852    #[derive(Clone, Debug)]
4853    pub struct CreatePolicyBasedRoute(RequestBuilder<crate::model::CreatePolicyBasedRouteRequest>);
4854
4855    impl CreatePolicyBasedRoute {
4856        pub(crate) fn new(
4857            stub: Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
4858        ) -> Self {
4859            Self(RequestBuilder::new(stub))
4860        }
4861
4862        /// Sets the full request, replacing any prior values.
4863        pub fn with_request<V: Into<crate::model::CreatePolicyBasedRouteRequest>>(
4864            mut self,
4865            v: V,
4866        ) -> Self {
4867            self.0.request = v.into();
4868            self
4869        }
4870
4871        /// Sets all the options, replacing any prior values.
4872        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4873            self.0.options = v.into();
4874            self
4875        }
4876
4877        /// Sends the request.
4878        ///
4879        /// # Long running operations
4880        ///
4881        /// This starts, but does not poll, a longrunning operation. More information
4882        /// on [create_policy_based_route][super::super::client::PolicyBasedRoutingService::create_policy_based_route].
4883        pub async fn send(self) -> Result<longrunning::model::Operation> {
4884            (*self.0.stub)
4885                .create_policy_based_route(self.0.request, self.0.options)
4886                .await
4887                .map(gax::response::Response::into_body)
4888        }
4889
4890        /// Creates a [Poller][lro::Poller] to work with `create_policy_based_route`.
4891        pub fn poller(
4892            self,
4893        ) -> impl lro::Poller<crate::model::PolicyBasedRoute, crate::model::OperationMetadata>
4894        {
4895            type Operation =
4896                lro::Operation<crate::model::PolicyBasedRoute, crate::model::OperationMetadata>;
4897            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4898            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4899
4900            let stub = self.0.stub.clone();
4901            let mut options = self.0.options.clone();
4902            options.set_retry_policy(gax::retry_policy::NeverRetry);
4903            let query = move |name| {
4904                let stub = stub.clone();
4905                let options = options.clone();
4906                async {
4907                    let op = GetOperation::new(stub)
4908                        .set_name(name)
4909                        .with_options(options)
4910                        .send()
4911                        .await?;
4912                    Ok(Operation::new(op))
4913                }
4914            };
4915
4916            let start = move || async {
4917                let op = self.send().await?;
4918                Ok(Operation::new(op))
4919            };
4920
4921            lro::new_poller(polling_error_policy, polling_backoff_policy, start, query)
4922        }
4923
4924        /// Sets the value of [parent][crate::model::CreatePolicyBasedRouteRequest::parent].
4925        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4926            self.0.request.parent = v.into();
4927            self
4928        }
4929
4930        /// Sets the value of [policy_based_route_id][crate::model::CreatePolicyBasedRouteRequest::policy_based_route_id].
4931        pub fn set_policy_based_route_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4932            self.0.request.policy_based_route_id = v.into();
4933            self
4934        }
4935
4936        /// Sets the value of [policy_based_route][crate::model::CreatePolicyBasedRouteRequest::policy_based_route].
4937        pub fn set_policy_based_route<
4938            T: Into<std::option::Option<crate::model::PolicyBasedRoute>>,
4939        >(
4940            mut self,
4941            v: T,
4942        ) -> Self {
4943            self.0.request.policy_based_route = v.into();
4944            self
4945        }
4946
4947        /// Sets the value of [request_id][crate::model::CreatePolicyBasedRouteRequest::request_id].
4948        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4949            self.0.request.request_id = v.into();
4950            self
4951        }
4952    }
4953
4954    #[doc(hidden)]
4955    impl gax::options::internal::RequestBuilder for CreatePolicyBasedRoute {
4956        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4957            &mut self.0.options
4958        }
4959    }
4960
4961    /// The request builder for [PolicyBasedRoutingService::delete_policy_based_route][super::super::client::PolicyBasedRoutingService::delete_policy_based_route] calls.
4962    #[derive(Clone, Debug)]
4963    pub struct DeletePolicyBasedRoute(RequestBuilder<crate::model::DeletePolicyBasedRouteRequest>);
4964
4965    impl DeletePolicyBasedRoute {
4966        pub(crate) fn new(
4967            stub: Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
4968        ) -> Self {
4969            Self(RequestBuilder::new(stub))
4970        }
4971
4972        /// Sets the full request, replacing any prior values.
4973        pub fn with_request<V: Into<crate::model::DeletePolicyBasedRouteRequest>>(
4974            mut self,
4975            v: V,
4976        ) -> Self {
4977            self.0.request = v.into();
4978            self
4979        }
4980
4981        /// Sets all the options, replacing any prior values.
4982        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4983            self.0.options = v.into();
4984            self
4985        }
4986
4987        /// Sends the request.
4988        ///
4989        /// # Long running operations
4990        ///
4991        /// This starts, but does not poll, a longrunning operation. More information
4992        /// on [delete_policy_based_route][super::super::client::PolicyBasedRoutingService::delete_policy_based_route].
4993        pub async fn send(self) -> Result<longrunning::model::Operation> {
4994            (*self.0.stub)
4995                .delete_policy_based_route(self.0.request, self.0.options)
4996                .await
4997                .map(gax::response::Response::into_body)
4998        }
4999
5000        /// Creates a [Poller][lro::Poller] to work with `delete_policy_based_route`.
5001        pub fn poller(self) -> impl lro::Poller<wkt::Empty, crate::model::OperationMetadata> {
5002            type Operation = lro::Operation<wkt::Empty, crate::model::OperationMetadata>;
5003            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5004            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5005
5006            let stub = self.0.stub.clone();
5007            let mut options = self.0.options.clone();
5008            options.set_retry_policy(gax::retry_policy::NeverRetry);
5009            let query = move |name| {
5010                let stub = stub.clone();
5011                let options = options.clone();
5012                async {
5013                    let op = GetOperation::new(stub)
5014                        .set_name(name)
5015                        .with_options(options)
5016                        .send()
5017                        .await?;
5018                    Ok(Operation::new(op))
5019                }
5020            };
5021
5022            let start = move || async {
5023                let op = self.send().await?;
5024                Ok(Operation::new(op))
5025            };
5026
5027            lro::new_poller(polling_error_policy, polling_backoff_policy, start, query)
5028        }
5029
5030        /// Sets the value of [name][crate::model::DeletePolicyBasedRouteRequest::name].
5031        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5032            self.0.request.name = v.into();
5033            self
5034        }
5035
5036        /// Sets the value of [request_id][crate::model::DeletePolicyBasedRouteRequest::request_id].
5037        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5038            self.0.request.request_id = v.into();
5039            self
5040        }
5041    }
5042
5043    #[doc(hidden)]
5044    impl gax::options::internal::RequestBuilder for DeletePolicyBasedRoute {
5045        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5046            &mut self.0.options
5047        }
5048    }
5049
5050    /// The request builder for [PolicyBasedRoutingService::list_locations][super::super::client::PolicyBasedRoutingService::list_locations] calls.
5051    #[derive(Clone, Debug)]
5052    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
5053
5054    impl ListLocations {
5055        pub(crate) fn new(
5056            stub: Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
5057        ) -> Self {
5058            Self(RequestBuilder::new(stub))
5059        }
5060
5061        /// Sets the full request, replacing any prior values.
5062        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
5063            mut self,
5064            v: V,
5065        ) -> Self {
5066            self.0.request = v.into();
5067            self
5068        }
5069
5070        /// Sets all the options, replacing any prior values.
5071        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5072            self.0.options = v.into();
5073            self
5074        }
5075
5076        /// Sends the request.
5077        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
5078            (*self.0.stub)
5079                .list_locations(self.0.request, self.0.options)
5080                .await
5081                .map(gax::response::Response::into_body)
5082        }
5083
5084        /// Streams the responses back.
5085        pub async fn paginator(
5086            self,
5087        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
5088        {
5089            use std::clone::Clone;
5090            let token = self.0.request.page_token.clone();
5091            let execute = move |token: String| {
5092                let mut builder = self.clone();
5093                builder.0.request = builder.0.request.set_page_token(token);
5094                builder.send()
5095            };
5096            gax::paginator::internal::new_paginator(token, execute)
5097        }
5098
5099        /// Sets the value of [name][location::model::ListLocationsRequest::name].
5100        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5101            self.0.request.name = v.into();
5102            self
5103        }
5104
5105        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
5106        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5107            self.0.request.filter = v.into();
5108            self
5109        }
5110
5111        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
5112        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5113            self.0.request.page_size = v.into();
5114            self
5115        }
5116
5117        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
5118        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5119            self.0.request.page_token = v.into();
5120            self
5121        }
5122    }
5123
5124    #[doc(hidden)]
5125    impl gax::options::internal::RequestBuilder for ListLocations {
5126        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5127            &mut self.0.options
5128        }
5129    }
5130
5131    /// The request builder for [PolicyBasedRoutingService::get_location][super::super::client::PolicyBasedRoutingService::get_location] calls.
5132    #[derive(Clone, Debug)]
5133    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
5134
5135    impl GetLocation {
5136        pub(crate) fn new(
5137            stub: Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
5138        ) -> Self {
5139            Self(RequestBuilder::new(stub))
5140        }
5141
5142        /// Sets the full request, replacing any prior values.
5143        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
5144            self.0.request = v.into();
5145            self
5146        }
5147
5148        /// Sets all the options, replacing any prior values.
5149        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5150            self.0.options = v.into();
5151            self
5152        }
5153
5154        /// Sends the request.
5155        pub async fn send(self) -> Result<location::model::Location> {
5156            (*self.0.stub)
5157                .get_location(self.0.request, self.0.options)
5158                .await
5159                .map(gax::response::Response::into_body)
5160        }
5161
5162        /// Sets the value of [name][location::model::GetLocationRequest::name].
5163        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5164            self.0.request.name = v.into();
5165            self
5166        }
5167    }
5168
5169    #[doc(hidden)]
5170    impl gax::options::internal::RequestBuilder for GetLocation {
5171        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5172            &mut self.0.options
5173        }
5174    }
5175
5176    /// The request builder for [PolicyBasedRoutingService::set_iam_policy][super::super::client::PolicyBasedRoutingService::set_iam_policy] calls.
5177    #[derive(Clone, Debug)]
5178    pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
5179
5180    impl SetIamPolicy {
5181        pub(crate) fn new(
5182            stub: Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
5183        ) -> Self {
5184            Self(RequestBuilder::new(stub))
5185        }
5186
5187        /// Sets the full request, replacing any prior values.
5188        pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
5189            self.0.request = v.into();
5190            self
5191        }
5192
5193        /// Sets all the options, replacing any prior values.
5194        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5195            self.0.options = v.into();
5196            self
5197        }
5198
5199        /// Sends the request.
5200        pub async fn send(self) -> Result<iam_v1::model::Policy> {
5201            (*self.0.stub)
5202                .set_iam_policy(self.0.request, self.0.options)
5203                .await
5204                .map(gax::response::Response::into_body)
5205        }
5206
5207        /// Sets the value of [resource][iam_v1::model::SetIamPolicyRequest::resource].
5208        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5209            self.0.request.resource = v.into();
5210            self
5211        }
5212
5213        /// Sets the value of [policy][iam_v1::model::SetIamPolicyRequest::policy].
5214        pub fn set_policy<T: Into<std::option::Option<iam_v1::model::Policy>>>(
5215            mut self,
5216            v: T,
5217        ) -> Self {
5218            self.0.request.policy = v.into();
5219            self
5220        }
5221
5222        /// Sets the value of [update_mask][iam_v1::model::SetIamPolicyRequest::update_mask].
5223        pub fn set_update_mask<T: Into<std::option::Option<wkt::FieldMask>>>(
5224            mut self,
5225            v: T,
5226        ) -> Self {
5227            self.0.request.update_mask = v.into();
5228            self
5229        }
5230    }
5231
5232    #[doc(hidden)]
5233    impl gax::options::internal::RequestBuilder for SetIamPolicy {
5234        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5235            &mut self.0.options
5236        }
5237    }
5238
5239    /// The request builder for [PolicyBasedRoutingService::get_iam_policy][super::super::client::PolicyBasedRoutingService::get_iam_policy] calls.
5240    #[derive(Clone, Debug)]
5241    pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
5242
5243    impl GetIamPolicy {
5244        pub(crate) fn new(
5245            stub: Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
5246        ) -> Self {
5247            Self(RequestBuilder::new(stub))
5248        }
5249
5250        /// Sets the full request, replacing any prior values.
5251        pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
5252            self.0.request = v.into();
5253            self
5254        }
5255
5256        /// Sets all the options, replacing any prior values.
5257        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5258            self.0.options = v.into();
5259            self
5260        }
5261
5262        /// Sends the request.
5263        pub async fn send(self) -> Result<iam_v1::model::Policy> {
5264            (*self.0.stub)
5265                .get_iam_policy(self.0.request, self.0.options)
5266                .await
5267                .map(gax::response::Response::into_body)
5268        }
5269
5270        /// Sets the value of [resource][iam_v1::model::GetIamPolicyRequest::resource].
5271        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5272            self.0.request.resource = v.into();
5273            self
5274        }
5275
5276        /// Sets the value of [options][iam_v1::model::GetIamPolicyRequest::options].
5277        pub fn set_options<T: Into<std::option::Option<iam_v1::model::GetPolicyOptions>>>(
5278            mut self,
5279            v: T,
5280        ) -> Self {
5281            self.0.request.options = v.into();
5282            self
5283        }
5284    }
5285
5286    #[doc(hidden)]
5287    impl gax::options::internal::RequestBuilder for GetIamPolicy {
5288        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5289            &mut self.0.options
5290        }
5291    }
5292
5293    /// The request builder for [PolicyBasedRoutingService::test_iam_permissions][super::super::client::PolicyBasedRoutingService::test_iam_permissions] calls.
5294    #[derive(Clone, Debug)]
5295    pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
5296
5297    impl TestIamPermissions {
5298        pub(crate) fn new(
5299            stub: Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
5300        ) -> Self {
5301            Self(RequestBuilder::new(stub))
5302        }
5303
5304        /// Sets the full request, replacing any prior values.
5305        pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
5306            mut self,
5307            v: V,
5308        ) -> Self {
5309            self.0.request = v.into();
5310            self
5311        }
5312
5313        /// Sets all the options, replacing any prior values.
5314        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5315            self.0.options = v.into();
5316            self
5317        }
5318
5319        /// Sends the request.
5320        pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
5321            (*self.0.stub)
5322                .test_iam_permissions(self.0.request, self.0.options)
5323                .await
5324                .map(gax::response::Response::into_body)
5325        }
5326
5327        /// Sets the value of [resource][iam_v1::model::TestIamPermissionsRequest::resource].
5328        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
5329            self.0.request.resource = v.into();
5330            self
5331        }
5332
5333        /// Sets the value of [permissions][iam_v1::model::TestIamPermissionsRequest::permissions].
5334        pub fn set_permissions<T, V>(mut self, v: T) -> Self
5335        where
5336            T: std::iter::IntoIterator<Item = V>,
5337            V: std::convert::Into<std::string::String>,
5338        {
5339            use std::iter::Iterator;
5340            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
5341            self
5342        }
5343    }
5344
5345    #[doc(hidden)]
5346    impl gax::options::internal::RequestBuilder for TestIamPermissions {
5347        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5348            &mut self.0.options
5349        }
5350    }
5351
5352    /// The request builder for [PolicyBasedRoutingService::list_operations][super::super::client::PolicyBasedRoutingService::list_operations] calls.
5353    #[derive(Clone, Debug)]
5354    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
5355
5356    impl ListOperations {
5357        pub(crate) fn new(
5358            stub: Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
5359        ) -> Self {
5360            Self(RequestBuilder::new(stub))
5361        }
5362
5363        /// Sets the full request, replacing any prior values.
5364        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
5365            mut self,
5366            v: V,
5367        ) -> Self {
5368            self.0.request = v.into();
5369            self
5370        }
5371
5372        /// Sets all the options, replacing any prior values.
5373        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5374            self.0.options = v.into();
5375            self
5376        }
5377
5378        /// Sends the request.
5379        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
5380            (*self.0.stub)
5381                .list_operations(self.0.request, self.0.options)
5382                .await
5383                .map(gax::response::Response::into_body)
5384        }
5385
5386        /// Streams the responses back.
5387        pub async fn paginator(
5388            self,
5389        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
5390        {
5391            use std::clone::Clone;
5392            let token = self.0.request.page_token.clone();
5393            let execute = move |token: String| {
5394                let mut builder = self.clone();
5395                builder.0.request = builder.0.request.set_page_token(token);
5396                builder.send()
5397            };
5398            gax::paginator::internal::new_paginator(token, execute)
5399        }
5400
5401        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
5402        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5403            self.0.request.name = v.into();
5404            self
5405        }
5406
5407        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
5408        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5409            self.0.request.filter = v.into();
5410            self
5411        }
5412
5413        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
5414        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5415            self.0.request.page_size = v.into();
5416            self
5417        }
5418
5419        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
5420        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5421            self.0.request.page_token = v.into();
5422            self
5423        }
5424    }
5425
5426    #[doc(hidden)]
5427    impl gax::options::internal::RequestBuilder for ListOperations {
5428        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5429            &mut self.0.options
5430        }
5431    }
5432
5433    /// The request builder for [PolicyBasedRoutingService::get_operation][super::super::client::PolicyBasedRoutingService::get_operation] calls.
5434    #[derive(Clone, Debug)]
5435    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
5436
5437    impl GetOperation {
5438        pub(crate) fn new(
5439            stub: Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
5440        ) -> Self {
5441            Self(RequestBuilder::new(stub))
5442        }
5443
5444        /// Sets the full request, replacing any prior values.
5445        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
5446            mut self,
5447            v: V,
5448        ) -> Self {
5449            self.0.request = v.into();
5450            self
5451        }
5452
5453        /// Sets all the options, replacing any prior values.
5454        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5455            self.0.options = v.into();
5456            self
5457        }
5458
5459        /// Sends the request.
5460        pub async fn send(self) -> Result<longrunning::model::Operation> {
5461            (*self.0.stub)
5462                .get_operation(self.0.request, self.0.options)
5463                .await
5464                .map(gax::response::Response::into_body)
5465        }
5466
5467        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
5468        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5469            self.0.request.name = v.into();
5470            self
5471        }
5472    }
5473
5474    #[doc(hidden)]
5475    impl gax::options::internal::RequestBuilder for GetOperation {
5476        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5477            &mut self.0.options
5478        }
5479    }
5480
5481    /// The request builder for [PolicyBasedRoutingService::delete_operation][super::super::client::PolicyBasedRoutingService::delete_operation] calls.
5482    #[derive(Clone, Debug)]
5483    pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
5484
5485    impl DeleteOperation {
5486        pub(crate) fn new(
5487            stub: Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
5488        ) -> Self {
5489            Self(RequestBuilder::new(stub))
5490        }
5491
5492        /// Sets the full request, replacing any prior values.
5493        pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
5494            mut self,
5495            v: V,
5496        ) -> Self {
5497            self.0.request = v.into();
5498            self
5499        }
5500
5501        /// Sets all the options, replacing any prior values.
5502        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5503            self.0.options = v.into();
5504            self
5505        }
5506
5507        /// Sends the request.
5508        pub async fn send(self) -> Result<()> {
5509            (*self.0.stub)
5510                .delete_operation(self.0.request, self.0.options)
5511                .await
5512                .map(gax::response::Response::into_body)
5513        }
5514
5515        /// Sets the value of [name][longrunning::model::DeleteOperationRequest::name].
5516        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5517            self.0.request.name = v.into();
5518            self
5519        }
5520    }
5521
5522    #[doc(hidden)]
5523    impl gax::options::internal::RequestBuilder for DeleteOperation {
5524        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5525            &mut self.0.options
5526        }
5527    }
5528
5529    /// The request builder for [PolicyBasedRoutingService::cancel_operation][super::super::client::PolicyBasedRoutingService::cancel_operation] calls.
5530    #[derive(Clone, Debug)]
5531    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
5532
5533    impl CancelOperation {
5534        pub(crate) fn new(
5535            stub: Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
5536        ) -> Self {
5537            Self(RequestBuilder::new(stub))
5538        }
5539
5540        /// Sets the full request, replacing any prior values.
5541        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
5542            mut self,
5543            v: V,
5544        ) -> Self {
5545            self.0.request = v.into();
5546            self
5547        }
5548
5549        /// Sets all the options, replacing any prior values.
5550        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5551            self.0.options = v.into();
5552            self
5553        }
5554
5555        /// Sends the request.
5556        pub async fn send(self) -> Result<()> {
5557            (*self.0.stub)
5558                .cancel_operation(self.0.request, self.0.options)
5559                .await
5560                .map(gax::response::Response::into_body)
5561        }
5562
5563        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
5564        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5565            self.0.request.name = v.into();
5566            self
5567        }
5568    }
5569
5570    #[doc(hidden)]
5571    impl gax::options::internal::RequestBuilder for CancelOperation {
5572        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5573            &mut self.0.options
5574        }
5575    }
5576}