google_cloud_networkconnectivity_v1/
builders.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 hub_service {
18    use crate::Result;
19    use std::sync::Arc;
20
21    /// Common implementation for [crate::client::HubService] request builders.
22    #[derive(Clone, Debug)]
23    pub struct RequestBuilder<R: std::default::Default> {
24        stub: Arc<dyn crate::stubs::dynamic::HubService>,
25        request: R,
26        options: gax::options::RequestOptions,
27    }
28
29    impl<R> RequestBuilder<R>
30    where
31        R: std::default::Default,
32    {
33        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::HubService>) -> Self {
34            Self {
35                stub,
36                request: R::default(),
37                options: gax::options::RequestOptions::default(),
38            }
39        }
40    }
41
42    /// The request builder for a HubService::list_hubs call.
43    #[derive(Clone, Debug)]
44    pub struct ListHubs(RequestBuilder<crate::model::ListHubsRequest>);
45
46    impl ListHubs {
47        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::HubService>) -> Self {
48            Self(RequestBuilder::new(stub))
49        }
50
51        /// Sets the full request, replacing any prior values.
52        pub fn with_request<V: Into<crate::model::ListHubsRequest>>(mut self, v: V) -> Self {
53            self.0.request = v.into();
54            self
55        }
56
57        /// Sets all the options, replacing any prior values.
58        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
59            self.0.options = v.into();
60            self
61        }
62
63        /// Sends the request.
64        pub async fn send(self) -> Result<crate::model::ListHubsResponse> {
65            (*self.0.stub)
66                .list_hubs(self.0.request, self.0.options)
67                .await
68        }
69
70        /// Streams the responses back.
71        #[cfg(feature = "unstable-stream")]
72        pub async fn stream(
73            self,
74        ) -> gax::paginator::Paginator<crate::model::ListHubsResponse, gax::error::Error> {
75            let token = gax::paginator::extract_token(&self.0.request.page_token);
76            let execute = move |token: String| {
77                let mut builder = self.clone();
78                builder.0.request = builder.0.request.set_page_token(token);
79                builder.send()
80            };
81            gax::paginator::Paginator::new(token, execute)
82        }
83
84        /// Sets the value of [parent][crate::model::ListHubsRequest::parent].
85        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
86            self.0.request.parent = v.into();
87            self
88        }
89
90        /// Sets the value of [page_size][crate::model::ListHubsRequest::page_size].
91        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
92            self.0.request.page_size = v.into();
93            self
94        }
95
96        /// Sets the value of [page_token][crate::model::ListHubsRequest::page_token].
97        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
98            self.0.request.page_token = v.into();
99            self
100        }
101
102        /// Sets the value of [filter][crate::model::ListHubsRequest::filter].
103        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
104            self.0.request.filter = v.into();
105            self
106        }
107
108        /// Sets the value of [order_by][crate::model::ListHubsRequest::order_by].
109        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
110            self.0.request.order_by = v.into();
111            self
112        }
113    }
114
115    impl gax::options::RequestBuilder for ListHubs {
116        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
117            &mut self.0.options
118        }
119    }
120
121    /// The request builder for a HubService::get_hub call.
122    #[derive(Clone, Debug)]
123    pub struct GetHub(RequestBuilder<crate::model::GetHubRequest>);
124
125    impl GetHub {
126        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::HubService>) -> Self {
127            Self(RequestBuilder::new(stub))
128        }
129
130        /// Sets the full request, replacing any prior values.
131        pub fn with_request<V: Into<crate::model::GetHubRequest>>(mut self, v: V) -> Self {
132            self.0.request = v.into();
133            self
134        }
135
136        /// Sets all the options, replacing any prior values.
137        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
138            self.0.options = v.into();
139            self
140        }
141
142        /// Sends the request.
143        pub async fn send(self) -> Result<crate::model::Hub> {
144            (*self.0.stub).get_hub(self.0.request, self.0.options).await
145        }
146
147        /// Sets the value of [name][crate::model::GetHubRequest::name].
148        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
149            self.0.request.name = v.into();
150            self
151        }
152    }
153
154    impl gax::options::RequestBuilder for GetHub {
155        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
156            &mut self.0.options
157        }
158    }
159
160    /// The request builder for a HubService::create_hub call.
161    #[derive(Clone, Debug)]
162    pub struct CreateHub(RequestBuilder<crate::model::CreateHubRequest>);
163
164    impl CreateHub {
165        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::HubService>) -> Self {
166            Self(RequestBuilder::new(stub))
167        }
168
169        /// Sets the full request, replacing any prior values.
170        pub fn with_request<V: Into<crate::model::CreateHubRequest>>(mut self, v: V) -> Self {
171            self.0.request = v.into();
172            self
173        }
174
175        /// Sets all the options, replacing any prior values.
176        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
177            self.0.options = v.into();
178            self
179        }
180
181        /// Sends the request.
182        ///
183        /// # Long running operations
184        ///
185        /// This starts, but does not poll, a longrunning operation. More information
186        /// on [create_hub][crate::client::HubService::create_hub].
187        pub async fn send(self) -> Result<longrunning::model::Operation> {
188            (*self.0.stub)
189                .create_hub(self.0.request, self.0.options)
190                .await
191        }
192
193        /// Creates a [Poller][lro::Poller] to work with `create_hub`.
194        pub fn poller(
195            self,
196        ) -> impl lro::Poller<crate::model::Hub, crate::model::OperationMetadata> {
197            type Operation = lro::Operation<crate::model::Hub, crate::model::OperationMetadata>;
198            let polling_policy = self.0.stub.get_polling_policy(&self.0.options);
199            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
200
201            let stub = self.0.stub.clone();
202            let mut options = self.0.options.clone();
203            options.set_retry_policy(gax::retry_policy::NeverRetry);
204            let query = move |name| {
205                let stub = stub.clone();
206                let options = options.clone();
207                async {
208                    let op = GetOperation::new(stub)
209                        .set_name(name)
210                        .with_options(options)
211                        .send()
212                        .await?;
213                    Ok(Operation::new(op))
214                }
215            };
216
217            let start = move || async {
218                let op = self.send().await?;
219                Ok(Operation::new(op))
220            };
221
222            lro::new_poller(polling_policy, polling_backoff_policy, start, query)
223        }
224
225        /// Sets the value of [parent][crate::model::CreateHubRequest::parent].
226        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
227            self.0.request.parent = v.into();
228            self
229        }
230
231        /// Sets the value of [hub_id][crate::model::CreateHubRequest::hub_id].
232        pub fn set_hub_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
233            self.0.request.hub_id = v.into();
234            self
235        }
236
237        /// Sets the value of [hub][crate::model::CreateHubRequest::hub].
238        pub fn set_hub<T: Into<std::option::Option<crate::model::Hub>>>(mut self, v: T) -> Self {
239            self.0.request.hub = v.into();
240            self
241        }
242
243        /// Sets the value of [request_id][crate::model::CreateHubRequest::request_id].
244        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
245            self.0.request.request_id = v.into();
246            self
247        }
248    }
249
250    impl gax::options::RequestBuilder for CreateHub {
251        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
252            &mut self.0.options
253        }
254    }
255
256    /// The request builder for a HubService::update_hub call.
257    #[derive(Clone, Debug)]
258    pub struct UpdateHub(RequestBuilder<crate::model::UpdateHubRequest>);
259
260    impl UpdateHub {
261        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::HubService>) -> Self {
262            Self(RequestBuilder::new(stub))
263        }
264
265        /// Sets the full request, replacing any prior values.
266        pub fn with_request<V: Into<crate::model::UpdateHubRequest>>(mut self, v: V) -> Self {
267            self.0.request = v.into();
268            self
269        }
270
271        /// Sets all the options, replacing any prior values.
272        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
273            self.0.options = v.into();
274            self
275        }
276
277        /// Sends the request.
278        ///
279        /// # Long running operations
280        ///
281        /// This starts, but does not poll, a longrunning operation. More information
282        /// on [update_hub][crate::client::HubService::update_hub].
283        pub async fn send(self) -> Result<longrunning::model::Operation> {
284            (*self.0.stub)
285                .update_hub(self.0.request, self.0.options)
286                .await
287        }
288
289        /// Creates a [Poller][lro::Poller] to work with `update_hub`.
290        pub fn poller(
291            self,
292        ) -> impl lro::Poller<crate::model::Hub, crate::model::OperationMetadata> {
293            type Operation = lro::Operation<crate::model::Hub, crate::model::OperationMetadata>;
294            let polling_policy = self.0.stub.get_polling_policy(&self.0.options);
295            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
296
297            let stub = self.0.stub.clone();
298            let mut options = self.0.options.clone();
299            options.set_retry_policy(gax::retry_policy::NeverRetry);
300            let query = move |name| {
301                let stub = stub.clone();
302                let options = options.clone();
303                async {
304                    let op = GetOperation::new(stub)
305                        .set_name(name)
306                        .with_options(options)
307                        .send()
308                        .await?;
309                    Ok(Operation::new(op))
310                }
311            };
312
313            let start = move || async {
314                let op = self.send().await?;
315                Ok(Operation::new(op))
316            };
317
318            lro::new_poller(polling_policy, polling_backoff_policy, start, query)
319        }
320
321        /// Sets the value of [update_mask][crate::model::UpdateHubRequest::update_mask].
322        pub fn set_update_mask<T: Into<std::option::Option<wkt::FieldMask>>>(
323            mut self,
324            v: T,
325        ) -> Self {
326            self.0.request.update_mask = v.into();
327            self
328        }
329
330        /// Sets the value of [hub][crate::model::UpdateHubRequest::hub].
331        pub fn set_hub<T: Into<std::option::Option<crate::model::Hub>>>(mut self, v: T) -> Self {
332            self.0.request.hub = v.into();
333            self
334        }
335
336        /// Sets the value of [request_id][crate::model::UpdateHubRequest::request_id].
337        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
338            self.0.request.request_id = v.into();
339            self
340        }
341    }
342
343    impl gax::options::RequestBuilder for UpdateHub {
344        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
345            &mut self.0.options
346        }
347    }
348
349    /// The request builder for a HubService::delete_hub call.
350    #[derive(Clone, Debug)]
351    pub struct DeleteHub(RequestBuilder<crate::model::DeleteHubRequest>);
352
353    impl DeleteHub {
354        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::HubService>) -> Self {
355            Self(RequestBuilder::new(stub))
356        }
357
358        /// Sets the full request, replacing any prior values.
359        pub fn with_request<V: Into<crate::model::DeleteHubRequest>>(mut self, v: V) -> Self {
360            self.0.request = v.into();
361            self
362        }
363
364        /// Sets all the options, replacing any prior values.
365        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
366            self.0.options = v.into();
367            self
368        }
369
370        /// Sends the request.
371        ///
372        /// # Long running operations
373        ///
374        /// This starts, but does not poll, a longrunning operation. More information
375        /// on [delete_hub][crate::client::HubService::delete_hub].
376        pub async fn send(self) -> Result<longrunning::model::Operation> {
377            (*self.0.stub)
378                .delete_hub(self.0.request, self.0.options)
379                .await
380        }
381
382        /// Creates a [Poller][lro::Poller] to work with `delete_hub`.
383        pub fn poller(self) -> impl lro::Poller<wkt::Empty, crate::model::OperationMetadata> {
384            type Operation = lro::Operation<wkt::Empty, crate::model::OperationMetadata>;
385            let polling_policy = self.0.stub.get_polling_policy(&self.0.options);
386            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
387
388            let stub = self.0.stub.clone();
389            let mut options = self.0.options.clone();
390            options.set_retry_policy(gax::retry_policy::NeverRetry);
391            let query = move |name| {
392                let stub = stub.clone();
393                let options = options.clone();
394                async {
395                    let op = GetOperation::new(stub)
396                        .set_name(name)
397                        .with_options(options)
398                        .send()
399                        .await?;
400                    Ok(Operation::new(op))
401                }
402            };
403
404            let start = move || async {
405                let op = self.send().await?;
406                Ok(Operation::new(op))
407            };
408
409            lro::new_poller(polling_policy, polling_backoff_policy, start, query)
410        }
411
412        /// Sets the value of [name][crate::model::DeleteHubRequest::name].
413        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
414            self.0.request.name = v.into();
415            self
416        }
417
418        /// Sets the value of [request_id][crate::model::DeleteHubRequest::request_id].
419        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
420            self.0.request.request_id = v.into();
421            self
422        }
423    }
424
425    impl gax::options::RequestBuilder for DeleteHub {
426        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
427            &mut self.0.options
428        }
429    }
430
431    /// The request builder for a HubService::list_hub_spokes call.
432    #[derive(Clone, Debug)]
433    pub struct ListHubSpokes(RequestBuilder<crate::model::ListHubSpokesRequest>);
434
435    impl ListHubSpokes {
436        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::HubService>) -> Self {
437            Self(RequestBuilder::new(stub))
438        }
439
440        /// Sets the full request, replacing any prior values.
441        pub fn with_request<V: Into<crate::model::ListHubSpokesRequest>>(mut self, v: V) -> Self {
442            self.0.request = v.into();
443            self
444        }
445
446        /// Sets all the options, replacing any prior values.
447        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
448            self.0.options = v.into();
449            self
450        }
451
452        /// Sends the request.
453        pub async fn send(self) -> Result<crate::model::ListHubSpokesResponse> {
454            (*self.0.stub)
455                .list_hub_spokes(self.0.request, self.0.options)
456                .await
457        }
458
459        /// Streams the responses back.
460        #[cfg(feature = "unstable-stream")]
461        pub async fn stream(
462            self,
463        ) -> gax::paginator::Paginator<crate::model::ListHubSpokesResponse, gax::error::Error>
464        {
465            let token = gax::paginator::extract_token(&self.0.request.page_token);
466            let execute = move |token: String| {
467                let mut builder = self.clone();
468                builder.0.request = builder.0.request.set_page_token(token);
469                builder.send()
470            };
471            gax::paginator::Paginator::new(token, execute)
472        }
473
474        /// Sets the value of [name][crate::model::ListHubSpokesRequest::name].
475        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
476            self.0.request.name = v.into();
477            self
478        }
479
480        /// Sets the value of [page_size][crate::model::ListHubSpokesRequest::page_size].
481        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
482            self.0.request.page_size = v.into();
483            self
484        }
485
486        /// Sets the value of [page_token][crate::model::ListHubSpokesRequest::page_token].
487        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
488            self.0.request.page_token = v.into();
489            self
490        }
491
492        /// Sets the value of [filter][crate::model::ListHubSpokesRequest::filter].
493        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
494            self.0.request.filter = v.into();
495            self
496        }
497
498        /// Sets the value of [order_by][crate::model::ListHubSpokesRequest::order_by].
499        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
500            self.0.request.order_by = v.into();
501            self
502        }
503
504        /// Sets the value of [view][crate::model::ListHubSpokesRequest::view].
505        pub fn set_view<T: Into<crate::model::list_hub_spokes_request::SpokeView>>(
506            mut self,
507            v: T,
508        ) -> Self {
509            self.0.request.view = v.into();
510            self
511        }
512
513        /// Sets the value of [spoke_locations][crate::model::ListHubSpokesRequest::spoke_locations].
514        pub fn set_spoke_locations<T, V>(mut self, v: T) -> Self
515        where
516            T: std::iter::IntoIterator<Item = V>,
517            V: std::convert::Into<std::string::String>,
518        {
519            use std::iter::Iterator;
520            self.0.request.spoke_locations = v.into_iter().map(|i| i.into()).collect();
521            self
522        }
523    }
524
525    impl gax::options::RequestBuilder for ListHubSpokes {
526        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
527            &mut self.0.options
528        }
529    }
530
531    /// The request builder for a HubService::query_hub_status call.
532    #[derive(Clone, Debug)]
533    pub struct QueryHubStatus(RequestBuilder<crate::model::QueryHubStatusRequest>);
534
535    impl QueryHubStatus {
536        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::HubService>) -> Self {
537            Self(RequestBuilder::new(stub))
538        }
539
540        /// Sets the full request, replacing any prior values.
541        pub fn with_request<V: Into<crate::model::QueryHubStatusRequest>>(mut self, v: V) -> Self {
542            self.0.request = v.into();
543            self
544        }
545
546        /// Sets all the options, replacing any prior values.
547        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
548            self.0.options = v.into();
549            self
550        }
551
552        /// Sends the request.
553        pub async fn send(self) -> Result<crate::model::QueryHubStatusResponse> {
554            (*self.0.stub)
555                .query_hub_status(self.0.request, self.0.options)
556                .await
557        }
558
559        /// Streams the responses back.
560        #[cfg(feature = "unstable-stream")]
561        pub async fn stream(
562            self,
563        ) -> gax::paginator::Paginator<crate::model::QueryHubStatusResponse, gax::error::Error>
564        {
565            let token = gax::paginator::extract_token(&self.0.request.page_token);
566            let execute = move |token: String| {
567                let mut builder = self.clone();
568                builder.0.request = builder.0.request.set_page_token(token);
569                builder.send()
570            };
571            gax::paginator::Paginator::new(token, execute)
572        }
573
574        /// Sets the value of [name][crate::model::QueryHubStatusRequest::name].
575        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
576            self.0.request.name = v.into();
577            self
578        }
579
580        /// Sets the value of [page_size][crate::model::QueryHubStatusRequest::page_size].
581        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
582            self.0.request.page_size = v.into();
583            self
584        }
585
586        /// Sets the value of [page_token][crate::model::QueryHubStatusRequest::page_token].
587        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
588            self.0.request.page_token = v.into();
589            self
590        }
591
592        /// Sets the value of [filter][crate::model::QueryHubStatusRequest::filter].
593        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
594            self.0.request.filter = v.into();
595            self
596        }
597
598        /// Sets the value of [order_by][crate::model::QueryHubStatusRequest::order_by].
599        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
600            self.0.request.order_by = v.into();
601            self
602        }
603
604        /// Sets the value of [group_by][crate::model::QueryHubStatusRequest::group_by].
605        pub fn set_group_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
606            self.0.request.group_by = v.into();
607            self
608        }
609    }
610
611    impl gax::options::RequestBuilder for QueryHubStatus {
612        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
613            &mut self.0.options
614        }
615    }
616
617    /// The request builder for a HubService::list_spokes call.
618    #[derive(Clone, Debug)]
619    pub struct ListSpokes(RequestBuilder<crate::model::ListSpokesRequest>);
620
621    impl ListSpokes {
622        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::HubService>) -> Self {
623            Self(RequestBuilder::new(stub))
624        }
625
626        /// Sets the full request, replacing any prior values.
627        pub fn with_request<V: Into<crate::model::ListSpokesRequest>>(mut self, v: V) -> Self {
628            self.0.request = v.into();
629            self
630        }
631
632        /// Sets all the options, replacing any prior values.
633        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
634            self.0.options = v.into();
635            self
636        }
637
638        /// Sends the request.
639        pub async fn send(self) -> Result<crate::model::ListSpokesResponse> {
640            (*self.0.stub)
641                .list_spokes(self.0.request, self.0.options)
642                .await
643        }
644
645        /// Streams the responses back.
646        #[cfg(feature = "unstable-stream")]
647        pub async fn stream(
648            self,
649        ) -> gax::paginator::Paginator<crate::model::ListSpokesResponse, gax::error::Error>
650        {
651            let token = gax::paginator::extract_token(&self.0.request.page_token);
652            let execute = move |token: String| {
653                let mut builder = self.clone();
654                builder.0.request = builder.0.request.set_page_token(token);
655                builder.send()
656            };
657            gax::paginator::Paginator::new(token, execute)
658        }
659
660        /// Sets the value of [parent][crate::model::ListSpokesRequest::parent].
661        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
662            self.0.request.parent = v.into();
663            self
664        }
665
666        /// Sets the value of [page_size][crate::model::ListSpokesRequest::page_size].
667        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
668            self.0.request.page_size = v.into();
669            self
670        }
671
672        /// Sets the value of [page_token][crate::model::ListSpokesRequest::page_token].
673        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
674            self.0.request.page_token = v.into();
675            self
676        }
677
678        /// Sets the value of [filter][crate::model::ListSpokesRequest::filter].
679        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
680            self.0.request.filter = v.into();
681            self
682        }
683
684        /// Sets the value of [order_by][crate::model::ListSpokesRequest::order_by].
685        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
686            self.0.request.order_by = v.into();
687            self
688        }
689    }
690
691    impl gax::options::RequestBuilder for ListSpokes {
692        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
693            &mut self.0.options
694        }
695    }
696
697    /// The request builder for a HubService::get_spoke call.
698    #[derive(Clone, Debug)]
699    pub struct GetSpoke(RequestBuilder<crate::model::GetSpokeRequest>);
700
701    impl GetSpoke {
702        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::HubService>) -> Self {
703            Self(RequestBuilder::new(stub))
704        }
705
706        /// Sets the full request, replacing any prior values.
707        pub fn with_request<V: Into<crate::model::GetSpokeRequest>>(mut self, v: V) -> Self {
708            self.0.request = v.into();
709            self
710        }
711
712        /// Sets all the options, replacing any prior values.
713        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
714            self.0.options = v.into();
715            self
716        }
717
718        /// Sends the request.
719        pub async fn send(self) -> Result<crate::model::Spoke> {
720            (*self.0.stub)
721                .get_spoke(self.0.request, self.0.options)
722                .await
723        }
724
725        /// Sets the value of [name][crate::model::GetSpokeRequest::name].
726        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
727            self.0.request.name = v.into();
728            self
729        }
730    }
731
732    impl gax::options::RequestBuilder for GetSpoke {
733        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
734            &mut self.0.options
735        }
736    }
737
738    /// The request builder for a HubService::create_spoke call.
739    #[derive(Clone, Debug)]
740    pub struct CreateSpoke(RequestBuilder<crate::model::CreateSpokeRequest>);
741
742    impl CreateSpoke {
743        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::HubService>) -> Self {
744            Self(RequestBuilder::new(stub))
745        }
746
747        /// Sets the full request, replacing any prior values.
748        pub fn with_request<V: Into<crate::model::CreateSpokeRequest>>(mut self, v: V) -> Self {
749            self.0.request = v.into();
750            self
751        }
752
753        /// Sets all the options, replacing any prior values.
754        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
755            self.0.options = v.into();
756            self
757        }
758
759        /// Sends the request.
760        ///
761        /// # Long running operations
762        ///
763        /// This starts, but does not poll, a longrunning operation. More information
764        /// on [create_spoke][crate::client::HubService::create_spoke].
765        pub async fn send(self) -> Result<longrunning::model::Operation> {
766            (*self.0.stub)
767                .create_spoke(self.0.request, self.0.options)
768                .await
769        }
770
771        /// Creates a [Poller][lro::Poller] to work with `create_spoke`.
772        pub fn poller(
773            self,
774        ) -> impl lro::Poller<crate::model::Spoke, crate::model::OperationMetadata> {
775            type Operation = lro::Operation<crate::model::Spoke, crate::model::OperationMetadata>;
776            let polling_policy = self.0.stub.get_polling_policy(&self.0.options);
777            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
778
779            let stub = self.0.stub.clone();
780            let mut options = self.0.options.clone();
781            options.set_retry_policy(gax::retry_policy::NeverRetry);
782            let query = move |name| {
783                let stub = stub.clone();
784                let options = options.clone();
785                async {
786                    let op = GetOperation::new(stub)
787                        .set_name(name)
788                        .with_options(options)
789                        .send()
790                        .await?;
791                    Ok(Operation::new(op))
792                }
793            };
794
795            let start = move || async {
796                let op = self.send().await?;
797                Ok(Operation::new(op))
798            };
799
800            lro::new_poller(polling_policy, polling_backoff_policy, start, query)
801        }
802
803        /// Sets the value of [parent][crate::model::CreateSpokeRequest::parent].
804        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
805            self.0.request.parent = v.into();
806            self
807        }
808
809        /// Sets the value of [spoke_id][crate::model::CreateSpokeRequest::spoke_id].
810        pub fn set_spoke_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
811            self.0.request.spoke_id = v.into();
812            self
813        }
814
815        /// Sets the value of [spoke][crate::model::CreateSpokeRequest::spoke].
816        pub fn set_spoke<T: Into<std::option::Option<crate::model::Spoke>>>(
817            mut self,
818            v: T,
819        ) -> Self {
820            self.0.request.spoke = v.into();
821            self
822        }
823
824        /// Sets the value of [request_id][crate::model::CreateSpokeRequest::request_id].
825        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
826            self.0.request.request_id = v.into();
827            self
828        }
829    }
830
831    impl gax::options::RequestBuilder for CreateSpoke {
832        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
833            &mut self.0.options
834        }
835    }
836
837    /// The request builder for a HubService::update_spoke call.
838    #[derive(Clone, Debug)]
839    pub struct UpdateSpoke(RequestBuilder<crate::model::UpdateSpokeRequest>);
840
841    impl UpdateSpoke {
842        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::HubService>) -> Self {
843            Self(RequestBuilder::new(stub))
844        }
845
846        /// Sets the full request, replacing any prior values.
847        pub fn with_request<V: Into<crate::model::UpdateSpokeRequest>>(mut self, v: V) -> Self {
848            self.0.request = v.into();
849            self
850        }
851
852        /// Sets all the options, replacing any prior values.
853        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
854            self.0.options = v.into();
855            self
856        }
857
858        /// Sends the request.
859        ///
860        /// # Long running operations
861        ///
862        /// This starts, but does not poll, a longrunning operation. More information
863        /// on [update_spoke][crate::client::HubService::update_spoke].
864        pub async fn send(self) -> Result<longrunning::model::Operation> {
865            (*self.0.stub)
866                .update_spoke(self.0.request, self.0.options)
867                .await
868        }
869
870        /// Creates a [Poller][lro::Poller] to work with `update_spoke`.
871        pub fn poller(
872            self,
873        ) -> impl lro::Poller<crate::model::Spoke, crate::model::OperationMetadata> {
874            type Operation = lro::Operation<crate::model::Spoke, crate::model::OperationMetadata>;
875            let polling_policy = self.0.stub.get_polling_policy(&self.0.options);
876            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
877
878            let stub = self.0.stub.clone();
879            let mut options = self.0.options.clone();
880            options.set_retry_policy(gax::retry_policy::NeverRetry);
881            let query = move |name| {
882                let stub = stub.clone();
883                let options = options.clone();
884                async {
885                    let op = GetOperation::new(stub)
886                        .set_name(name)
887                        .with_options(options)
888                        .send()
889                        .await?;
890                    Ok(Operation::new(op))
891                }
892            };
893
894            let start = move || async {
895                let op = self.send().await?;
896                Ok(Operation::new(op))
897            };
898
899            lro::new_poller(polling_policy, polling_backoff_policy, start, query)
900        }
901
902        /// Sets the value of [update_mask][crate::model::UpdateSpokeRequest::update_mask].
903        pub fn set_update_mask<T: Into<std::option::Option<wkt::FieldMask>>>(
904            mut self,
905            v: T,
906        ) -> Self {
907            self.0.request.update_mask = v.into();
908            self
909        }
910
911        /// Sets the value of [spoke][crate::model::UpdateSpokeRequest::spoke].
912        pub fn set_spoke<T: Into<std::option::Option<crate::model::Spoke>>>(
913            mut self,
914            v: T,
915        ) -> Self {
916            self.0.request.spoke = v.into();
917            self
918        }
919
920        /// Sets the value of [request_id][crate::model::UpdateSpokeRequest::request_id].
921        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
922            self.0.request.request_id = v.into();
923            self
924        }
925    }
926
927    impl gax::options::RequestBuilder for UpdateSpoke {
928        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
929            &mut self.0.options
930        }
931    }
932
933    /// The request builder for a HubService::reject_hub_spoke call.
934    #[derive(Clone, Debug)]
935    pub struct RejectHubSpoke(RequestBuilder<crate::model::RejectHubSpokeRequest>);
936
937    impl RejectHubSpoke {
938        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::HubService>) -> Self {
939            Self(RequestBuilder::new(stub))
940        }
941
942        /// Sets the full request, replacing any prior values.
943        pub fn with_request<V: Into<crate::model::RejectHubSpokeRequest>>(mut self, v: V) -> Self {
944            self.0.request = v.into();
945            self
946        }
947
948        /// Sets all the options, replacing any prior values.
949        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
950            self.0.options = v.into();
951            self
952        }
953
954        /// Sends the request.
955        ///
956        /// # Long running operations
957        ///
958        /// This starts, but does not poll, a longrunning operation. More information
959        /// on [reject_hub_spoke][crate::client::HubService::reject_hub_spoke].
960        pub async fn send(self) -> Result<longrunning::model::Operation> {
961            (*self.0.stub)
962                .reject_hub_spoke(self.0.request, self.0.options)
963                .await
964        }
965
966        /// Creates a [Poller][lro::Poller] to work with `reject_hub_spoke`.
967        pub fn poller(
968            self,
969        ) -> impl lro::Poller<crate::model::RejectHubSpokeResponse, crate::model::OperationMetadata>
970        {
971            type Operation = lro::Operation<
972                crate::model::RejectHubSpokeResponse,
973                crate::model::OperationMetadata,
974            >;
975            let polling_policy = self.0.stub.get_polling_policy(&self.0.options);
976            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
977
978            let stub = self.0.stub.clone();
979            let mut options = self.0.options.clone();
980            options.set_retry_policy(gax::retry_policy::NeverRetry);
981            let query = move |name| {
982                let stub = stub.clone();
983                let options = options.clone();
984                async {
985                    let op = GetOperation::new(stub)
986                        .set_name(name)
987                        .with_options(options)
988                        .send()
989                        .await?;
990                    Ok(Operation::new(op))
991                }
992            };
993
994            let start = move || async {
995                let op = self.send().await?;
996                Ok(Operation::new(op))
997            };
998
999            lro::new_poller(polling_policy, polling_backoff_policy, start, query)
1000        }
1001
1002        /// Sets the value of [name][crate::model::RejectHubSpokeRequest::name].
1003        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1004            self.0.request.name = v.into();
1005            self
1006        }
1007
1008        /// Sets the value of [spoke_uri][crate::model::RejectHubSpokeRequest::spoke_uri].
1009        pub fn set_spoke_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
1010            self.0.request.spoke_uri = v.into();
1011            self
1012        }
1013
1014        /// Sets the value of [request_id][crate::model::RejectHubSpokeRequest::request_id].
1015        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1016            self.0.request.request_id = v.into();
1017            self
1018        }
1019
1020        /// Sets the value of [details][crate::model::RejectHubSpokeRequest::details].
1021        pub fn set_details<T: Into<std::string::String>>(mut self, v: T) -> Self {
1022            self.0.request.details = v.into();
1023            self
1024        }
1025    }
1026
1027    impl gax::options::RequestBuilder for RejectHubSpoke {
1028        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1029            &mut self.0.options
1030        }
1031    }
1032
1033    /// The request builder for a HubService::accept_hub_spoke call.
1034    #[derive(Clone, Debug)]
1035    pub struct AcceptHubSpoke(RequestBuilder<crate::model::AcceptHubSpokeRequest>);
1036
1037    impl AcceptHubSpoke {
1038        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::HubService>) -> Self {
1039            Self(RequestBuilder::new(stub))
1040        }
1041
1042        /// Sets the full request, replacing any prior values.
1043        pub fn with_request<V: Into<crate::model::AcceptHubSpokeRequest>>(mut self, v: V) -> Self {
1044            self.0.request = v.into();
1045            self
1046        }
1047
1048        /// Sets all the options, replacing any prior values.
1049        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1050            self.0.options = v.into();
1051            self
1052        }
1053
1054        /// Sends the request.
1055        ///
1056        /// # Long running operations
1057        ///
1058        /// This starts, but does not poll, a longrunning operation. More information
1059        /// on [accept_hub_spoke][crate::client::HubService::accept_hub_spoke].
1060        pub async fn send(self) -> Result<longrunning::model::Operation> {
1061            (*self.0.stub)
1062                .accept_hub_spoke(self.0.request, self.0.options)
1063                .await
1064        }
1065
1066        /// Creates a [Poller][lro::Poller] to work with `accept_hub_spoke`.
1067        pub fn poller(
1068            self,
1069        ) -> impl lro::Poller<crate::model::AcceptHubSpokeResponse, crate::model::OperationMetadata>
1070        {
1071            type Operation = lro::Operation<
1072                crate::model::AcceptHubSpokeResponse,
1073                crate::model::OperationMetadata,
1074            >;
1075            let polling_policy = self.0.stub.get_polling_policy(&self.0.options);
1076            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1077
1078            let stub = self.0.stub.clone();
1079            let mut options = self.0.options.clone();
1080            options.set_retry_policy(gax::retry_policy::NeverRetry);
1081            let query = move |name| {
1082                let stub = stub.clone();
1083                let options = options.clone();
1084                async {
1085                    let op = GetOperation::new(stub)
1086                        .set_name(name)
1087                        .with_options(options)
1088                        .send()
1089                        .await?;
1090                    Ok(Operation::new(op))
1091                }
1092            };
1093
1094            let start = move || async {
1095                let op = self.send().await?;
1096                Ok(Operation::new(op))
1097            };
1098
1099            lro::new_poller(polling_policy, polling_backoff_policy, start, query)
1100        }
1101
1102        /// Sets the value of [name][crate::model::AcceptHubSpokeRequest::name].
1103        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1104            self.0.request.name = v.into();
1105            self
1106        }
1107
1108        /// Sets the value of [spoke_uri][crate::model::AcceptHubSpokeRequest::spoke_uri].
1109        pub fn set_spoke_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
1110            self.0.request.spoke_uri = v.into();
1111            self
1112        }
1113
1114        /// Sets the value of [request_id][crate::model::AcceptHubSpokeRequest::request_id].
1115        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1116            self.0.request.request_id = v.into();
1117            self
1118        }
1119    }
1120
1121    impl gax::options::RequestBuilder for AcceptHubSpoke {
1122        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1123            &mut self.0.options
1124        }
1125    }
1126
1127    /// The request builder for a HubService::delete_spoke call.
1128    #[derive(Clone, Debug)]
1129    pub struct DeleteSpoke(RequestBuilder<crate::model::DeleteSpokeRequest>);
1130
1131    impl DeleteSpoke {
1132        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::HubService>) -> Self {
1133            Self(RequestBuilder::new(stub))
1134        }
1135
1136        /// Sets the full request, replacing any prior values.
1137        pub fn with_request<V: Into<crate::model::DeleteSpokeRequest>>(mut self, v: V) -> Self {
1138            self.0.request = v.into();
1139            self
1140        }
1141
1142        /// Sets all the options, replacing any prior values.
1143        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1144            self.0.options = v.into();
1145            self
1146        }
1147
1148        /// Sends the request.
1149        ///
1150        /// # Long running operations
1151        ///
1152        /// This starts, but does not poll, a longrunning operation. More information
1153        /// on [delete_spoke][crate::client::HubService::delete_spoke].
1154        pub async fn send(self) -> Result<longrunning::model::Operation> {
1155            (*self.0.stub)
1156                .delete_spoke(self.0.request, self.0.options)
1157                .await
1158        }
1159
1160        /// Creates a [Poller][lro::Poller] to work with `delete_spoke`.
1161        pub fn poller(self) -> impl lro::Poller<wkt::Empty, crate::model::OperationMetadata> {
1162            type Operation = lro::Operation<wkt::Empty, crate::model::OperationMetadata>;
1163            let polling_policy = self.0.stub.get_polling_policy(&self.0.options);
1164            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1165
1166            let stub = self.0.stub.clone();
1167            let mut options = self.0.options.clone();
1168            options.set_retry_policy(gax::retry_policy::NeverRetry);
1169            let query = move |name| {
1170                let stub = stub.clone();
1171                let options = options.clone();
1172                async {
1173                    let op = GetOperation::new(stub)
1174                        .set_name(name)
1175                        .with_options(options)
1176                        .send()
1177                        .await?;
1178                    Ok(Operation::new(op))
1179                }
1180            };
1181
1182            let start = move || async {
1183                let op = self.send().await?;
1184                Ok(Operation::new(op))
1185            };
1186
1187            lro::new_poller(polling_policy, polling_backoff_policy, start, query)
1188        }
1189
1190        /// Sets the value of [name][crate::model::DeleteSpokeRequest::name].
1191        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1192            self.0.request.name = v.into();
1193            self
1194        }
1195
1196        /// Sets the value of [request_id][crate::model::DeleteSpokeRequest::request_id].
1197        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1198            self.0.request.request_id = v.into();
1199            self
1200        }
1201    }
1202
1203    impl gax::options::RequestBuilder for DeleteSpoke {
1204        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1205            &mut self.0.options
1206        }
1207    }
1208
1209    /// The request builder for a HubService::get_route_table call.
1210    #[derive(Clone, Debug)]
1211    pub struct GetRouteTable(RequestBuilder<crate::model::GetRouteTableRequest>);
1212
1213    impl GetRouteTable {
1214        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::HubService>) -> Self {
1215            Self(RequestBuilder::new(stub))
1216        }
1217
1218        /// Sets the full request, replacing any prior values.
1219        pub fn with_request<V: Into<crate::model::GetRouteTableRequest>>(mut self, v: V) -> Self {
1220            self.0.request = v.into();
1221            self
1222        }
1223
1224        /// Sets all the options, replacing any prior values.
1225        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1226            self.0.options = v.into();
1227            self
1228        }
1229
1230        /// Sends the request.
1231        pub async fn send(self) -> Result<crate::model::RouteTable> {
1232            (*self.0.stub)
1233                .get_route_table(self.0.request, self.0.options)
1234                .await
1235        }
1236
1237        /// Sets the value of [name][crate::model::GetRouteTableRequest::name].
1238        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1239            self.0.request.name = v.into();
1240            self
1241        }
1242    }
1243
1244    impl gax::options::RequestBuilder for GetRouteTable {
1245        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1246            &mut self.0.options
1247        }
1248    }
1249
1250    /// The request builder for a HubService::get_route call.
1251    #[derive(Clone, Debug)]
1252    pub struct GetRoute(RequestBuilder<crate::model::GetRouteRequest>);
1253
1254    impl GetRoute {
1255        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::HubService>) -> Self {
1256            Self(RequestBuilder::new(stub))
1257        }
1258
1259        /// Sets the full request, replacing any prior values.
1260        pub fn with_request<V: Into<crate::model::GetRouteRequest>>(mut self, v: V) -> Self {
1261            self.0.request = v.into();
1262            self
1263        }
1264
1265        /// Sets all the options, replacing any prior values.
1266        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1267            self.0.options = v.into();
1268            self
1269        }
1270
1271        /// Sends the request.
1272        pub async fn send(self) -> Result<crate::model::Route> {
1273            (*self.0.stub)
1274                .get_route(self.0.request, self.0.options)
1275                .await
1276        }
1277
1278        /// Sets the value of [name][crate::model::GetRouteRequest::name].
1279        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1280            self.0.request.name = v.into();
1281            self
1282        }
1283    }
1284
1285    impl gax::options::RequestBuilder for GetRoute {
1286        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1287            &mut self.0.options
1288        }
1289    }
1290
1291    /// The request builder for a HubService::list_routes call.
1292    #[derive(Clone, Debug)]
1293    pub struct ListRoutes(RequestBuilder<crate::model::ListRoutesRequest>);
1294
1295    impl ListRoutes {
1296        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::HubService>) -> Self {
1297            Self(RequestBuilder::new(stub))
1298        }
1299
1300        /// Sets the full request, replacing any prior values.
1301        pub fn with_request<V: Into<crate::model::ListRoutesRequest>>(mut self, v: V) -> Self {
1302            self.0.request = v.into();
1303            self
1304        }
1305
1306        /// Sets all the options, replacing any prior values.
1307        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1308            self.0.options = v.into();
1309            self
1310        }
1311
1312        /// Sends the request.
1313        pub async fn send(self) -> Result<crate::model::ListRoutesResponse> {
1314            (*self.0.stub)
1315                .list_routes(self.0.request, self.0.options)
1316                .await
1317        }
1318
1319        /// Streams the responses back.
1320        #[cfg(feature = "unstable-stream")]
1321        pub async fn stream(
1322            self,
1323        ) -> gax::paginator::Paginator<crate::model::ListRoutesResponse, gax::error::Error>
1324        {
1325            let token = gax::paginator::extract_token(&self.0.request.page_token);
1326            let execute = move |token: String| {
1327                let mut builder = self.clone();
1328                builder.0.request = builder.0.request.set_page_token(token);
1329                builder.send()
1330            };
1331            gax::paginator::Paginator::new(token, execute)
1332        }
1333
1334        /// Sets the value of [parent][crate::model::ListRoutesRequest::parent].
1335        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1336            self.0.request.parent = v.into();
1337            self
1338        }
1339
1340        /// Sets the value of [page_size][crate::model::ListRoutesRequest::page_size].
1341        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1342            self.0.request.page_size = v.into();
1343            self
1344        }
1345
1346        /// Sets the value of [page_token][crate::model::ListRoutesRequest::page_token].
1347        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1348            self.0.request.page_token = v.into();
1349            self
1350        }
1351
1352        /// Sets the value of [filter][crate::model::ListRoutesRequest::filter].
1353        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1354            self.0.request.filter = v.into();
1355            self
1356        }
1357
1358        /// Sets the value of [order_by][crate::model::ListRoutesRequest::order_by].
1359        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1360            self.0.request.order_by = v.into();
1361            self
1362        }
1363    }
1364
1365    impl gax::options::RequestBuilder for ListRoutes {
1366        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1367            &mut self.0.options
1368        }
1369    }
1370
1371    /// The request builder for a HubService::list_route_tables call.
1372    #[derive(Clone, Debug)]
1373    pub struct ListRouteTables(RequestBuilder<crate::model::ListRouteTablesRequest>);
1374
1375    impl ListRouteTables {
1376        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::HubService>) -> Self {
1377            Self(RequestBuilder::new(stub))
1378        }
1379
1380        /// Sets the full request, replacing any prior values.
1381        pub fn with_request<V: Into<crate::model::ListRouteTablesRequest>>(mut self, v: V) -> Self {
1382            self.0.request = v.into();
1383            self
1384        }
1385
1386        /// Sets all the options, replacing any prior values.
1387        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1388            self.0.options = v.into();
1389            self
1390        }
1391
1392        /// Sends the request.
1393        pub async fn send(self) -> Result<crate::model::ListRouteTablesResponse> {
1394            (*self.0.stub)
1395                .list_route_tables(self.0.request, self.0.options)
1396                .await
1397        }
1398
1399        /// Streams the responses back.
1400        #[cfg(feature = "unstable-stream")]
1401        pub async fn stream(
1402            self,
1403        ) -> gax::paginator::Paginator<crate::model::ListRouteTablesResponse, gax::error::Error>
1404        {
1405            let token = gax::paginator::extract_token(&self.0.request.page_token);
1406            let execute = move |token: String| {
1407                let mut builder = self.clone();
1408                builder.0.request = builder.0.request.set_page_token(token);
1409                builder.send()
1410            };
1411            gax::paginator::Paginator::new(token, execute)
1412        }
1413
1414        /// Sets the value of [parent][crate::model::ListRouteTablesRequest::parent].
1415        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1416            self.0.request.parent = v.into();
1417            self
1418        }
1419
1420        /// Sets the value of [page_size][crate::model::ListRouteTablesRequest::page_size].
1421        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1422            self.0.request.page_size = v.into();
1423            self
1424        }
1425
1426        /// Sets the value of [page_token][crate::model::ListRouteTablesRequest::page_token].
1427        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1428            self.0.request.page_token = v.into();
1429            self
1430        }
1431
1432        /// Sets the value of [filter][crate::model::ListRouteTablesRequest::filter].
1433        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1434            self.0.request.filter = v.into();
1435            self
1436        }
1437
1438        /// Sets the value of [order_by][crate::model::ListRouteTablesRequest::order_by].
1439        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1440            self.0.request.order_by = v.into();
1441            self
1442        }
1443    }
1444
1445    impl gax::options::RequestBuilder for ListRouteTables {
1446        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1447            &mut self.0.options
1448        }
1449    }
1450
1451    /// The request builder for a HubService::get_group call.
1452    #[derive(Clone, Debug)]
1453    pub struct GetGroup(RequestBuilder<crate::model::GetGroupRequest>);
1454
1455    impl GetGroup {
1456        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::HubService>) -> Self {
1457            Self(RequestBuilder::new(stub))
1458        }
1459
1460        /// Sets the full request, replacing any prior values.
1461        pub fn with_request<V: Into<crate::model::GetGroupRequest>>(mut self, v: V) -> Self {
1462            self.0.request = v.into();
1463            self
1464        }
1465
1466        /// Sets all the options, replacing any prior values.
1467        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1468            self.0.options = v.into();
1469            self
1470        }
1471
1472        /// Sends the request.
1473        pub async fn send(self) -> Result<crate::model::Group> {
1474            (*self.0.stub)
1475                .get_group(self.0.request, self.0.options)
1476                .await
1477        }
1478
1479        /// Sets the value of [name][crate::model::GetGroupRequest::name].
1480        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1481            self.0.request.name = v.into();
1482            self
1483        }
1484    }
1485
1486    impl gax::options::RequestBuilder for GetGroup {
1487        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1488            &mut self.0.options
1489        }
1490    }
1491
1492    /// The request builder for a HubService::list_groups call.
1493    #[derive(Clone, Debug)]
1494    pub struct ListGroups(RequestBuilder<crate::model::ListGroupsRequest>);
1495
1496    impl ListGroups {
1497        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::HubService>) -> Self {
1498            Self(RequestBuilder::new(stub))
1499        }
1500
1501        /// Sets the full request, replacing any prior values.
1502        pub fn with_request<V: Into<crate::model::ListGroupsRequest>>(mut self, v: V) -> Self {
1503            self.0.request = v.into();
1504            self
1505        }
1506
1507        /// Sets all the options, replacing any prior values.
1508        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1509            self.0.options = v.into();
1510            self
1511        }
1512
1513        /// Sends the request.
1514        pub async fn send(self) -> Result<crate::model::ListGroupsResponse> {
1515            (*self.0.stub)
1516                .list_groups(self.0.request, self.0.options)
1517                .await
1518        }
1519
1520        /// Streams the responses back.
1521        #[cfg(feature = "unstable-stream")]
1522        pub async fn stream(
1523            self,
1524        ) -> gax::paginator::Paginator<crate::model::ListGroupsResponse, gax::error::Error>
1525        {
1526            let token = gax::paginator::extract_token(&self.0.request.page_token);
1527            let execute = move |token: String| {
1528                let mut builder = self.clone();
1529                builder.0.request = builder.0.request.set_page_token(token);
1530                builder.send()
1531            };
1532            gax::paginator::Paginator::new(token, execute)
1533        }
1534
1535        /// Sets the value of [parent][crate::model::ListGroupsRequest::parent].
1536        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1537            self.0.request.parent = v.into();
1538            self
1539        }
1540
1541        /// Sets the value of [page_size][crate::model::ListGroupsRequest::page_size].
1542        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1543            self.0.request.page_size = v.into();
1544            self
1545        }
1546
1547        /// Sets the value of [page_token][crate::model::ListGroupsRequest::page_token].
1548        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1549            self.0.request.page_token = v.into();
1550            self
1551        }
1552
1553        /// Sets the value of [filter][crate::model::ListGroupsRequest::filter].
1554        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1555            self.0.request.filter = v.into();
1556            self
1557        }
1558
1559        /// Sets the value of [order_by][crate::model::ListGroupsRequest::order_by].
1560        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1561            self.0.request.order_by = v.into();
1562            self
1563        }
1564    }
1565
1566    impl gax::options::RequestBuilder for ListGroups {
1567        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1568            &mut self.0.options
1569        }
1570    }
1571
1572    /// The request builder for a HubService::update_group call.
1573    #[derive(Clone, Debug)]
1574    pub struct UpdateGroup(RequestBuilder<crate::model::UpdateGroupRequest>);
1575
1576    impl UpdateGroup {
1577        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::HubService>) -> Self {
1578            Self(RequestBuilder::new(stub))
1579        }
1580
1581        /// Sets the full request, replacing any prior values.
1582        pub fn with_request<V: Into<crate::model::UpdateGroupRequest>>(mut self, v: V) -> Self {
1583            self.0.request = v.into();
1584            self
1585        }
1586
1587        /// Sets all the options, replacing any prior values.
1588        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1589            self.0.options = v.into();
1590            self
1591        }
1592
1593        /// Sends the request.
1594        ///
1595        /// # Long running operations
1596        ///
1597        /// This starts, but does not poll, a longrunning operation. More information
1598        /// on [update_group][crate::client::HubService::update_group].
1599        pub async fn send(self) -> Result<longrunning::model::Operation> {
1600            (*self.0.stub)
1601                .update_group(self.0.request, self.0.options)
1602                .await
1603        }
1604
1605        /// Creates a [Poller][lro::Poller] to work with `update_group`.
1606        pub fn poller(
1607            self,
1608        ) -> impl lro::Poller<crate::model::Group, crate::model::OperationMetadata> {
1609            type Operation = lro::Operation<crate::model::Group, crate::model::OperationMetadata>;
1610            let polling_policy = self.0.stub.get_polling_policy(&self.0.options);
1611            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1612
1613            let stub = self.0.stub.clone();
1614            let mut options = self.0.options.clone();
1615            options.set_retry_policy(gax::retry_policy::NeverRetry);
1616            let query = move |name| {
1617                let stub = stub.clone();
1618                let options = options.clone();
1619                async {
1620                    let op = GetOperation::new(stub)
1621                        .set_name(name)
1622                        .with_options(options)
1623                        .send()
1624                        .await?;
1625                    Ok(Operation::new(op))
1626                }
1627            };
1628
1629            let start = move || async {
1630                let op = self.send().await?;
1631                Ok(Operation::new(op))
1632            };
1633
1634            lro::new_poller(polling_policy, polling_backoff_policy, start, query)
1635        }
1636
1637        /// Sets the value of [update_mask][crate::model::UpdateGroupRequest::update_mask].
1638        pub fn set_update_mask<T: Into<std::option::Option<wkt::FieldMask>>>(
1639            mut self,
1640            v: T,
1641        ) -> Self {
1642            self.0.request.update_mask = v.into();
1643            self
1644        }
1645
1646        /// Sets the value of [group][crate::model::UpdateGroupRequest::group].
1647        pub fn set_group<T: Into<std::option::Option<crate::model::Group>>>(
1648            mut self,
1649            v: T,
1650        ) -> Self {
1651            self.0.request.group = v.into();
1652            self
1653        }
1654
1655        /// Sets the value of [request_id][crate::model::UpdateGroupRequest::request_id].
1656        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1657            self.0.request.request_id = v.into();
1658            self
1659        }
1660    }
1661
1662    impl gax::options::RequestBuilder for UpdateGroup {
1663        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1664            &mut self.0.options
1665        }
1666    }
1667
1668    /// The request builder for a HubService::list_locations call.
1669    #[derive(Clone, Debug)]
1670    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
1671
1672    impl ListLocations {
1673        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::HubService>) -> Self {
1674            Self(RequestBuilder::new(stub))
1675        }
1676
1677        /// Sets the full request, replacing any prior values.
1678        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
1679            mut self,
1680            v: V,
1681        ) -> Self {
1682            self.0.request = v.into();
1683            self
1684        }
1685
1686        /// Sets all the options, replacing any prior values.
1687        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1688            self.0.options = v.into();
1689            self
1690        }
1691
1692        /// Sends the request.
1693        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
1694            (*self.0.stub)
1695                .list_locations(self.0.request, self.0.options)
1696                .await
1697        }
1698
1699        /// Streams the responses back.
1700        #[cfg(feature = "unstable-stream")]
1701        pub async fn stream(
1702            self,
1703        ) -> gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
1704        {
1705            let token = gax::paginator::extract_token(&self.0.request.page_token);
1706            let execute = move |token: String| {
1707                let mut builder = self.clone();
1708                builder.0.request = builder.0.request.set_page_token(token);
1709                builder.send()
1710            };
1711            gax::paginator::Paginator::new(token, execute)
1712        }
1713
1714        /// Sets the value of [name][location::model::ListLocationsRequest::name].
1715        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1716            self.0.request.name = v.into();
1717            self
1718        }
1719
1720        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
1721        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1722            self.0.request.filter = v.into();
1723            self
1724        }
1725
1726        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
1727        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1728            self.0.request.page_size = v.into();
1729            self
1730        }
1731
1732        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
1733        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1734            self.0.request.page_token = v.into();
1735            self
1736        }
1737    }
1738
1739    impl gax::options::RequestBuilder for ListLocations {
1740        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1741            &mut self.0.options
1742        }
1743    }
1744
1745    /// The request builder for a HubService::get_location call.
1746    #[derive(Clone, Debug)]
1747    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
1748
1749    impl GetLocation {
1750        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::HubService>) -> Self {
1751            Self(RequestBuilder::new(stub))
1752        }
1753
1754        /// Sets the full request, replacing any prior values.
1755        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
1756            self.0.request = v.into();
1757            self
1758        }
1759
1760        /// Sets all the options, replacing any prior values.
1761        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1762            self.0.options = v.into();
1763            self
1764        }
1765
1766        /// Sends the request.
1767        pub async fn send(self) -> Result<location::model::Location> {
1768            (*self.0.stub)
1769                .get_location(self.0.request, self.0.options)
1770                .await
1771        }
1772
1773        /// Sets the value of [name][location::model::GetLocationRequest::name].
1774        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1775            self.0.request.name = v.into();
1776            self
1777        }
1778    }
1779
1780    impl gax::options::RequestBuilder for GetLocation {
1781        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1782            &mut self.0.options
1783        }
1784    }
1785
1786    /// The request builder for a HubService::set_iam_policy call.
1787    #[derive(Clone, Debug)]
1788    pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
1789
1790    impl SetIamPolicy {
1791        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::HubService>) -> Self {
1792            Self(RequestBuilder::new(stub))
1793        }
1794
1795        /// Sets the full request, replacing any prior values.
1796        pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
1797            self.0.request = v.into();
1798            self
1799        }
1800
1801        /// Sets all the options, replacing any prior values.
1802        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1803            self.0.options = v.into();
1804            self
1805        }
1806
1807        /// Sends the request.
1808        pub async fn send(self) -> Result<iam_v1::model::Policy> {
1809            (*self.0.stub)
1810                .set_iam_policy(self.0.request, self.0.options)
1811                .await
1812        }
1813
1814        /// Sets the value of [resource][iam_v1::model::SetIamPolicyRequest::resource].
1815        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1816            self.0.request.resource = v.into();
1817            self
1818        }
1819
1820        /// Sets the value of [policy][iam_v1::model::SetIamPolicyRequest::policy].
1821        pub fn set_policy<T: Into<std::option::Option<iam_v1::model::Policy>>>(
1822            mut self,
1823            v: T,
1824        ) -> Self {
1825            self.0.request.policy = v.into();
1826            self
1827        }
1828
1829        /// Sets the value of [update_mask][iam_v1::model::SetIamPolicyRequest::update_mask].
1830        pub fn set_update_mask<T: Into<std::option::Option<wkt::FieldMask>>>(
1831            mut self,
1832            v: T,
1833        ) -> Self {
1834            self.0.request.update_mask = v.into();
1835            self
1836        }
1837    }
1838
1839    impl gax::options::RequestBuilder for SetIamPolicy {
1840        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1841            &mut self.0.options
1842        }
1843    }
1844
1845    /// The request builder for a HubService::get_iam_policy call.
1846    #[derive(Clone, Debug)]
1847    pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
1848
1849    impl GetIamPolicy {
1850        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::HubService>) -> Self {
1851            Self(RequestBuilder::new(stub))
1852        }
1853
1854        /// Sets the full request, replacing any prior values.
1855        pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
1856            self.0.request = v.into();
1857            self
1858        }
1859
1860        /// Sets all the options, replacing any prior values.
1861        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1862            self.0.options = v.into();
1863            self
1864        }
1865
1866        /// Sends the request.
1867        pub async fn send(self) -> Result<iam_v1::model::Policy> {
1868            (*self.0.stub)
1869                .get_iam_policy(self.0.request, self.0.options)
1870                .await
1871        }
1872
1873        /// Sets the value of [resource][iam_v1::model::GetIamPolicyRequest::resource].
1874        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1875            self.0.request.resource = v.into();
1876            self
1877        }
1878
1879        /// Sets the value of [options][iam_v1::model::GetIamPolicyRequest::options].
1880        pub fn set_options<T: Into<std::option::Option<iam_v1::model::GetPolicyOptions>>>(
1881            mut self,
1882            v: T,
1883        ) -> Self {
1884            self.0.request.options = v.into();
1885            self
1886        }
1887    }
1888
1889    impl gax::options::RequestBuilder for GetIamPolicy {
1890        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1891            &mut self.0.options
1892        }
1893    }
1894
1895    /// The request builder for a HubService::test_iam_permissions call.
1896    #[derive(Clone, Debug)]
1897    pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
1898
1899    impl TestIamPermissions {
1900        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::HubService>) -> Self {
1901            Self(RequestBuilder::new(stub))
1902        }
1903
1904        /// Sets the full request, replacing any prior values.
1905        pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
1906            mut self,
1907            v: V,
1908        ) -> Self {
1909            self.0.request = v.into();
1910            self
1911        }
1912
1913        /// Sets all the options, replacing any prior values.
1914        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1915            self.0.options = v.into();
1916            self
1917        }
1918
1919        /// Sends the request.
1920        pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
1921            (*self.0.stub)
1922                .test_iam_permissions(self.0.request, self.0.options)
1923                .await
1924        }
1925
1926        /// Sets the value of [resource][iam_v1::model::TestIamPermissionsRequest::resource].
1927        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1928            self.0.request.resource = v.into();
1929            self
1930        }
1931
1932        /// Sets the value of [permissions][iam_v1::model::TestIamPermissionsRequest::permissions].
1933        pub fn set_permissions<T, V>(mut self, v: T) -> Self
1934        where
1935            T: std::iter::IntoIterator<Item = V>,
1936            V: std::convert::Into<std::string::String>,
1937        {
1938            use std::iter::Iterator;
1939            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
1940            self
1941        }
1942    }
1943
1944    impl gax::options::RequestBuilder for TestIamPermissions {
1945        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1946            &mut self.0.options
1947        }
1948    }
1949
1950    /// The request builder for a HubService::list_operations call.
1951    #[derive(Clone, Debug)]
1952    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
1953
1954    impl ListOperations {
1955        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::HubService>) -> Self {
1956            Self(RequestBuilder::new(stub))
1957        }
1958
1959        /// Sets the full request, replacing any prior values.
1960        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
1961            mut self,
1962            v: V,
1963        ) -> Self {
1964            self.0.request = v.into();
1965            self
1966        }
1967
1968        /// Sets all the options, replacing any prior values.
1969        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1970            self.0.options = v.into();
1971            self
1972        }
1973
1974        /// Sends the request.
1975        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
1976            (*self.0.stub)
1977                .list_operations(self.0.request, self.0.options)
1978                .await
1979        }
1980
1981        /// Streams the responses back.
1982        #[cfg(feature = "unstable-stream")]
1983        pub async fn stream(
1984            self,
1985        ) -> gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
1986        {
1987            let token = gax::paginator::extract_token(&self.0.request.page_token);
1988            let execute = move |token: String| {
1989                let mut builder = self.clone();
1990                builder.0.request = builder.0.request.set_page_token(token);
1991                builder.send()
1992            };
1993            gax::paginator::Paginator::new(token, execute)
1994        }
1995
1996        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
1997        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1998            self.0.request.name = v.into();
1999            self
2000        }
2001
2002        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
2003        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2004            self.0.request.filter = v.into();
2005            self
2006        }
2007
2008        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
2009        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2010            self.0.request.page_size = v.into();
2011            self
2012        }
2013
2014        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
2015        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2016            self.0.request.page_token = v.into();
2017            self
2018        }
2019    }
2020
2021    impl gax::options::RequestBuilder for ListOperations {
2022        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2023            &mut self.0.options
2024        }
2025    }
2026
2027    /// The request builder for a HubService::get_operation call.
2028    #[derive(Clone, Debug)]
2029    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
2030
2031    impl GetOperation {
2032        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::HubService>) -> Self {
2033            Self(RequestBuilder::new(stub))
2034        }
2035
2036        /// Sets the full request, replacing any prior values.
2037        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
2038            mut self,
2039            v: V,
2040        ) -> Self {
2041            self.0.request = v.into();
2042            self
2043        }
2044
2045        /// Sets all the options, replacing any prior values.
2046        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2047            self.0.options = v.into();
2048            self
2049        }
2050
2051        /// Sends the request.
2052        pub async fn send(self) -> Result<longrunning::model::Operation> {
2053            (*self.0.stub)
2054                .get_operation(self.0.request, self.0.options)
2055                .await
2056        }
2057
2058        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
2059        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2060            self.0.request.name = v.into();
2061            self
2062        }
2063    }
2064
2065    impl gax::options::RequestBuilder for GetOperation {
2066        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2067            &mut self.0.options
2068        }
2069    }
2070
2071    /// The request builder for a HubService::delete_operation call.
2072    #[derive(Clone, Debug)]
2073    pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
2074
2075    impl DeleteOperation {
2076        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::HubService>) -> Self {
2077            Self(RequestBuilder::new(stub))
2078        }
2079
2080        /// Sets the full request, replacing any prior values.
2081        pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
2082            mut self,
2083            v: V,
2084        ) -> Self {
2085            self.0.request = v.into();
2086            self
2087        }
2088
2089        /// Sets all the options, replacing any prior values.
2090        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2091            self.0.options = v.into();
2092            self
2093        }
2094
2095        /// Sends the request.
2096        pub async fn send(self) -> Result<wkt::Empty> {
2097            (*self.0.stub)
2098                .delete_operation(self.0.request, self.0.options)
2099                .await
2100        }
2101
2102        /// Sets the value of [name][longrunning::model::DeleteOperationRequest::name].
2103        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2104            self.0.request.name = v.into();
2105            self
2106        }
2107    }
2108
2109    impl gax::options::RequestBuilder for DeleteOperation {
2110        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2111            &mut self.0.options
2112        }
2113    }
2114
2115    /// The request builder for a HubService::cancel_operation call.
2116    #[derive(Clone, Debug)]
2117    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
2118
2119    impl CancelOperation {
2120        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::HubService>) -> Self {
2121            Self(RequestBuilder::new(stub))
2122        }
2123
2124        /// Sets the full request, replacing any prior values.
2125        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
2126            mut self,
2127            v: V,
2128        ) -> Self {
2129            self.0.request = v.into();
2130            self
2131        }
2132
2133        /// Sets all the options, replacing any prior values.
2134        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2135            self.0.options = v.into();
2136            self
2137        }
2138
2139        /// Sends the request.
2140        pub async fn send(self) -> Result<wkt::Empty> {
2141            (*self.0.stub)
2142                .cancel_operation(self.0.request, self.0.options)
2143                .await
2144        }
2145
2146        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
2147        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2148            self.0.request.name = v.into();
2149            self
2150        }
2151    }
2152
2153    impl gax::options::RequestBuilder for CancelOperation {
2154        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2155            &mut self.0.options
2156        }
2157    }
2158}
2159
2160pub mod policy_based_routing_service {
2161    use crate::Result;
2162    use std::sync::Arc;
2163
2164    /// Common implementation for [crate::client::PolicyBasedRoutingService] request builders.
2165    #[derive(Clone, Debug)]
2166    pub struct RequestBuilder<R: std::default::Default> {
2167        stub: Arc<dyn crate::stubs::dynamic::PolicyBasedRoutingService>,
2168        request: R,
2169        options: gax::options::RequestOptions,
2170    }
2171
2172    impl<R> RequestBuilder<R>
2173    where
2174        R: std::default::Default,
2175    {
2176        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::PolicyBasedRoutingService>) -> Self {
2177            Self {
2178                stub,
2179                request: R::default(),
2180                options: gax::options::RequestOptions::default(),
2181            }
2182        }
2183    }
2184
2185    /// The request builder for a PolicyBasedRoutingService::list_policy_based_routes call.
2186    #[derive(Clone, Debug)]
2187    pub struct ListPolicyBasedRoutes(RequestBuilder<crate::model::ListPolicyBasedRoutesRequest>);
2188
2189    impl ListPolicyBasedRoutes {
2190        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::PolicyBasedRoutingService>) -> Self {
2191            Self(RequestBuilder::new(stub))
2192        }
2193
2194        /// Sets the full request, replacing any prior values.
2195        pub fn with_request<V: Into<crate::model::ListPolicyBasedRoutesRequest>>(
2196            mut self,
2197            v: V,
2198        ) -> Self {
2199            self.0.request = v.into();
2200            self
2201        }
2202
2203        /// Sets all the options, replacing any prior values.
2204        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2205            self.0.options = v.into();
2206            self
2207        }
2208
2209        /// Sends the request.
2210        pub async fn send(self) -> Result<crate::model::ListPolicyBasedRoutesResponse> {
2211            (*self.0.stub)
2212                .list_policy_based_routes(self.0.request, self.0.options)
2213                .await
2214        }
2215
2216        /// Streams the responses back.
2217        #[cfg(feature = "unstable-stream")]
2218        pub async fn stream(
2219            self,
2220        ) -> gax::paginator::Paginator<crate::model::ListPolicyBasedRoutesResponse, gax::error::Error>
2221        {
2222            let token = gax::paginator::extract_token(&self.0.request.page_token);
2223            let execute = move |token: String| {
2224                let mut builder = self.clone();
2225                builder.0.request = builder.0.request.set_page_token(token);
2226                builder.send()
2227            };
2228            gax::paginator::Paginator::new(token, execute)
2229        }
2230
2231        /// Sets the value of [parent][crate::model::ListPolicyBasedRoutesRequest::parent].
2232        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2233            self.0.request.parent = v.into();
2234            self
2235        }
2236
2237        /// Sets the value of [page_size][crate::model::ListPolicyBasedRoutesRequest::page_size].
2238        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2239            self.0.request.page_size = v.into();
2240            self
2241        }
2242
2243        /// Sets the value of [page_token][crate::model::ListPolicyBasedRoutesRequest::page_token].
2244        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2245            self.0.request.page_token = v.into();
2246            self
2247        }
2248
2249        /// Sets the value of [filter][crate::model::ListPolicyBasedRoutesRequest::filter].
2250        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2251            self.0.request.filter = v.into();
2252            self
2253        }
2254
2255        /// Sets the value of [order_by][crate::model::ListPolicyBasedRoutesRequest::order_by].
2256        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
2257            self.0.request.order_by = v.into();
2258            self
2259        }
2260    }
2261
2262    impl gax::options::RequestBuilder for ListPolicyBasedRoutes {
2263        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2264            &mut self.0.options
2265        }
2266    }
2267
2268    /// The request builder for a PolicyBasedRoutingService::get_policy_based_route call.
2269    #[derive(Clone, Debug)]
2270    pub struct GetPolicyBasedRoute(RequestBuilder<crate::model::GetPolicyBasedRouteRequest>);
2271
2272    impl GetPolicyBasedRoute {
2273        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::PolicyBasedRoutingService>) -> Self {
2274            Self(RequestBuilder::new(stub))
2275        }
2276
2277        /// Sets the full request, replacing any prior values.
2278        pub fn with_request<V: Into<crate::model::GetPolicyBasedRouteRequest>>(
2279            mut self,
2280            v: V,
2281        ) -> Self {
2282            self.0.request = v.into();
2283            self
2284        }
2285
2286        /// Sets all the options, replacing any prior values.
2287        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2288            self.0.options = v.into();
2289            self
2290        }
2291
2292        /// Sends the request.
2293        pub async fn send(self) -> Result<crate::model::PolicyBasedRoute> {
2294            (*self.0.stub)
2295                .get_policy_based_route(self.0.request, self.0.options)
2296                .await
2297        }
2298
2299        /// Sets the value of [name][crate::model::GetPolicyBasedRouteRequest::name].
2300        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2301            self.0.request.name = v.into();
2302            self
2303        }
2304    }
2305
2306    impl gax::options::RequestBuilder for GetPolicyBasedRoute {
2307        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2308            &mut self.0.options
2309        }
2310    }
2311
2312    /// The request builder for a PolicyBasedRoutingService::create_policy_based_route call.
2313    #[derive(Clone, Debug)]
2314    pub struct CreatePolicyBasedRoute(RequestBuilder<crate::model::CreatePolicyBasedRouteRequest>);
2315
2316    impl CreatePolicyBasedRoute {
2317        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::PolicyBasedRoutingService>) -> Self {
2318            Self(RequestBuilder::new(stub))
2319        }
2320
2321        /// Sets the full request, replacing any prior values.
2322        pub fn with_request<V: Into<crate::model::CreatePolicyBasedRouteRequest>>(
2323            mut self,
2324            v: V,
2325        ) -> Self {
2326            self.0.request = v.into();
2327            self
2328        }
2329
2330        /// Sets all the options, replacing any prior values.
2331        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2332            self.0.options = v.into();
2333            self
2334        }
2335
2336        /// Sends the request.
2337        ///
2338        /// # Long running operations
2339        ///
2340        /// This starts, but does not poll, a longrunning operation. More information
2341        /// on [create_policy_based_route][crate::client::PolicyBasedRoutingService::create_policy_based_route].
2342        pub async fn send(self) -> Result<longrunning::model::Operation> {
2343            (*self.0.stub)
2344                .create_policy_based_route(self.0.request, self.0.options)
2345                .await
2346        }
2347
2348        /// Creates a [Poller][lro::Poller] to work with `create_policy_based_route`.
2349        pub fn poller(
2350            self,
2351        ) -> impl lro::Poller<crate::model::PolicyBasedRoute, crate::model::OperationMetadata>
2352        {
2353            type Operation =
2354                lro::Operation<crate::model::PolicyBasedRoute, crate::model::OperationMetadata>;
2355            let polling_policy = self.0.stub.get_polling_policy(&self.0.options);
2356            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2357
2358            let stub = self.0.stub.clone();
2359            let mut options = self.0.options.clone();
2360            options.set_retry_policy(gax::retry_policy::NeverRetry);
2361            let query = move |name| {
2362                let stub = stub.clone();
2363                let options = options.clone();
2364                async {
2365                    let op = GetOperation::new(stub)
2366                        .set_name(name)
2367                        .with_options(options)
2368                        .send()
2369                        .await?;
2370                    Ok(Operation::new(op))
2371                }
2372            };
2373
2374            let start = move || async {
2375                let op = self.send().await?;
2376                Ok(Operation::new(op))
2377            };
2378
2379            lro::new_poller(polling_policy, polling_backoff_policy, start, query)
2380        }
2381
2382        /// Sets the value of [parent][crate::model::CreatePolicyBasedRouteRequest::parent].
2383        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2384            self.0.request.parent = v.into();
2385            self
2386        }
2387
2388        /// Sets the value of [policy_based_route_id][crate::model::CreatePolicyBasedRouteRequest::policy_based_route_id].
2389        pub fn set_policy_based_route_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2390            self.0.request.policy_based_route_id = v.into();
2391            self
2392        }
2393
2394        /// Sets the value of [policy_based_route][crate::model::CreatePolicyBasedRouteRequest::policy_based_route].
2395        pub fn set_policy_based_route<
2396            T: Into<std::option::Option<crate::model::PolicyBasedRoute>>,
2397        >(
2398            mut self,
2399            v: T,
2400        ) -> Self {
2401            self.0.request.policy_based_route = v.into();
2402            self
2403        }
2404
2405        /// Sets the value of [request_id][crate::model::CreatePolicyBasedRouteRequest::request_id].
2406        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2407            self.0.request.request_id = v.into();
2408            self
2409        }
2410    }
2411
2412    impl gax::options::RequestBuilder for CreatePolicyBasedRoute {
2413        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2414            &mut self.0.options
2415        }
2416    }
2417
2418    /// The request builder for a PolicyBasedRoutingService::delete_policy_based_route call.
2419    #[derive(Clone, Debug)]
2420    pub struct DeletePolicyBasedRoute(RequestBuilder<crate::model::DeletePolicyBasedRouteRequest>);
2421
2422    impl DeletePolicyBasedRoute {
2423        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::PolicyBasedRoutingService>) -> Self {
2424            Self(RequestBuilder::new(stub))
2425        }
2426
2427        /// Sets the full request, replacing any prior values.
2428        pub fn with_request<V: Into<crate::model::DeletePolicyBasedRouteRequest>>(
2429            mut self,
2430            v: V,
2431        ) -> Self {
2432            self.0.request = v.into();
2433            self
2434        }
2435
2436        /// Sets all the options, replacing any prior values.
2437        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2438            self.0.options = v.into();
2439            self
2440        }
2441
2442        /// Sends the request.
2443        ///
2444        /// # Long running operations
2445        ///
2446        /// This starts, but does not poll, a longrunning operation. More information
2447        /// on [delete_policy_based_route][crate::client::PolicyBasedRoutingService::delete_policy_based_route].
2448        pub async fn send(self) -> Result<longrunning::model::Operation> {
2449            (*self.0.stub)
2450                .delete_policy_based_route(self.0.request, self.0.options)
2451                .await
2452        }
2453
2454        /// Creates a [Poller][lro::Poller] to work with `delete_policy_based_route`.
2455        pub fn poller(self) -> impl lro::Poller<wkt::Empty, crate::model::OperationMetadata> {
2456            type Operation = lro::Operation<wkt::Empty, crate::model::OperationMetadata>;
2457            let polling_policy = self.0.stub.get_polling_policy(&self.0.options);
2458            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2459
2460            let stub = self.0.stub.clone();
2461            let mut options = self.0.options.clone();
2462            options.set_retry_policy(gax::retry_policy::NeverRetry);
2463            let query = move |name| {
2464                let stub = stub.clone();
2465                let options = options.clone();
2466                async {
2467                    let op = GetOperation::new(stub)
2468                        .set_name(name)
2469                        .with_options(options)
2470                        .send()
2471                        .await?;
2472                    Ok(Operation::new(op))
2473                }
2474            };
2475
2476            let start = move || async {
2477                let op = self.send().await?;
2478                Ok(Operation::new(op))
2479            };
2480
2481            lro::new_poller(polling_policy, polling_backoff_policy, start, query)
2482        }
2483
2484        /// Sets the value of [name][crate::model::DeletePolicyBasedRouteRequest::name].
2485        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2486            self.0.request.name = v.into();
2487            self
2488        }
2489
2490        /// Sets the value of [request_id][crate::model::DeletePolicyBasedRouteRequest::request_id].
2491        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2492            self.0.request.request_id = v.into();
2493            self
2494        }
2495    }
2496
2497    impl gax::options::RequestBuilder for DeletePolicyBasedRoute {
2498        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2499            &mut self.0.options
2500        }
2501    }
2502
2503    /// The request builder for a PolicyBasedRoutingService::list_locations call.
2504    #[derive(Clone, Debug)]
2505    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
2506
2507    impl ListLocations {
2508        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::PolicyBasedRoutingService>) -> Self {
2509            Self(RequestBuilder::new(stub))
2510        }
2511
2512        /// Sets the full request, replacing any prior values.
2513        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
2514            mut self,
2515            v: V,
2516        ) -> Self {
2517            self.0.request = v.into();
2518            self
2519        }
2520
2521        /// Sets all the options, replacing any prior values.
2522        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2523            self.0.options = v.into();
2524            self
2525        }
2526
2527        /// Sends the request.
2528        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
2529            (*self.0.stub)
2530                .list_locations(self.0.request, self.0.options)
2531                .await
2532        }
2533
2534        /// Streams the responses back.
2535        #[cfg(feature = "unstable-stream")]
2536        pub async fn stream(
2537            self,
2538        ) -> gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
2539        {
2540            let token = gax::paginator::extract_token(&self.0.request.page_token);
2541            let execute = move |token: String| {
2542                let mut builder = self.clone();
2543                builder.0.request = builder.0.request.set_page_token(token);
2544                builder.send()
2545            };
2546            gax::paginator::Paginator::new(token, execute)
2547        }
2548
2549        /// Sets the value of [name][location::model::ListLocationsRequest::name].
2550        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2551            self.0.request.name = v.into();
2552            self
2553        }
2554
2555        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
2556        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2557            self.0.request.filter = v.into();
2558            self
2559        }
2560
2561        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
2562        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2563            self.0.request.page_size = v.into();
2564            self
2565        }
2566
2567        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
2568        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2569            self.0.request.page_token = v.into();
2570            self
2571        }
2572    }
2573
2574    impl gax::options::RequestBuilder for ListLocations {
2575        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2576            &mut self.0.options
2577        }
2578    }
2579
2580    /// The request builder for a PolicyBasedRoutingService::get_location call.
2581    #[derive(Clone, Debug)]
2582    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
2583
2584    impl GetLocation {
2585        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::PolicyBasedRoutingService>) -> Self {
2586            Self(RequestBuilder::new(stub))
2587        }
2588
2589        /// Sets the full request, replacing any prior values.
2590        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
2591            self.0.request = v.into();
2592            self
2593        }
2594
2595        /// Sets all the options, replacing any prior values.
2596        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2597            self.0.options = v.into();
2598            self
2599        }
2600
2601        /// Sends the request.
2602        pub async fn send(self) -> Result<location::model::Location> {
2603            (*self.0.stub)
2604                .get_location(self.0.request, self.0.options)
2605                .await
2606        }
2607
2608        /// Sets the value of [name][location::model::GetLocationRequest::name].
2609        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2610            self.0.request.name = v.into();
2611            self
2612        }
2613    }
2614
2615    impl gax::options::RequestBuilder for GetLocation {
2616        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2617            &mut self.0.options
2618        }
2619    }
2620
2621    /// The request builder for a PolicyBasedRoutingService::set_iam_policy call.
2622    #[derive(Clone, Debug)]
2623    pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
2624
2625    impl SetIamPolicy {
2626        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::PolicyBasedRoutingService>) -> Self {
2627            Self(RequestBuilder::new(stub))
2628        }
2629
2630        /// Sets the full request, replacing any prior values.
2631        pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
2632            self.0.request = v.into();
2633            self
2634        }
2635
2636        /// Sets all the options, replacing any prior values.
2637        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2638            self.0.options = v.into();
2639            self
2640        }
2641
2642        /// Sends the request.
2643        pub async fn send(self) -> Result<iam_v1::model::Policy> {
2644            (*self.0.stub)
2645                .set_iam_policy(self.0.request, self.0.options)
2646                .await
2647        }
2648
2649        /// Sets the value of [resource][iam_v1::model::SetIamPolicyRequest::resource].
2650        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2651            self.0.request.resource = v.into();
2652            self
2653        }
2654
2655        /// Sets the value of [policy][iam_v1::model::SetIamPolicyRequest::policy].
2656        pub fn set_policy<T: Into<std::option::Option<iam_v1::model::Policy>>>(
2657            mut self,
2658            v: T,
2659        ) -> Self {
2660            self.0.request.policy = v.into();
2661            self
2662        }
2663
2664        /// Sets the value of [update_mask][iam_v1::model::SetIamPolicyRequest::update_mask].
2665        pub fn set_update_mask<T: Into<std::option::Option<wkt::FieldMask>>>(
2666            mut self,
2667            v: T,
2668        ) -> Self {
2669            self.0.request.update_mask = v.into();
2670            self
2671        }
2672    }
2673
2674    impl gax::options::RequestBuilder for SetIamPolicy {
2675        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2676            &mut self.0.options
2677        }
2678    }
2679
2680    /// The request builder for a PolicyBasedRoutingService::get_iam_policy call.
2681    #[derive(Clone, Debug)]
2682    pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
2683
2684    impl GetIamPolicy {
2685        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::PolicyBasedRoutingService>) -> Self {
2686            Self(RequestBuilder::new(stub))
2687        }
2688
2689        /// Sets the full request, replacing any prior values.
2690        pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
2691            self.0.request = v.into();
2692            self
2693        }
2694
2695        /// Sets all the options, replacing any prior values.
2696        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2697            self.0.options = v.into();
2698            self
2699        }
2700
2701        /// Sends the request.
2702        pub async fn send(self) -> Result<iam_v1::model::Policy> {
2703            (*self.0.stub)
2704                .get_iam_policy(self.0.request, self.0.options)
2705                .await
2706        }
2707
2708        /// Sets the value of [resource][iam_v1::model::GetIamPolicyRequest::resource].
2709        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2710            self.0.request.resource = v.into();
2711            self
2712        }
2713
2714        /// Sets the value of [options][iam_v1::model::GetIamPolicyRequest::options].
2715        pub fn set_options<T: Into<std::option::Option<iam_v1::model::GetPolicyOptions>>>(
2716            mut self,
2717            v: T,
2718        ) -> Self {
2719            self.0.request.options = v.into();
2720            self
2721        }
2722    }
2723
2724    impl gax::options::RequestBuilder for GetIamPolicy {
2725        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2726            &mut self.0.options
2727        }
2728    }
2729
2730    /// The request builder for a PolicyBasedRoutingService::test_iam_permissions call.
2731    #[derive(Clone, Debug)]
2732    pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
2733
2734    impl TestIamPermissions {
2735        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::PolicyBasedRoutingService>) -> Self {
2736            Self(RequestBuilder::new(stub))
2737        }
2738
2739        /// Sets the full request, replacing any prior values.
2740        pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
2741            mut self,
2742            v: V,
2743        ) -> Self {
2744            self.0.request = v.into();
2745            self
2746        }
2747
2748        /// Sets all the options, replacing any prior values.
2749        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2750            self.0.options = v.into();
2751            self
2752        }
2753
2754        /// Sends the request.
2755        pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
2756            (*self.0.stub)
2757                .test_iam_permissions(self.0.request, self.0.options)
2758                .await
2759        }
2760
2761        /// Sets the value of [resource][iam_v1::model::TestIamPermissionsRequest::resource].
2762        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2763            self.0.request.resource = v.into();
2764            self
2765        }
2766
2767        /// Sets the value of [permissions][iam_v1::model::TestIamPermissionsRequest::permissions].
2768        pub fn set_permissions<T, V>(mut self, v: T) -> Self
2769        where
2770            T: std::iter::IntoIterator<Item = V>,
2771            V: std::convert::Into<std::string::String>,
2772        {
2773            use std::iter::Iterator;
2774            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
2775            self
2776        }
2777    }
2778
2779    impl gax::options::RequestBuilder for TestIamPermissions {
2780        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2781            &mut self.0.options
2782        }
2783    }
2784
2785    /// The request builder for a PolicyBasedRoutingService::list_operations call.
2786    #[derive(Clone, Debug)]
2787    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
2788
2789    impl ListOperations {
2790        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::PolicyBasedRoutingService>) -> Self {
2791            Self(RequestBuilder::new(stub))
2792        }
2793
2794        /// Sets the full request, replacing any prior values.
2795        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
2796            mut self,
2797            v: V,
2798        ) -> Self {
2799            self.0.request = v.into();
2800            self
2801        }
2802
2803        /// Sets all the options, replacing any prior values.
2804        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2805            self.0.options = v.into();
2806            self
2807        }
2808
2809        /// Sends the request.
2810        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
2811            (*self.0.stub)
2812                .list_operations(self.0.request, self.0.options)
2813                .await
2814        }
2815
2816        /// Streams the responses back.
2817        #[cfg(feature = "unstable-stream")]
2818        pub async fn stream(
2819            self,
2820        ) -> gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
2821        {
2822            let token = gax::paginator::extract_token(&self.0.request.page_token);
2823            let execute = move |token: String| {
2824                let mut builder = self.clone();
2825                builder.0.request = builder.0.request.set_page_token(token);
2826                builder.send()
2827            };
2828            gax::paginator::Paginator::new(token, execute)
2829        }
2830
2831        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
2832        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2833            self.0.request.name = v.into();
2834            self
2835        }
2836
2837        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
2838        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2839            self.0.request.filter = v.into();
2840            self
2841        }
2842
2843        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
2844        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2845            self.0.request.page_size = v.into();
2846            self
2847        }
2848
2849        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
2850        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2851            self.0.request.page_token = v.into();
2852            self
2853        }
2854    }
2855
2856    impl gax::options::RequestBuilder for ListOperations {
2857        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2858            &mut self.0.options
2859        }
2860    }
2861
2862    /// The request builder for a PolicyBasedRoutingService::get_operation call.
2863    #[derive(Clone, Debug)]
2864    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
2865
2866    impl GetOperation {
2867        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::PolicyBasedRoutingService>) -> Self {
2868            Self(RequestBuilder::new(stub))
2869        }
2870
2871        /// Sets the full request, replacing any prior values.
2872        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
2873            mut self,
2874            v: V,
2875        ) -> Self {
2876            self.0.request = v.into();
2877            self
2878        }
2879
2880        /// Sets all the options, replacing any prior values.
2881        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2882            self.0.options = v.into();
2883            self
2884        }
2885
2886        /// Sends the request.
2887        pub async fn send(self) -> Result<longrunning::model::Operation> {
2888            (*self.0.stub)
2889                .get_operation(self.0.request, self.0.options)
2890                .await
2891        }
2892
2893        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
2894        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2895            self.0.request.name = v.into();
2896            self
2897        }
2898    }
2899
2900    impl gax::options::RequestBuilder for GetOperation {
2901        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2902            &mut self.0.options
2903        }
2904    }
2905
2906    /// The request builder for a PolicyBasedRoutingService::delete_operation call.
2907    #[derive(Clone, Debug)]
2908    pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
2909
2910    impl DeleteOperation {
2911        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::PolicyBasedRoutingService>) -> Self {
2912            Self(RequestBuilder::new(stub))
2913        }
2914
2915        /// Sets the full request, replacing any prior values.
2916        pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
2917            mut self,
2918            v: V,
2919        ) -> Self {
2920            self.0.request = v.into();
2921            self
2922        }
2923
2924        /// Sets all the options, replacing any prior values.
2925        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2926            self.0.options = v.into();
2927            self
2928        }
2929
2930        /// Sends the request.
2931        pub async fn send(self) -> Result<wkt::Empty> {
2932            (*self.0.stub)
2933                .delete_operation(self.0.request, self.0.options)
2934                .await
2935        }
2936
2937        /// Sets the value of [name][longrunning::model::DeleteOperationRequest::name].
2938        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2939            self.0.request.name = v.into();
2940            self
2941        }
2942    }
2943
2944    impl gax::options::RequestBuilder for DeleteOperation {
2945        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2946            &mut self.0.options
2947        }
2948    }
2949
2950    /// The request builder for a PolicyBasedRoutingService::cancel_operation call.
2951    #[derive(Clone, Debug)]
2952    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
2953
2954    impl CancelOperation {
2955        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::PolicyBasedRoutingService>) -> Self {
2956            Self(RequestBuilder::new(stub))
2957        }
2958
2959        /// Sets the full request, replacing any prior values.
2960        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
2961            mut self,
2962            v: V,
2963        ) -> Self {
2964            self.0.request = v.into();
2965            self
2966        }
2967
2968        /// Sets all the options, replacing any prior values.
2969        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2970            self.0.options = v.into();
2971            self
2972        }
2973
2974        /// Sends the request.
2975        pub async fn send(self) -> Result<wkt::Empty> {
2976            (*self.0.stub)
2977                .cancel_operation(self.0.request, self.0.options)
2978                .await
2979        }
2980
2981        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
2982        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2983            self.0.request.name = v.into();
2984            self
2985        }
2986    }
2987
2988    impl gax::options::RequestBuilder for CancelOperation {
2989        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2990            &mut self.0.options
2991        }
2992    }
2993}