Skip to main content

google_cloud_networkconnectivity_v1/
builder.rs

1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17pub mod cross_network_automation_service {
18    use crate::Result;
19
20    /// A builder for [CrossNetworkAutomationService][crate::client::CrossNetworkAutomationService].
21    ///
22    /// ```
23    /// # async fn sample() -> gax::client_builder::Result<()> {
24    /// # use google_cloud_networkconnectivity_v1::*;
25    /// # use builder::cross_network_automation_service::ClientBuilder;
26    /// # use client::CrossNetworkAutomationService;
27    /// let builder : ClientBuilder = CrossNetworkAutomationService::builder();
28    /// let client = builder
29    ///     .with_endpoint("https://networkconnectivity.googleapis.com")
30    ///     .build().await?;
31    /// # Ok(()) }
32    /// ```
33    pub type ClientBuilder =
34        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
35
36    pub(crate) mod client {
37        use super::super::super::client::CrossNetworkAutomationService;
38        pub struct Factory;
39        impl gax::client_builder::internal::ClientFactory for Factory {
40            type Client = CrossNetworkAutomationService;
41            type Credentials = gaxi::options::Credentials;
42            async fn build(
43                self,
44                config: gaxi::options::ClientConfig,
45            ) -> gax::client_builder::Result<Self::Client> {
46                Self::Client::new(config).await
47            }
48        }
49    }
50
51    /// Common implementation for [crate::client::CrossNetworkAutomationService] request builders.
52    #[derive(Clone, Debug)]
53    pub(crate) struct RequestBuilder<R: std::default::Default> {
54        stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
55        request: R,
56        options: gax::options::RequestOptions,
57    }
58
59    impl<R> RequestBuilder<R>
60    where
61        R: std::default::Default,
62    {
63        pub(crate) fn new(
64            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
65        ) -> Self {
66            Self {
67                stub,
68                request: R::default(),
69                options: gax::options::RequestOptions::default(),
70            }
71        }
72    }
73
74    /// The request builder for [CrossNetworkAutomationService::list_service_connection_maps][crate::client::CrossNetworkAutomationService::list_service_connection_maps] calls.
75    ///
76    /// # Example
77    /// ```
78    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::ListServiceConnectionMaps;
79    /// # async fn sample() -> gax::Result<()> {
80    /// use gax::paginator::ItemPaginator;
81    ///
82    /// let builder = prepare_request_builder();
83    /// let mut items = builder.by_item();
84    /// while let Some(result) = items.next().await {
85    ///   let item = result?;
86    /// }
87    /// # Ok(()) }
88    ///
89    /// fn prepare_request_builder() -> ListServiceConnectionMaps {
90    ///   # panic!();
91    ///   // ... details omitted ...
92    /// }
93    /// ```
94    #[derive(Clone, Debug)]
95    pub struct ListServiceConnectionMaps(
96        RequestBuilder<crate::model::ListServiceConnectionMapsRequest>,
97    );
98
99    impl ListServiceConnectionMaps {
100        pub(crate) fn new(
101            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
102        ) -> Self {
103            Self(RequestBuilder::new(stub))
104        }
105
106        /// Sets the full request, replacing any prior values.
107        pub fn with_request<V: Into<crate::model::ListServiceConnectionMapsRequest>>(
108            mut self,
109            v: V,
110        ) -> Self {
111            self.0.request = v.into();
112            self
113        }
114
115        /// Sets all the options, replacing any prior values.
116        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
117            self.0.options = v.into();
118            self
119        }
120
121        /// Sends the request.
122        pub async fn send(self) -> Result<crate::model::ListServiceConnectionMapsResponse> {
123            (*self.0.stub)
124                .list_service_connection_maps(self.0.request, self.0.options)
125                .await
126                .map(gax::response::Response::into_body)
127        }
128
129        /// Streams each page in the collection.
130        pub fn by_page(
131            self,
132        ) -> impl gax::paginator::Paginator<
133            crate::model::ListServiceConnectionMapsResponse,
134            gax::error::Error,
135        > {
136            use std::clone::Clone;
137            let token = self.0.request.page_token.clone();
138            let execute = move |token: String| {
139                let mut builder = self.clone();
140                builder.0.request = builder.0.request.set_page_token(token);
141                builder.send()
142            };
143            gax::paginator::internal::new_paginator(token, execute)
144        }
145
146        /// Streams each item in the collection.
147        pub fn by_item(
148            self,
149        ) -> impl gax::paginator::ItemPaginator<
150            crate::model::ListServiceConnectionMapsResponse,
151            gax::error::Error,
152        > {
153            use gax::paginator::Paginator;
154            self.by_page().items()
155        }
156
157        /// Sets the value of [parent][crate::model::ListServiceConnectionMapsRequest::parent].
158        ///
159        /// This is a **required** field for requests.
160        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
161            self.0.request.parent = v.into();
162            self
163        }
164
165        /// Sets the value of [page_size][crate::model::ListServiceConnectionMapsRequest::page_size].
166        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
167            self.0.request.page_size = v.into();
168            self
169        }
170
171        /// Sets the value of [page_token][crate::model::ListServiceConnectionMapsRequest::page_token].
172        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
173            self.0.request.page_token = v.into();
174            self
175        }
176
177        /// Sets the value of [filter][crate::model::ListServiceConnectionMapsRequest::filter].
178        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
179            self.0.request.filter = v.into();
180            self
181        }
182
183        /// Sets the value of [order_by][crate::model::ListServiceConnectionMapsRequest::order_by].
184        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
185            self.0.request.order_by = v.into();
186            self
187        }
188    }
189
190    #[doc(hidden)]
191    impl gax::options::internal::RequestBuilder for ListServiceConnectionMaps {
192        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
193            &mut self.0.options
194        }
195    }
196
197    /// The request builder for [CrossNetworkAutomationService::get_service_connection_map][crate::client::CrossNetworkAutomationService::get_service_connection_map] calls.
198    ///
199    /// # Example
200    /// ```
201    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::GetServiceConnectionMap;
202    /// # async fn sample() -> gax::Result<()> {
203    ///
204    /// let builder = prepare_request_builder();
205    /// let response = builder.send().await?;
206    /// # Ok(()) }
207    ///
208    /// fn prepare_request_builder() -> GetServiceConnectionMap {
209    ///   # panic!();
210    ///   // ... details omitted ...
211    /// }
212    /// ```
213    #[derive(Clone, Debug)]
214    pub struct GetServiceConnectionMap(
215        RequestBuilder<crate::model::GetServiceConnectionMapRequest>,
216    );
217
218    impl GetServiceConnectionMap {
219        pub(crate) fn new(
220            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
221        ) -> Self {
222            Self(RequestBuilder::new(stub))
223        }
224
225        /// Sets the full request, replacing any prior values.
226        pub fn with_request<V: Into<crate::model::GetServiceConnectionMapRequest>>(
227            mut self,
228            v: V,
229        ) -> Self {
230            self.0.request = v.into();
231            self
232        }
233
234        /// Sets all the options, replacing any prior values.
235        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
236            self.0.options = v.into();
237            self
238        }
239
240        /// Sends the request.
241        pub async fn send(self) -> Result<crate::model::ServiceConnectionMap> {
242            (*self.0.stub)
243                .get_service_connection_map(self.0.request, self.0.options)
244                .await
245                .map(gax::response::Response::into_body)
246        }
247
248        /// Sets the value of [name][crate::model::GetServiceConnectionMapRequest::name].
249        ///
250        /// This is a **required** field for requests.
251        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
252            self.0.request.name = v.into();
253            self
254        }
255    }
256
257    #[doc(hidden)]
258    impl gax::options::internal::RequestBuilder for GetServiceConnectionMap {
259        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
260            &mut self.0.options
261        }
262    }
263
264    /// The request builder for [CrossNetworkAutomationService::create_service_connection_map][crate::client::CrossNetworkAutomationService::create_service_connection_map] calls.
265    ///
266    /// # Example
267    /// ```
268    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::CreateServiceConnectionMap;
269    /// # async fn sample() -> gax::Result<()> {
270    /// use lro::Poller;
271    ///
272    /// let builder = prepare_request_builder();
273    /// let response = builder.poller().until_done().await?;
274    /// # Ok(()) }
275    ///
276    /// fn prepare_request_builder() -> CreateServiceConnectionMap {
277    ///   # panic!();
278    ///   // ... details omitted ...
279    /// }
280    /// ```
281    #[derive(Clone, Debug)]
282    pub struct CreateServiceConnectionMap(
283        RequestBuilder<crate::model::CreateServiceConnectionMapRequest>,
284    );
285
286    impl CreateServiceConnectionMap {
287        pub(crate) fn new(
288            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
289        ) -> Self {
290            Self(RequestBuilder::new(stub))
291        }
292
293        /// Sets the full request, replacing any prior values.
294        pub fn with_request<V: Into<crate::model::CreateServiceConnectionMapRequest>>(
295            mut self,
296            v: V,
297        ) -> Self {
298            self.0.request = v.into();
299            self
300        }
301
302        /// Sets all the options, replacing any prior values.
303        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
304            self.0.options = v.into();
305            self
306        }
307
308        /// Sends the request.
309        ///
310        /// # Long running operations
311        ///
312        /// This starts, but does not poll, a longrunning operation. More information
313        /// on [create_service_connection_map][crate::client::CrossNetworkAutomationService::create_service_connection_map].
314        pub async fn send(self) -> Result<longrunning::model::Operation> {
315            (*self.0.stub)
316                .create_service_connection_map(self.0.request, self.0.options)
317                .await
318                .map(gax::response::Response::into_body)
319        }
320
321        /// Creates a [Poller][lro::Poller] to work with `create_service_connection_map`.
322        pub fn poller(
323            self,
324        ) -> impl lro::Poller<crate::model::ServiceConnectionMap, crate::model::OperationMetadata>
325        {
326            type Operation = lro::internal::Operation<
327                crate::model::ServiceConnectionMap,
328                crate::model::OperationMetadata,
329            >;
330            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
331            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
332
333            let stub = self.0.stub.clone();
334            let mut options = self.0.options.clone();
335            options.set_retry_policy(gax::retry_policy::NeverRetry);
336            let query = move |name| {
337                let stub = stub.clone();
338                let options = options.clone();
339                async {
340                    let op = GetOperation::new(stub)
341                        .set_name(name)
342                        .with_options(options)
343                        .send()
344                        .await?;
345                    Ok(Operation::new(op))
346                }
347            };
348
349            let start = move || async {
350                let op = self.send().await?;
351                Ok(Operation::new(op))
352            };
353
354            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
355        }
356
357        /// Sets the value of [parent][crate::model::CreateServiceConnectionMapRequest::parent].
358        ///
359        /// This is a **required** field for requests.
360        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
361            self.0.request.parent = v.into();
362            self
363        }
364
365        /// Sets the value of [service_connection_map_id][crate::model::CreateServiceConnectionMapRequest::service_connection_map_id].
366        pub fn set_service_connection_map_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
367            self.0.request.service_connection_map_id = v.into();
368            self
369        }
370
371        /// Sets the value of [service_connection_map][crate::model::CreateServiceConnectionMapRequest::service_connection_map].
372        ///
373        /// This is a **required** field for requests.
374        pub fn set_service_connection_map<T>(mut self, v: T) -> Self
375        where
376            T: std::convert::Into<crate::model::ServiceConnectionMap>,
377        {
378            self.0.request.service_connection_map = std::option::Option::Some(v.into());
379            self
380        }
381
382        /// Sets or clears the value of [service_connection_map][crate::model::CreateServiceConnectionMapRequest::service_connection_map].
383        ///
384        /// This is a **required** field for requests.
385        pub fn set_or_clear_service_connection_map<T>(mut self, v: std::option::Option<T>) -> Self
386        where
387            T: std::convert::Into<crate::model::ServiceConnectionMap>,
388        {
389            self.0.request.service_connection_map = v.map(|x| x.into());
390            self
391        }
392
393        /// Sets the value of [request_id][crate::model::CreateServiceConnectionMapRequest::request_id].
394        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
395            self.0.request.request_id = v.into();
396            self
397        }
398    }
399
400    #[doc(hidden)]
401    impl gax::options::internal::RequestBuilder for CreateServiceConnectionMap {
402        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
403            &mut self.0.options
404        }
405    }
406
407    /// The request builder for [CrossNetworkAutomationService::update_service_connection_map][crate::client::CrossNetworkAutomationService::update_service_connection_map] calls.
408    ///
409    /// # Example
410    /// ```
411    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::UpdateServiceConnectionMap;
412    /// # async fn sample() -> gax::Result<()> {
413    /// use lro::Poller;
414    ///
415    /// let builder = prepare_request_builder();
416    /// let response = builder.poller().until_done().await?;
417    /// # Ok(()) }
418    ///
419    /// fn prepare_request_builder() -> UpdateServiceConnectionMap {
420    ///   # panic!();
421    ///   // ... details omitted ...
422    /// }
423    /// ```
424    #[derive(Clone, Debug)]
425    pub struct UpdateServiceConnectionMap(
426        RequestBuilder<crate::model::UpdateServiceConnectionMapRequest>,
427    );
428
429    impl UpdateServiceConnectionMap {
430        pub(crate) fn new(
431            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
432        ) -> Self {
433            Self(RequestBuilder::new(stub))
434        }
435
436        /// Sets the full request, replacing any prior values.
437        pub fn with_request<V: Into<crate::model::UpdateServiceConnectionMapRequest>>(
438            mut self,
439            v: V,
440        ) -> Self {
441            self.0.request = v.into();
442            self
443        }
444
445        /// Sets all the options, replacing any prior values.
446        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
447            self.0.options = v.into();
448            self
449        }
450
451        /// Sends the request.
452        ///
453        /// # Long running operations
454        ///
455        /// This starts, but does not poll, a longrunning operation. More information
456        /// on [update_service_connection_map][crate::client::CrossNetworkAutomationService::update_service_connection_map].
457        pub async fn send(self) -> Result<longrunning::model::Operation> {
458            (*self.0.stub)
459                .update_service_connection_map(self.0.request, self.0.options)
460                .await
461                .map(gax::response::Response::into_body)
462        }
463
464        /// Creates a [Poller][lro::Poller] to work with `update_service_connection_map`.
465        pub fn poller(
466            self,
467        ) -> impl lro::Poller<crate::model::ServiceConnectionMap, crate::model::OperationMetadata>
468        {
469            type Operation = lro::internal::Operation<
470                crate::model::ServiceConnectionMap,
471                crate::model::OperationMetadata,
472            >;
473            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
474            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
475
476            let stub = self.0.stub.clone();
477            let mut options = self.0.options.clone();
478            options.set_retry_policy(gax::retry_policy::NeverRetry);
479            let query = move |name| {
480                let stub = stub.clone();
481                let options = options.clone();
482                async {
483                    let op = GetOperation::new(stub)
484                        .set_name(name)
485                        .with_options(options)
486                        .send()
487                        .await?;
488                    Ok(Operation::new(op))
489                }
490            };
491
492            let start = move || async {
493                let op = self.send().await?;
494                Ok(Operation::new(op))
495            };
496
497            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
498        }
499
500        /// Sets the value of [update_mask][crate::model::UpdateServiceConnectionMapRequest::update_mask].
501        pub fn set_update_mask<T>(mut self, v: T) -> Self
502        where
503            T: std::convert::Into<wkt::FieldMask>,
504        {
505            self.0.request.update_mask = std::option::Option::Some(v.into());
506            self
507        }
508
509        /// Sets or clears the value of [update_mask][crate::model::UpdateServiceConnectionMapRequest::update_mask].
510        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
511        where
512            T: std::convert::Into<wkt::FieldMask>,
513        {
514            self.0.request.update_mask = v.map(|x| x.into());
515            self
516        }
517
518        /// Sets the value of [service_connection_map][crate::model::UpdateServiceConnectionMapRequest::service_connection_map].
519        ///
520        /// This is a **required** field for requests.
521        pub fn set_service_connection_map<T>(mut self, v: T) -> Self
522        where
523            T: std::convert::Into<crate::model::ServiceConnectionMap>,
524        {
525            self.0.request.service_connection_map = std::option::Option::Some(v.into());
526            self
527        }
528
529        /// Sets or clears the value of [service_connection_map][crate::model::UpdateServiceConnectionMapRequest::service_connection_map].
530        ///
531        /// This is a **required** field for requests.
532        pub fn set_or_clear_service_connection_map<T>(mut self, v: std::option::Option<T>) -> Self
533        where
534            T: std::convert::Into<crate::model::ServiceConnectionMap>,
535        {
536            self.0.request.service_connection_map = v.map(|x| x.into());
537            self
538        }
539
540        /// Sets the value of [request_id][crate::model::UpdateServiceConnectionMapRequest::request_id].
541        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
542            self.0.request.request_id = v.into();
543            self
544        }
545    }
546
547    #[doc(hidden)]
548    impl gax::options::internal::RequestBuilder for UpdateServiceConnectionMap {
549        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
550            &mut self.0.options
551        }
552    }
553
554    /// The request builder for [CrossNetworkAutomationService::delete_service_connection_map][crate::client::CrossNetworkAutomationService::delete_service_connection_map] calls.
555    ///
556    /// # Example
557    /// ```
558    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::DeleteServiceConnectionMap;
559    /// # async fn sample() -> gax::Result<()> {
560    /// use lro::Poller;
561    ///
562    /// let builder = prepare_request_builder();
563    /// let response = builder.poller().until_done().await?;
564    /// # Ok(()) }
565    ///
566    /// fn prepare_request_builder() -> DeleteServiceConnectionMap {
567    ///   # panic!();
568    ///   // ... details omitted ...
569    /// }
570    /// ```
571    #[derive(Clone, Debug)]
572    pub struct DeleteServiceConnectionMap(
573        RequestBuilder<crate::model::DeleteServiceConnectionMapRequest>,
574    );
575
576    impl DeleteServiceConnectionMap {
577        pub(crate) fn new(
578            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
579        ) -> Self {
580            Self(RequestBuilder::new(stub))
581        }
582
583        /// Sets the full request, replacing any prior values.
584        pub fn with_request<V: Into<crate::model::DeleteServiceConnectionMapRequest>>(
585            mut self,
586            v: V,
587        ) -> Self {
588            self.0.request = v.into();
589            self
590        }
591
592        /// Sets all the options, replacing any prior values.
593        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
594            self.0.options = v.into();
595            self
596        }
597
598        /// Sends the request.
599        ///
600        /// # Long running operations
601        ///
602        /// This starts, but does not poll, a longrunning operation. More information
603        /// on [delete_service_connection_map][crate::client::CrossNetworkAutomationService::delete_service_connection_map].
604        pub async fn send(self) -> Result<longrunning::model::Operation> {
605            (*self.0.stub)
606                .delete_service_connection_map(self.0.request, self.0.options)
607                .await
608                .map(gax::response::Response::into_body)
609        }
610
611        /// Creates a [Poller][lro::Poller] to work with `delete_service_connection_map`.
612        pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
613            type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
614            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
615            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
616
617            let stub = self.0.stub.clone();
618            let mut options = self.0.options.clone();
619            options.set_retry_policy(gax::retry_policy::NeverRetry);
620            let query = move |name| {
621                let stub = stub.clone();
622                let options = options.clone();
623                async {
624                    let op = GetOperation::new(stub)
625                        .set_name(name)
626                        .with_options(options)
627                        .send()
628                        .await?;
629                    Ok(Operation::new(op))
630                }
631            };
632
633            let start = move || async {
634                let op = self.send().await?;
635                Ok(Operation::new(op))
636            };
637
638            lro::internal::new_unit_response_poller(
639                polling_error_policy,
640                polling_backoff_policy,
641                start,
642                query,
643            )
644        }
645
646        /// Sets the value of [name][crate::model::DeleteServiceConnectionMapRequest::name].
647        ///
648        /// This is a **required** field for requests.
649        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
650            self.0.request.name = v.into();
651            self
652        }
653
654        /// Sets the value of [request_id][crate::model::DeleteServiceConnectionMapRequest::request_id].
655        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
656            self.0.request.request_id = v.into();
657            self
658        }
659
660        /// Sets the value of [etag][crate::model::DeleteServiceConnectionMapRequest::etag].
661        pub fn set_etag<T>(mut self, v: T) -> Self
662        where
663            T: std::convert::Into<std::string::String>,
664        {
665            self.0.request.etag = std::option::Option::Some(v.into());
666            self
667        }
668
669        /// Sets or clears the value of [etag][crate::model::DeleteServiceConnectionMapRequest::etag].
670        pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
671        where
672            T: std::convert::Into<std::string::String>,
673        {
674            self.0.request.etag = v.map(|x| x.into());
675            self
676        }
677    }
678
679    #[doc(hidden)]
680    impl gax::options::internal::RequestBuilder for DeleteServiceConnectionMap {
681        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
682            &mut self.0.options
683        }
684    }
685
686    /// The request builder for [CrossNetworkAutomationService::list_service_connection_policies][crate::client::CrossNetworkAutomationService::list_service_connection_policies] calls.
687    ///
688    /// # Example
689    /// ```
690    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::ListServiceConnectionPolicies;
691    /// # async fn sample() -> gax::Result<()> {
692    /// use gax::paginator::ItemPaginator;
693    ///
694    /// let builder = prepare_request_builder();
695    /// let mut items = builder.by_item();
696    /// while let Some(result) = items.next().await {
697    ///   let item = result?;
698    /// }
699    /// # Ok(()) }
700    ///
701    /// fn prepare_request_builder() -> ListServiceConnectionPolicies {
702    ///   # panic!();
703    ///   // ... details omitted ...
704    /// }
705    /// ```
706    #[derive(Clone, Debug)]
707    pub struct ListServiceConnectionPolicies(
708        RequestBuilder<crate::model::ListServiceConnectionPoliciesRequest>,
709    );
710
711    impl ListServiceConnectionPolicies {
712        pub(crate) fn new(
713            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
714        ) -> Self {
715            Self(RequestBuilder::new(stub))
716        }
717
718        /// Sets the full request, replacing any prior values.
719        pub fn with_request<V: Into<crate::model::ListServiceConnectionPoliciesRequest>>(
720            mut self,
721            v: V,
722        ) -> Self {
723            self.0.request = v.into();
724            self
725        }
726
727        /// Sets all the options, replacing any prior values.
728        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
729            self.0.options = v.into();
730            self
731        }
732
733        /// Sends the request.
734        pub async fn send(self) -> Result<crate::model::ListServiceConnectionPoliciesResponse> {
735            (*self.0.stub)
736                .list_service_connection_policies(self.0.request, self.0.options)
737                .await
738                .map(gax::response::Response::into_body)
739        }
740
741        /// Streams each page in the collection.
742        pub fn by_page(
743            self,
744        ) -> impl gax::paginator::Paginator<
745            crate::model::ListServiceConnectionPoliciesResponse,
746            gax::error::Error,
747        > {
748            use std::clone::Clone;
749            let token = self.0.request.page_token.clone();
750            let execute = move |token: String| {
751                let mut builder = self.clone();
752                builder.0.request = builder.0.request.set_page_token(token);
753                builder.send()
754            };
755            gax::paginator::internal::new_paginator(token, execute)
756        }
757
758        /// Streams each item in the collection.
759        pub fn by_item(
760            self,
761        ) -> impl gax::paginator::ItemPaginator<
762            crate::model::ListServiceConnectionPoliciesResponse,
763            gax::error::Error,
764        > {
765            use gax::paginator::Paginator;
766            self.by_page().items()
767        }
768
769        /// Sets the value of [parent][crate::model::ListServiceConnectionPoliciesRequest::parent].
770        ///
771        /// This is a **required** field for requests.
772        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
773            self.0.request.parent = v.into();
774            self
775        }
776
777        /// Sets the value of [page_size][crate::model::ListServiceConnectionPoliciesRequest::page_size].
778        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
779            self.0.request.page_size = v.into();
780            self
781        }
782
783        /// Sets the value of [page_token][crate::model::ListServiceConnectionPoliciesRequest::page_token].
784        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
785            self.0.request.page_token = v.into();
786            self
787        }
788
789        /// Sets the value of [filter][crate::model::ListServiceConnectionPoliciesRequest::filter].
790        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
791            self.0.request.filter = v.into();
792            self
793        }
794
795        /// Sets the value of [order_by][crate::model::ListServiceConnectionPoliciesRequest::order_by].
796        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
797            self.0.request.order_by = v.into();
798            self
799        }
800    }
801
802    #[doc(hidden)]
803    impl gax::options::internal::RequestBuilder for ListServiceConnectionPolicies {
804        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
805            &mut self.0.options
806        }
807    }
808
809    /// The request builder for [CrossNetworkAutomationService::get_service_connection_policy][crate::client::CrossNetworkAutomationService::get_service_connection_policy] calls.
810    ///
811    /// # Example
812    /// ```
813    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::GetServiceConnectionPolicy;
814    /// # async fn sample() -> gax::Result<()> {
815    ///
816    /// let builder = prepare_request_builder();
817    /// let response = builder.send().await?;
818    /// # Ok(()) }
819    ///
820    /// fn prepare_request_builder() -> GetServiceConnectionPolicy {
821    ///   # panic!();
822    ///   // ... details omitted ...
823    /// }
824    /// ```
825    #[derive(Clone, Debug)]
826    pub struct GetServiceConnectionPolicy(
827        RequestBuilder<crate::model::GetServiceConnectionPolicyRequest>,
828    );
829
830    impl GetServiceConnectionPolicy {
831        pub(crate) fn new(
832            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
833        ) -> Self {
834            Self(RequestBuilder::new(stub))
835        }
836
837        /// Sets the full request, replacing any prior values.
838        pub fn with_request<V: Into<crate::model::GetServiceConnectionPolicyRequest>>(
839            mut self,
840            v: V,
841        ) -> Self {
842            self.0.request = v.into();
843            self
844        }
845
846        /// Sets all the options, replacing any prior values.
847        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
848            self.0.options = v.into();
849            self
850        }
851
852        /// Sends the request.
853        pub async fn send(self) -> Result<crate::model::ServiceConnectionPolicy> {
854            (*self.0.stub)
855                .get_service_connection_policy(self.0.request, self.0.options)
856                .await
857                .map(gax::response::Response::into_body)
858        }
859
860        /// Sets the value of [name][crate::model::GetServiceConnectionPolicyRequest::name].
861        ///
862        /// This is a **required** field for requests.
863        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
864            self.0.request.name = v.into();
865            self
866        }
867    }
868
869    #[doc(hidden)]
870    impl gax::options::internal::RequestBuilder for GetServiceConnectionPolicy {
871        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
872            &mut self.0.options
873        }
874    }
875
876    /// The request builder for [CrossNetworkAutomationService::create_service_connection_policy][crate::client::CrossNetworkAutomationService::create_service_connection_policy] calls.
877    ///
878    /// # Example
879    /// ```
880    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::CreateServiceConnectionPolicy;
881    /// # async fn sample() -> gax::Result<()> {
882    /// use lro::Poller;
883    ///
884    /// let builder = prepare_request_builder();
885    /// let response = builder.poller().until_done().await?;
886    /// # Ok(()) }
887    ///
888    /// fn prepare_request_builder() -> CreateServiceConnectionPolicy {
889    ///   # panic!();
890    ///   // ... details omitted ...
891    /// }
892    /// ```
893    #[derive(Clone, Debug)]
894    pub struct CreateServiceConnectionPolicy(
895        RequestBuilder<crate::model::CreateServiceConnectionPolicyRequest>,
896    );
897
898    impl CreateServiceConnectionPolicy {
899        pub(crate) fn new(
900            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
901        ) -> Self {
902            Self(RequestBuilder::new(stub))
903        }
904
905        /// Sets the full request, replacing any prior values.
906        pub fn with_request<V: Into<crate::model::CreateServiceConnectionPolicyRequest>>(
907            mut self,
908            v: V,
909        ) -> Self {
910            self.0.request = v.into();
911            self
912        }
913
914        /// Sets all the options, replacing any prior values.
915        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
916            self.0.options = v.into();
917            self
918        }
919
920        /// Sends the request.
921        ///
922        /// # Long running operations
923        ///
924        /// This starts, but does not poll, a longrunning operation. More information
925        /// on [create_service_connection_policy][crate::client::CrossNetworkAutomationService::create_service_connection_policy].
926        pub async fn send(self) -> Result<longrunning::model::Operation> {
927            (*self.0.stub)
928                .create_service_connection_policy(self.0.request, self.0.options)
929                .await
930                .map(gax::response::Response::into_body)
931        }
932
933        /// Creates a [Poller][lro::Poller] to work with `create_service_connection_policy`.
934        pub fn poller(
935            self,
936        ) -> impl lro::Poller<crate::model::ServiceConnectionPolicy, crate::model::OperationMetadata>
937        {
938            type Operation = lro::internal::Operation<
939                crate::model::ServiceConnectionPolicy,
940                crate::model::OperationMetadata,
941            >;
942            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
943            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
944
945            let stub = self.0.stub.clone();
946            let mut options = self.0.options.clone();
947            options.set_retry_policy(gax::retry_policy::NeverRetry);
948            let query = move |name| {
949                let stub = stub.clone();
950                let options = options.clone();
951                async {
952                    let op = GetOperation::new(stub)
953                        .set_name(name)
954                        .with_options(options)
955                        .send()
956                        .await?;
957                    Ok(Operation::new(op))
958                }
959            };
960
961            let start = move || async {
962                let op = self.send().await?;
963                Ok(Operation::new(op))
964            };
965
966            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
967        }
968
969        /// Sets the value of [parent][crate::model::CreateServiceConnectionPolicyRequest::parent].
970        ///
971        /// This is a **required** field for requests.
972        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
973            self.0.request.parent = v.into();
974            self
975        }
976
977        /// Sets the value of [service_connection_policy_id][crate::model::CreateServiceConnectionPolicyRequest::service_connection_policy_id].
978        pub fn set_service_connection_policy_id<T: Into<std::string::String>>(
979            mut self,
980            v: T,
981        ) -> Self {
982            self.0.request.service_connection_policy_id = v.into();
983            self
984        }
985
986        /// Sets the value of [service_connection_policy][crate::model::CreateServiceConnectionPolicyRequest::service_connection_policy].
987        ///
988        /// This is a **required** field for requests.
989        pub fn set_service_connection_policy<T>(mut self, v: T) -> Self
990        where
991            T: std::convert::Into<crate::model::ServiceConnectionPolicy>,
992        {
993            self.0.request.service_connection_policy = std::option::Option::Some(v.into());
994            self
995        }
996
997        /// Sets or clears the value of [service_connection_policy][crate::model::CreateServiceConnectionPolicyRequest::service_connection_policy].
998        ///
999        /// This is a **required** field for requests.
1000        pub fn set_or_clear_service_connection_policy<T>(
1001            mut self,
1002            v: std::option::Option<T>,
1003        ) -> Self
1004        where
1005            T: std::convert::Into<crate::model::ServiceConnectionPolicy>,
1006        {
1007            self.0.request.service_connection_policy = v.map(|x| x.into());
1008            self
1009        }
1010
1011        /// Sets the value of [request_id][crate::model::CreateServiceConnectionPolicyRequest::request_id].
1012        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1013            self.0.request.request_id = v.into();
1014            self
1015        }
1016    }
1017
1018    #[doc(hidden)]
1019    impl gax::options::internal::RequestBuilder for CreateServiceConnectionPolicy {
1020        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1021            &mut self.0.options
1022        }
1023    }
1024
1025    /// The request builder for [CrossNetworkAutomationService::update_service_connection_policy][crate::client::CrossNetworkAutomationService::update_service_connection_policy] calls.
1026    ///
1027    /// # Example
1028    /// ```
1029    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::UpdateServiceConnectionPolicy;
1030    /// # async fn sample() -> gax::Result<()> {
1031    /// use lro::Poller;
1032    ///
1033    /// let builder = prepare_request_builder();
1034    /// let response = builder.poller().until_done().await?;
1035    /// # Ok(()) }
1036    ///
1037    /// fn prepare_request_builder() -> UpdateServiceConnectionPolicy {
1038    ///   # panic!();
1039    ///   // ... details omitted ...
1040    /// }
1041    /// ```
1042    #[derive(Clone, Debug)]
1043    pub struct UpdateServiceConnectionPolicy(
1044        RequestBuilder<crate::model::UpdateServiceConnectionPolicyRequest>,
1045    );
1046
1047    impl UpdateServiceConnectionPolicy {
1048        pub(crate) fn new(
1049            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1050        ) -> Self {
1051            Self(RequestBuilder::new(stub))
1052        }
1053
1054        /// Sets the full request, replacing any prior values.
1055        pub fn with_request<V: Into<crate::model::UpdateServiceConnectionPolicyRequest>>(
1056            mut self,
1057            v: V,
1058        ) -> Self {
1059            self.0.request = v.into();
1060            self
1061        }
1062
1063        /// Sets all the options, replacing any prior values.
1064        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1065            self.0.options = v.into();
1066            self
1067        }
1068
1069        /// Sends the request.
1070        ///
1071        /// # Long running operations
1072        ///
1073        /// This starts, but does not poll, a longrunning operation. More information
1074        /// on [update_service_connection_policy][crate::client::CrossNetworkAutomationService::update_service_connection_policy].
1075        pub async fn send(self) -> Result<longrunning::model::Operation> {
1076            (*self.0.stub)
1077                .update_service_connection_policy(self.0.request, self.0.options)
1078                .await
1079                .map(gax::response::Response::into_body)
1080        }
1081
1082        /// Creates a [Poller][lro::Poller] to work with `update_service_connection_policy`.
1083        pub fn poller(
1084            self,
1085        ) -> impl lro::Poller<crate::model::ServiceConnectionPolicy, crate::model::OperationMetadata>
1086        {
1087            type Operation = lro::internal::Operation<
1088                crate::model::ServiceConnectionPolicy,
1089                crate::model::OperationMetadata,
1090            >;
1091            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1092            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1093
1094            let stub = self.0.stub.clone();
1095            let mut options = self.0.options.clone();
1096            options.set_retry_policy(gax::retry_policy::NeverRetry);
1097            let query = move |name| {
1098                let stub = stub.clone();
1099                let options = options.clone();
1100                async {
1101                    let op = GetOperation::new(stub)
1102                        .set_name(name)
1103                        .with_options(options)
1104                        .send()
1105                        .await?;
1106                    Ok(Operation::new(op))
1107                }
1108            };
1109
1110            let start = move || async {
1111                let op = self.send().await?;
1112                Ok(Operation::new(op))
1113            };
1114
1115            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1116        }
1117
1118        /// Sets the value of [update_mask][crate::model::UpdateServiceConnectionPolicyRequest::update_mask].
1119        pub fn set_update_mask<T>(mut self, v: T) -> Self
1120        where
1121            T: std::convert::Into<wkt::FieldMask>,
1122        {
1123            self.0.request.update_mask = std::option::Option::Some(v.into());
1124            self
1125        }
1126
1127        /// Sets or clears the value of [update_mask][crate::model::UpdateServiceConnectionPolicyRequest::update_mask].
1128        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1129        where
1130            T: std::convert::Into<wkt::FieldMask>,
1131        {
1132            self.0.request.update_mask = v.map(|x| x.into());
1133            self
1134        }
1135
1136        /// Sets the value of [service_connection_policy][crate::model::UpdateServiceConnectionPolicyRequest::service_connection_policy].
1137        ///
1138        /// This is a **required** field for requests.
1139        pub fn set_service_connection_policy<T>(mut self, v: T) -> Self
1140        where
1141            T: std::convert::Into<crate::model::ServiceConnectionPolicy>,
1142        {
1143            self.0.request.service_connection_policy = std::option::Option::Some(v.into());
1144            self
1145        }
1146
1147        /// Sets or clears the value of [service_connection_policy][crate::model::UpdateServiceConnectionPolicyRequest::service_connection_policy].
1148        ///
1149        /// This is a **required** field for requests.
1150        pub fn set_or_clear_service_connection_policy<T>(
1151            mut self,
1152            v: std::option::Option<T>,
1153        ) -> Self
1154        where
1155            T: std::convert::Into<crate::model::ServiceConnectionPolicy>,
1156        {
1157            self.0.request.service_connection_policy = v.map(|x| x.into());
1158            self
1159        }
1160
1161        /// Sets the value of [request_id][crate::model::UpdateServiceConnectionPolicyRequest::request_id].
1162        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1163            self.0.request.request_id = v.into();
1164            self
1165        }
1166    }
1167
1168    #[doc(hidden)]
1169    impl gax::options::internal::RequestBuilder for UpdateServiceConnectionPolicy {
1170        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1171            &mut self.0.options
1172        }
1173    }
1174
1175    /// The request builder for [CrossNetworkAutomationService::delete_service_connection_policy][crate::client::CrossNetworkAutomationService::delete_service_connection_policy] calls.
1176    ///
1177    /// # Example
1178    /// ```
1179    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::DeleteServiceConnectionPolicy;
1180    /// # async fn sample() -> gax::Result<()> {
1181    /// use lro::Poller;
1182    ///
1183    /// let builder = prepare_request_builder();
1184    /// let response = builder.poller().until_done().await?;
1185    /// # Ok(()) }
1186    ///
1187    /// fn prepare_request_builder() -> DeleteServiceConnectionPolicy {
1188    ///   # panic!();
1189    ///   // ... details omitted ...
1190    /// }
1191    /// ```
1192    #[derive(Clone, Debug)]
1193    pub struct DeleteServiceConnectionPolicy(
1194        RequestBuilder<crate::model::DeleteServiceConnectionPolicyRequest>,
1195    );
1196
1197    impl DeleteServiceConnectionPolicy {
1198        pub(crate) fn new(
1199            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1200        ) -> Self {
1201            Self(RequestBuilder::new(stub))
1202        }
1203
1204        /// Sets the full request, replacing any prior values.
1205        pub fn with_request<V: Into<crate::model::DeleteServiceConnectionPolicyRequest>>(
1206            mut self,
1207            v: V,
1208        ) -> Self {
1209            self.0.request = v.into();
1210            self
1211        }
1212
1213        /// Sets all the options, replacing any prior values.
1214        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1215            self.0.options = v.into();
1216            self
1217        }
1218
1219        /// Sends the request.
1220        ///
1221        /// # Long running operations
1222        ///
1223        /// This starts, but does not poll, a longrunning operation. More information
1224        /// on [delete_service_connection_policy][crate::client::CrossNetworkAutomationService::delete_service_connection_policy].
1225        pub async fn send(self) -> Result<longrunning::model::Operation> {
1226            (*self.0.stub)
1227                .delete_service_connection_policy(self.0.request, self.0.options)
1228                .await
1229                .map(gax::response::Response::into_body)
1230        }
1231
1232        /// Creates a [Poller][lro::Poller] to work with `delete_service_connection_policy`.
1233        pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
1234            type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
1235            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1236            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1237
1238            let stub = self.0.stub.clone();
1239            let mut options = self.0.options.clone();
1240            options.set_retry_policy(gax::retry_policy::NeverRetry);
1241            let query = move |name| {
1242                let stub = stub.clone();
1243                let options = options.clone();
1244                async {
1245                    let op = GetOperation::new(stub)
1246                        .set_name(name)
1247                        .with_options(options)
1248                        .send()
1249                        .await?;
1250                    Ok(Operation::new(op))
1251                }
1252            };
1253
1254            let start = move || async {
1255                let op = self.send().await?;
1256                Ok(Operation::new(op))
1257            };
1258
1259            lro::internal::new_unit_response_poller(
1260                polling_error_policy,
1261                polling_backoff_policy,
1262                start,
1263                query,
1264            )
1265        }
1266
1267        /// Sets the value of [name][crate::model::DeleteServiceConnectionPolicyRequest::name].
1268        ///
1269        /// This is a **required** field for requests.
1270        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1271            self.0.request.name = v.into();
1272            self
1273        }
1274
1275        /// Sets the value of [request_id][crate::model::DeleteServiceConnectionPolicyRequest::request_id].
1276        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1277            self.0.request.request_id = v.into();
1278            self
1279        }
1280
1281        /// Sets the value of [etag][crate::model::DeleteServiceConnectionPolicyRequest::etag].
1282        pub fn set_etag<T>(mut self, v: T) -> Self
1283        where
1284            T: std::convert::Into<std::string::String>,
1285        {
1286            self.0.request.etag = std::option::Option::Some(v.into());
1287            self
1288        }
1289
1290        /// Sets or clears the value of [etag][crate::model::DeleteServiceConnectionPolicyRequest::etag].
1291        pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
1292        where
1293            T: std::convert::Into<std::string::String>,
1294        {
1295            self.0.request.etag = v.map(|x| x.into());
1296            self
1297        }
1298    }
1299
1300    #[doc(hidden)]
1301    impl gax::options::internal::RequestBuilder for DeleteServiceConnectionPolicy {
1302        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1303            &mut self.0.options
1304        }
1305    }
1306
1307    /// The request builder for [CrossNetworkAutomationService::list_service_classes][crate::client::CrossNetworkAutomationService::list_service_classes] calls.
1308    ///
1309    /// # Example
1310    /// ```
1311    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::ListServiceClasses;
1312    /// # async fn sample() -> gax::Result<()> {
1313    /// use gax::paginator::ItemPaginator;
1314    ///
1315    /// let builder = prepare_request_builder();
1316    /// let mut items = builder.by_item();
1317    /// while let Some(result) = items.next().await {
1318    ///   let item = result?;
1319    /// }
1320    /// # Ok(()) }
1321    ///
1322    /// fn prepare_request_builder() -> ListServiceClasses {
1323    ///   # panic!();
1324    ///   // ... details omitted ...
1325    /// }
1326    /// ```
1327    #[derive(Clone, Debug)]
1328    pub struct ListServiceClasses(RequestBuilder<crate::model::ListServiceClassesRequest>);
1329
1330    impl ListServiceClasses {
1331        pub(crate) fn new(
1332            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1333        ) -> Self {
1334            Self(RequestBuilder::new(stub))
1335        }
1336
1337        /// Sets the full request, replacing any prior values.
1338        pub fn with_request<V: Into<crate::model::ListServiceClassesRequest>>(
1339            mut self,
1340            v: V,
1341        ) -> Self {
1342            self.0.request = v.into();
1343            self
1344        }
1345
1346        /// Sets all the options, replacing any prior values.
1347        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1348            self.0.options = v.into();
1349            self
1350        }
1351
1352        /// Sends the request.
1353        pub async fn send(self) -> Result<crate::model::ListServiceClassesResponse> {
1354            (*self.0.stub)
1355                .list_service_classes(self.0.request, self.0.options)
1356                .await
1357                .map(gax::response::Response::into_body)
1358        }
1359
1360        /// Streams each page in the collection.
1361        pub fn by_page(
1362            self,
1363        ) -> impl gax::paginator::Paginator<crate::model::ListServiceClassesResponse, gax::error::Error>
1364        {
1365            use std::clone::Clone;
1366            let token = self.0.request.page_token.clone();
1367            let execute = move |token: String| {
1368                let mut builder = self.clone();
1369                builder.0.request = builder.0.request.set_page_token(token);
1370                builder.send()
1371            };
1372            gax::paginator::internal::new_paginator(token, execute)
1373        }
1374
1375        /// Streams each item in the collection.
1376        pub fn by_item(
1377            self,
1378        ) -> impl gax::paginator::ItemPaginator<
1379            crate::model::ListServiceClassesResponse,
1380            gax::error::Error,
1381        > {
1382            use gax::paginator::Paginator;
1383            self.by_page().items()
1384        }
1385
1386        /// Sets the value of [parent][crate::model::ListServiceClassesRequest::parent].
1387        ///
1388        /// This is a **required** field for requests.
1389        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1390            self.0.request.parent = v.into();
1391            self
1392        }
1393
1394        /// Sets the value of [page_size][crate::model::ListServiceClassesRequest::page_size].
1395        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1396            self.0.request.page_size = v.into();
1397            self
1398        }
1399
1400        /// Sets the value of [page_token][crate::model::ListServiceClassesRequest::page_token].
1401        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1402            self.0.request.page_token = v.into();
1403            self
1404        }
1405
1406        /// Sets the value of [filter][crate::model::ListServiceClassesRequest::filter].
1407        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1408            self.0.request.filter = v.into();
1409            self
1410        }
1411
1412        /// Sets the value of [order_by][crate::model::ListServiceClassesRequest::order_by].
1413        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1414            self.0.request.order_by = v.into();
1415            self
1416        }
1417    }
1418
1419    #[doc(hidden)]
1420    impl gax::options::internal::RequestBuilder for ListServiceClasses {
1421        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1422            &mut self.0.options
1423        }
1424    }
1425
1426    /// The request builder for [CrossNetworkAutomationService::get_service_class][crate::client::CrossNetworkAutomationService::get_service_class] calls.
1427    ///
1428    /// # Example
1429    /// ```
1430    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::GetServiceClass;
1431    /// # async fn sample() -> gax::Result<()> {
1432    ///
1433    /// let builder = prepare_request_builder();
1434    /// let response = builder.send().await?;
1435    /// # Ok(()) }
1436    ///
1437    /// fn prepare_request_builder() -> GetServiceClass {
1438    ///   # panic!();
1439    ///   // ... details omitted ...
1440    /// }
1441    /// ```
1442    #[derive(Clone, Debug)]
1443    pub struct GetServiceClass(RequestBuilder<crate::model::GetServiceClassRequest>);
1444
1445    impl GetServiceClass {
1446        pub(crate) fn new(
1447            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1448        ) -> Self {
1449            Self(RequestBuilder::new(stub))
1450        }
1451
1452        /// Sets the full request, replacing any prior values.
1453        pub fn with_request<V: Into<crate::model::GetServiceClassRequest>>(mut self, v: V) -> Self {
1454            self.0.request = v.into();
1455            self
1456        }
1457
1458        /// Sets all the options, replacing any prior values.
1459        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1460            self.0.options = v.into();
1461            self
1462        }
1463
1464        /// Sends the request.
1465        pub async fn send(self) -> Result<crate::model::ServiceClass> {
1466            (*self.0.stub)
1467                .get_service_class(self.0.request, self.0.options)
1468                .await
1469                .map(gax::response::Response::into_body)
1470        }
1471
1472        /// Sets the value of [name][crate::model::GetServiceClassRequest::name].
1473        ///
1474        /// This is a **required** field for requests.
1475        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1476            self.0.request.name = v.into();
1477            self
1478        }
1479    }
1480
1481    #[doc(hidden)]
1482    impl gax::options::internal::RequestBuilder for GetServiceClass {
1483        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1484            &mut self.0.options
1485        }
1486    }
1487
1488    /// The request builder for [CrossNetworkAutomationService::update_service_class][crate::client::CrossNetworkAutomationService::update_service_class] calls.
1489    ///
1490    /// # Example
1491    /// ```
1492    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::UpdateServiceClass;
1493    /// # async fn sample() -> gax::Result<()> {
1494    /// use lro::Poller;
1495    ///
1496    /// let builder = prepare_request_builder();
1497    /// let response = builder.poller().until_done().await?;
1498    /// # Ok(()) }
1499    ///
1500    /// fn prepare_request_builder() -> UpdateServiceClass {
1501    ///   # panic!();
1502    ///   // ... details omitted ...
1503    /// }
1504    /// ```
1505    #[derive(Clone, Debug)]
1506    pub struct UpdateServiceClass(RequestBuilder<crate::model::UpdateServiceClassRequest>);
1507
1508    impl UpdateServiceClass {
1509        pub(crate) fn new(
1510            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1511        ) -> Self {
1512            Self(RequestBuilder::new(stub))
1513        }
1514
1515        /// Sets the full request, replacing any prior values.
1516        pub fn with_request<V: Into<crate::model::UpdateServiceClassRequest>>(
1517            mut self,
1518            v: V,
1519        ) -> Self {
1520            self.0.request = v.into();
1521            self
1522        }
1523
1524        /// Sets all the options, replacing any prior values.
1525        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1526            self.0.options = v.into();
1527            self
1528        }
1529
1530        /// Sends the request.
1531        ///
1532        /// # Long running operations
1533        ///
1534        /// This starts, but does not poll, a longrunning operation. More information
1535        /// on [update_service_class][crate::client::CrossNetworkAutomationService::update_service_class].
1536        pub async fn send(self) -> Result<longrunning::model::Operation> {
1537            (*self.0.stub)
1538                .update_service_class(self.0.request, self.0.options)
1539                .await
1540                .map(gax::response::Response::into_body)
1541        }
1542
1543        /// Creates a [Poller][lro::Poller] to work with `update_service_class`.
1544        pub fn poller(
1545            self,
1546        ) -> impl lro::Poller<crate::model::ServiceClass, crate::model::OperationMetadata> {
1547            type Operation = lro::internal::Operation<
1548                crate::model::ServiceClass,
1549                crate::model::OperationMetadata,
1550            >;
1551            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1552            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1553
1554            let stub = self.0.stub.clone();
1555            let mut options = self.0.options.clone();
1556            options.set_retry_policy(gax::retry_policy::NeverRetry);
1557            let query = move |name| {
1558                let stub = stub.clone();
1559                let options = options.clone();
1560                async {
1561                    let op = GetOperation::new(stub)
1562                        .set_name(name)
1563                        .with_options(options)
1564                        .send()
1565                        .await?;
1566                    Ok(Operation::new(op))
1567                }
1568            };
1569
1570            let start = move || async {
1571                let op = self.send().await?;
1572                Ok(Operation::new(op))
1573            };
1574
1575            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1576        }
1577
1578        /// Sets the value of [update_mask][crate::model::UpdateServiceClassRequest::update_mask].
1579        pub fn set_update_mask<T>(mut self, v: T) -> Self
1580        where
1581            T: std::convert::Into<wkt::FieldMask>,
1582        {
1583            self.0.request.update_mask = std::option::Option::Some(v.into());
1584            self
1585        }
1586
1587        /// Sets or clears the value of [update_mask][crate::model::UpdateServiceClassRequest::update_mask].
1588        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1589        where
1590            T: std::convert::Into<wkt::FieldMask>,
1591        {
1592            self.0.request.update_mask = v.map(|x| x.into());
1593            self
1594        }
1595
1596        /// Sets the value of [service_class][crate::model::UpdateServiceClassRequest::service_class].
1597        ///
1598        /// This is a **required** field for requests.
1599        pub fn set_service_class<T>(mut self, v: T) -> Self
1600        where
1601            T: std::convert::Into<crate::model::ServiceClass>,
1602        {
1603            self.0.request.service_class = std::option::Option::Some(v.into());
1604            self
1605        }
1606
1607        /// Sets or clears the value of [service_class][crate::model::UpdateServiceClassRequest::service_class].
1608        ///
1609        /// This is a **required** field for requests.
1610        pub fn set_or_clear_service_class<T>(mut self, v: std::option::Option<T>) -> Self
1611        where
1612            T: std::convert::Into<crate::model::ServiceClass>,
1613        {
1614            self.0.request.service_class = v.map(|x| x.into());
1615            self
1616        }
1617
1618        /// Sets the value of [request_id][crate::model::UpdateServiceClassRequest::request_id].
1619        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1620            self.0.request.request_id = v.into();
1621            self
1622        }
1623    }
1624
1625    #[doc(hidden)]
1626    impl gax::options::internal::RequestBuilder for UpdateServiceClass {
1627        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1628            &mut self.0.options
1629        }
1630    }
1631
1632    /// The request builder for [CrossNetworkAutomationService::delete_service_class][crate::client::CrossNetworkAutomationService::delete_service_class] calls.
1633    ///
1634    /// # Example
1635    /// ```
1636    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::DeleteServiceClass;
1637    /// # async fn sample() -> gax::Result<()> {
1638    /// use lro::Poller;
1639    ///
1640    /// let builder = prepare_request_builder();
1641    /// let response = builder.poller().until_done().await?;
1642    /// # Ok(()) }
1643    ///
1644    /// fn prepare_request_builder() -> DeleteServiceClass {
1645    ///   # panic!();
1646    ///   // ... details omitted ...
1647    /// }
1648    /// ```
1649    #[derive(Clone, Debug)]
1650    pub struct DeleteServiceClass(RequestBuilder<crate::model::DeleteServiceClassRequest>);
1651
1652    impl DeleteServiceClass {
1653        pub(crate) fn new(
1654            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1655        ) -> Self {
1656            Self(RequestBuilder::new(stub))
1657        }
1658
1659        /// Sets the full request, replacing any prior values.
1660        pub fn with_request<V: Into<crate::model::DeleteServiceClassRequest>>(
1661            mut self,
1662            v: V,
1663        ) -> Self {
1664            self.0.request = v.into();
1665            self
1666        }
1667
1668        /// Sets all the options, replacing any prior values.
1669        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1670            self.0.options = v.into();
1671            self
1672        }
1673
1674        /// Sends the request.
1675        ///
1676        /// # Long running operations
1677        ///
1678        /// This starts, but does not poll, a longrunning operation. More information
1679        /// on [delete_service_class][crate::client::CrossNetworkAutomationService::delete_service_class].
1680        pub async fn send(self) -> Result<longrunning::model::Operation> {
1681            (*self.0.stub)
1682                .delete_service_class(self.0.request, self.0.options)
1683                .await
1684                .map(gax::response::Response::into_body)
1685        }
1686
1687        /// Creates a [Poller][lro::Poller] to work with `delete_service_class`.
1688        pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
1689            type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
1690            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1691            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1692
1693            let stub = self.0.stub.clone();
1694            let mut options = self.0.options.clone();
1695            options.set_retry_policy(gax::retry_policy::NeverRetry);
1696            let query = move |name| {
1697                let stub = stub.clone();
1698                let options = options.clone();
1699                async {
1700                    let op = GetOperation::new(stub)
1701                        .set_name(name)
1702                        .with_options(options)
1703                        .send()
1704                        .await?;
1705                    Ok(Operation::new(op))
1706                }
1707            };
1708
1709            let start = move || async {
1710                let op = self.send().await?;
1711                Ok(Operation::new(op))
1712            };
1713
1714            lro::internal::new_unit_response_poller(
1715                polling_error_policy,
1716                polling_backoff_policy,
1717                start,
1718                query,
1719            )
1720        }
1721
1722        /// Sets the value of [name][crate::model::DeleteServiceClassRequest::name].
1723        ///
1724        /// This is a **required** field for requests.
1725        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1726            self.0.request.name = v.into();
1727            self
1728        }
1729
1730        /// Sets the value of [request_id][crate::model::DeleteServiceClassRequest::request_id].
1731        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1732            self.0.request.request_id = v.into();
1733            self
1734        }
1735
1736        /// Sets the value of [etag][crate::model::DeleteServiceClassRequest::etag].
1737        pub fn set_etag<T>(mut self, v: T) -> Self
1738        where
1739            T: std::convert::Into<std::string::String>,
1740        {
1741            self.0.request.etag = std::option::Option::Some(v.into());
1742            self
1743        }
1744
1745        /// Sets or clears the value of [etag][crate::model::DeleteServiceClassRequest::etag].
1746        pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
1747        where
1748            T: std::convert::Into<std::string::String>,
1749        {
1750            self.0.request.etag = v.map(|x| x.into());
1751            self
1752        }
1753    }
1754
1755    #[doc(hidden)]
1756    impl gax::options::internal::RequestBuilder for DeleteServiceClass {
1757        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1758            &mut self.0.options
1759        }
1760    }
1761
1762    /// The request builder for [CrossNetworkAutomationService::get_service_connection_token][crate::client::CrossNetworkAutomationService::get_service_connection_token] calls.
1763    ///
1764    /// # Example
1765    /// ```
1766    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::GetServiceConnectionToken;
1767    /// # async fn sample() -> gax::Result<()> {
1768    ///
1769    /// let builder = prepare_request_builder();
1770    /// let response = builder.send().await?;
1771    /// # Ok(()) }
1772    ///
1773    /// fn prepare_request_builder() -> GetServiceConnectionToken {
1774    ///   # panic!();
1775    ///   // ... details omitted ...
1776    /// }
1777    /// ```
1778    #[derive(Clone, Debug)]
1779    pub struct GetServiceConnectionToken(
1780        RequestBuilder<crate::model::GetServiceConnectionTokenRequest>,
1781    );
1782
1783    impl GetServiceConnectionToken {
1784        pub(crate) fn new(
1785            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1786        ) -> Self {
1787            Self(RequestBuilder::new(stub))
1788        }
1789
1790        /// Sets the full request, replacing any prior values.
1791        pub fn with_request<V: Into<crate::model::GetServiceConnectionTokenRequest>>(
1792            mut self,
1793            v: V,
1794        ) -> Self {
1795            self.0.request = v.into();
1796            self
1797        }
1798
1799        /// Sets all the options, replacing any prior values.
1800        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1801            self.0.options = v.into();
1802            self
1803        }
1804
1805        /// Sends the request.
1806        pub async fn send(self) -> Result<crate::model::ServiceConnectionToken> {
1807            (*self.0.stub)
1808                .get_service_connection_token(self.0.request, self.0.options)
1809                .await
1810                .map(gax::response::Response::into_body)
1811        }
1812
1813        /// Sets the value of [name][crate::model::GetServiceConnectionTokenRequest::name].
1814        ///
1815        /// This is a **required** field for requests.
1816        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1817            self.0.request.name = v.into();
1818            self
1819        }
1820    }
1821
1822    #[doc(hidden)]
1823    impl gax::options::internal::RequestBuilder for GetServiceConnectionToken {
1824        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1825            &mut self.0.options
1826        }
1827    }
1828
1829    /// The request builder for [CrossNetworkAutomationService::list_service_connection_tokens][crate::client::CrossNetworkAutomationService::list_service_connection_tokens] calls.
1830    ///
1831    /// # Example
1832    /// ```
1833    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::ListServiceConnectionTokens;
1834    /// # async fn sample() -> gax::Result<()> {
1835    /// use gax::paginator::ItemPaginator;
1836    ///
1837    /// let builder = prepare_request_builder();
1838    /// let mut items = builder.by_item();
1839    /// while let Some(result) = items.next().await {
1840    ///   let item = result?;
1841    /// }
1842    /// # Ok(()) }
1843    ///
1844    /// fn prepare_request_builder() -> ListServiceConnectionTokens {
1845    ///   # panic!();
1846    ///   // ... details omitted ...
1847    /// }
1848    /// ```
1849    #[derive(Clone, Debug)]
1850    pub struct ListServiceConnectionTokens(
1851        RequestBuilder<crate::model::ListServiceConnectionTokensRequest>,
1852    );
1853
1854    impl ListServiceConnectionTokens {
1855        pub(crate) fn new(
1856            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1857        ) -> Self {
1858            Self(RequestBuilder::new(stub))
1859        }
1860
1861        /// Sets the full request, replacing any prior values.
1862        pub fn with_request<V: Into<crate::model::ListServiceConnectionTokensRequest>>(
1863            mut self,
1864            v: V,
1865        ) -> Self {
1866            self.0.request = v.into();
1867            self
1868        }
1869
1870        /// Sets all the options, replacing any prior values.
1871        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1872            self.0.options = v.into();
1873            self
1874        }
1875
1876        /// Sends the request.
1877        pub async fn send(self) -> Result<crate::model::ListServiceConnectionTokensResponse> {
1878            (*self.0.stub)
1879                .list_service_connection_tokens(self.0.request, self.0.options)
1880                .await
1881                .map(gax::response::Response::into_body)
1882        }
1883
1884        /// Streams each page in the collection.
1885        pub fn by_page(
1886            self,
1887        ) -> impl gax::paginator::Paginator<
1888            crate::model::ListServiceConnectionTokensResponse,
1889            gax::error::Error,
1890        > {
1891            use std::clone::Clone;
1892            let token = self.0.request.page_token.clone();
1893            let execute = move |token: String| {
1894                let mut builder = self.clone();
1895                builder.0.request = builder.0.request.set_page_token(token);
1896                builder.send()
1897            };
1898            gax::paginator::internal::new_paginator(token, execute)
1899        }
1900
1901        /// Streams each item in the collection.
1902        pub fn by_item(
1903            self,
1904        ) -> impl gax::paginator::ItemPaginator<
1905            crate::model::ListServiceConnectionTokensResponse,
1906            gax::error::Error,
1907        > {
1908            use gax::paginator::Paginator;
1909            self.by_page().items()
1910        }
1911
1912        /// Sets the value of [parent][crate::model::ListServiceConnectionTokensRequest::parent].
1913        ///
1914        /// This is a **required** field for requests.
1915        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1916            self.0.request.parent = v.into();
1917            self
1918        }
1919
1920        /// Sets the value of [page_size][crate::model::ListServiceConnectionTokensRequest::page_size].
1921        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1922            self.0.request.page_size = v.into();
1923            self
1924        }
1925
1926        /// Sets the value of [page_token][crate::model::ListServiceConnectionTokensRequest::page_token].
1927        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1928            self.0.request.page_token = v.into();
1929            self
1930        }
1931
1932        /// Sets the value of [filter][crate::model::ListServiceConnectionTokensRequest::filter].
1933        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1934            self.0.request.filter = v.into();
1935            self
1936        }
1937
1938        /// Sets the value of [order_by][crate::model::ListServiceConnectionTokensRequest::order_by].
1939        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1940            self.0.request.order_by = v.into();
1941            self
1942        }
1943    }
1944
1945    #[doc(hidden)]
1946    impl gax::options::internal::RequestBuilder for ListServiceConnectionTokens {
1947        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1948            &mut self.0.options
1949        }
1950    }
1951
1952    /// The request builder for [CrossNetworkAutomationService::create_service_connection_token][crate::client::CrossNetworkAutomationService::create_service_connection_token] calls.
1953    ///
1954    /// # Example
1955    /// ```
1956    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::CreateServiceConnectionToken;
1957    /// # async fn sample() -> gax::Result<()> {
1958    /// use lro::Poller;
1959    ///
1960    /// let builder = prepare_request_builder();
1961    /// let response = builder.poller().until_done().await?;
1962    /// # Ok(()) }
1963    ///
1964    /// fn prepare_request_builder() -> CreateServiceConnectionToken {
1965    ///   # panic!();
1966    ///   // ... details omitted ...
1967    /// }
1968    /// ```
1969    #[derive(Clone, Debug)]
1970    pub struct CreateServiceConnectionToken(
1971        RequestBuilder<crate::model::CreateServiceConnectionTokenRequest>,
1972    );
1973
1974    impl CreateServiceConnectionToken {
1975        pub(crate) fn new(
1976            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1977        ) -> Self {
1978            Self(RequestBuilder::new(stub))
1979        }
1980
1981        /// Sets the full request, replacing any prior values.
1982        pub fn with_request<V: Into<crate::model::CreateServiceConnectionTokenRequest>>(
1983            mut self,
1984            v: V,
1985        ) -> Self {
1986            self.0.request = v.into();
1987            self
1988        }
1989
1990        /// Sets all the options, replacing any prior values.
1991        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1992            self.0.options = v.into();
1993            self
1994        }
1995
1996        /// Sends the request.
1997        ///
1998        /// # Long running operations
1999        ///
2000        /// This starts, but does not poll, a longrunning operation. More information
2001        /// on [create_service_connection_token][crate::client::CrossNetworkAutomationService::create_service_connection_token].
2002        pub async fn send(self) -> Result<longrunning::model::Operation> {
2003            (*self.0.stub)
2004                .create_service_connection_token(self.0.request, self.0.options)
2005                .await
2006                .map(gax::response::Response::into_body)
2007        }
2008
2009        /// Creates a [Poller][lro::Poller] to work with `create_service_connection_token`.
2010        pub fn poller(
2011            self,
2012        ) -> impl lro::Poller<crate::model::ServiceConnectionToken, crate::model::OperationMetadata>
2013        {
2014            type Operation = lro::internal::Operation<
2015                crate::model::ServiceConnectionToken,
2016                crate::model::OperationMetadata,
2017            >;
2018            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2019            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2020
2021            let stub = self.0.stub.clone();
2022            let mut options = self.0.options.clone();
2023            options.set_retry_policy(gax::retry_policy::NeverRetry);
2024            let query = move |name| {
2025                let stub = stub.clone();
2026                let options = options.clone();
2027                async {
2028                    let op = GetOperation::new(stub)
2029                        .set_name(name)
2030                        .with_options(options)
2031                        .send()
2032                        .await?;
2033                    Ok(Operation::new(op))
2034                }
2035            };
2036
2037            let start = move || async {
2038                let op = self.send().await?;
2039                Ok(Operation::new(op))
2040            };
2041
2042            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2043        }
2044
2045        /// Sets the value of [parent][crate::model::CreateServiceConnectionTokenRequest::parent].
2046        ///
2047        /// This is a **required** field for requests.
2048        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2049            self.0.request.parent = v.into();
2050            self
2051        }
2052
2053        /// Sets the value of [service_connection_token_id][crate::model::CreateServiceConnectionTokenRequest::service_connection_token_id].
2054        pub fn set_service_connection_token_id<T: Into<std::string::String>>(
2055            mut self,
2056            v: T,
2057        ) -> Self {
2058            self.0.request.service_connection_token_id = v.into();
2059            self
2060        }
2061
2062        /// Sets the value of [service_connection_token][crate::model::CreateServiceConnectionTokenRequest::service_connection_token].
2063        ///
2064        /// This is a **required** field for requests.
2065        pub fn set_service_connection_token<T>(mut self, v: T) -> Self
2066        where
2067            T: std::convert::Into<crate::model::ServiceConnectionToken>,
2068        {
2069            self.0.request.service_connection_token = std::option::Option::Some(v.into());
2070            self
2071        }
2072
2073        /// Sets or clears the value of [service_connection_token][crate::model::CreateServiceConnectionTokenRequest::service_connection_token].
2074        ///
2075        /// This is a **required** field for requests.
2076        pub fn set_or_clear_service_connection_token<T>(mut self, v: std::option::Option<T>) -> Self
2077        where
2078            T: std::convert::Into<crate::model::ServiceConnectionToken>,
2079        {
2080            self.0.request.service_connection_token = v.map(|x| x.into());
2081            self
2082        }
2083
2084        /// Sets the value of [request_id][crate::model::CreateServiceConnectionTokenRequest::request_id].
2085        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2086            self.0.request.request_id = v.into();
2087            self
2088        }
2089    }
2090
2091    #[doc(hidden)]
2092    impl gax::options::internal::RequestBuilder for CreateServiceConnectionToken {
2093        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2094            &mut self.0.options
2095        }
2096    }
2097
2098    /// The request builder for [CrossNetworkAutomationService::delete_service_connection_token][crate::client::CrossNetworkAutomationService::delete_service_connection_token] calls.
2099    ///
2100    /// # Example
2101    /// ```
2102    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::DeleteServiceConnectionToken;
2103    /// # async fn sample() -> gax::Result<()> {
2104    /// use lro::Poller;
2105    ///
2106    /// let builder = prepare_request_builder();
2107    /// let response = builder.poller().until_done().await?;
2108    /// # Ok(()) }
2109    ///
2110    /// fn prepare_request_builder() -> DeleteServiceConnectionToken {
2111    ///   # panic!();
2112    ///   // ... details omitted ...
2113    /// }
2114    /// ```
2115    #[derive(Clone, Debug)]
2116    pub struct DeleteServiceConnectionToken(
2117        RequestBuilder<crate::model::DeleteServiceConnectionTokenRequest>,
2118    );
2119
2120    impl DeleteServiceConnectionToken {
2121        pub(crate) fn new(
2122            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2123        ) -> Self {
2124            Self(RequestBuilder::new(stub))
2125        }
2126
2127        /// Sets the full request, replacing any prior values.
2128        pub fn with_request<V: Into<crate::model::DeleteServiceConnectionTokenRequest>>(
2129            mut self,
2130            v: V,
2131        ) -> Self {
2132            self.0.request = v.into();
2133            self
2134        }
2135
2136        /// Sets all the options, replacing any prior values.
2137        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2138            self.0.options = v.into();
2139            self
2140        }
2141
2142        /// Sends the request.
2143        ///
2144        /// # Long running operations
2145        ///
2146        /// This starts, but does not poll, a longrunning operation. More information
2147        /// on [delete_service_connection_token][crate::client::CrossNetworkAutomationService::delete_service_connection_token].
2148        pub async fn send(self) -> Result<longrunning::model::Operation> {
2149            (*self.0.stub)
2150                .delete_service_connection_token(self.0.request, self.0.options)
2151                .await
2152                .map(gax::response::Response::into_body)
2153        }
2154
2155        /// Creates a [Poller][lro::Poller] to work with `delete_service_connection_token`.
2156        pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
2157            type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2158            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2159            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2160
2161            let stub = self.0.stub.clone();
2162            let mut options = self.0.options.clone();
2163            options.set_retry_policy(gax::retry_policy::NeverRetry);
2164            let query = move |name| {
2165                let stub = stub.clone();
2166                let options = options.clone();
2167                async {
2168                    let op = GetOperation::new(stub)
2169                        .set_name(name)
2170                        .with_options(options)
2171                        .send()
2172                        .await?;
2173                    Ok(Operation::new(op))
2174                }
2175            };
2176
2177            let start = move || async {
2178                let op = self.send().await?;
2179                Ok(Operation::new(op))
2180            };
2181
2182            lro::internal::new_unit_response_poller(
2183                polling_error_policy,
2184                polling_backoff_policy,
2185                start,
2186                query,
2187            )
2188        }
2189
2190        /// Sets the value of [name][crate::model::DeleteServiceConnectionTokenRequest::name].
2191        ///
2192        /// This is a **required** field for requests.
2193        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2194            self.0.request.name = v.into();
2195            self
2196        }
2197
2198        /// Sets the value of [request_id][crate::model::DeleteServiceConnectionTokenRequest::request_id].
2199        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2200            self.0.request.request_id = v.into();
2201            self
2202        }
2203
2204        /// Sets the value of [etag][crate::model::DeleteServiceConnectionTokenRequest::etag].
2205        pub fn set_etag<T>(mut self, v: T) -> Self
2206        where
2207            T: std::convert::Into<std::string::String>,
2208        {
2209            self.0.request.etag = std::option::Option::Some(v.into());
2210            self
2211        }
2212
2213        /// Sets or clears the value of [etag][crate::model::DeleteServiceConnectionTokenRequest::etag].
2214        pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
2215        where
2216            T: std::convert::Into<std::string::String>,
2217        {
2218            self.0.request.etag = v.map(|x| x.into());
2219            self
2220        }
2221    }
2222
2223    #[doc(hidden)]
2224    impl gax::options::internal::RequestBuilder for DeleteServiceConnectionToken {
2225        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2226            &mut self.0.options
2227        }
2228    }
2229
2230    /// The request builder for [CrossNetworkAutomationService::list_locations][crate::client::CrossNetworkAutomationService::list_locations] calls.
2231    ///
2232    /// # Example
2233    /// ```
2234    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::ListLocations;
2235    /// # async fn sample() -> gax::Result<()> {
2236    /// use gax::paginator::ItemPaginator;
2237    ///
2238    /// let builder = prepare_request_builder();
2239    /// let mut items = builder.by_item();
2240    /// while let Some(result) = items.next().await {
2241    ///   let item = result?;
2242    /// }
2243    /// # Ok(()) }
2244    ///
2245    /// fn prepare_request_builder() -> ListLocations {
2246    ///   # panic!();
2247    ///   // ... details omitted ...
2248    /// }
2249    /// ```
2250    #[derive(Clone, Debug)]
2251    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
2252
2253    impl ListLocations {
2254        pub(crate) fn new(
2255            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2256        ) -> Self {
2257            Self(RequestBuilder::new(stub))
2258        }
2259
2260        /// Sets the full request, replacing any prior values.
2261        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
2262            mut self,
2263            v: V,
2264        ) -> Self {
2265            self.0.request = v.into();
2266            self
2267        }
2268
2269        /// Sets all the options, replacing any prior values.
2270        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2271            self.0.options = v.into();
2272            self
2273        }
2274
2275        /// Sends the request.
2276        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
2277            (*self.0.stub)
2278                .list_locations(self.0.request, self.0.options)
2279                .await
2280                .map(gax::response::Response::into_body)
2281        }
2282
2283        /// Streams each page in the collection.
2284        pub fn by_page(
2285            self,
2286        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
2287        {
2288            use std::clone::Clone;
2289            let token = self.0.request.page_token.clone();
2290            let execute = move |token: String| {
2291                let mut builder = self.clone();
2292                builder.0.request = builder.0.request.set_page_token(token);
2293                builder.send()
2294            };
2295            gax::paginator::internal::new_paginator(token, execute)
2296        }
2297
2298        /// Streams each item in the collection.
2299        pub fn by_item(
2300            self,
2301        ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
2302        {
2303            use gax::paginator::Paginator;
2304            self.by_page().items()
2305        }
2306
2307        /// Sets the value of [name][location::model::ListLocationsRequest::name].
2308        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2309            self.0.request.name = v.into();
2310            self
2311        }
2312
2313        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
2314        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2315            self.0.request.filter = v.into();
2316            self
2317        }
2318
2319        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
2320        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2321            self.0.request.page_size = v.into();
2322            self
2323        }
2324
2325        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
2326        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2327            self.0.request.page_token = v.into();
2328            self
2329        }
2330    }
2331
2332    #[doc(hidden)]
2333    impl gax::options::internal::RequestBuilder for ListLocations {
2334        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2335            &mut self.0.options
2336        }
2337    }
2338
2339    /// The request builder for [CrossNetworkAutomationService::get_location][crate::client::CrossNetworkAutomationService::get_location] calls.
2340    ///
2341    /// # Example
2342    /// ```
2343    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::GetLocation;
2344    /// # async fn sample() -> gax::Result<()> {
2345    ///
2346    /// let builder = prepare_request_builder();
2347    /// let response = builder.send().await?;
2348    /// # Ok(()) }
2349    ///
2350    /// fn prepare_request_builder() -> GetLocation {
2351    ///   # panic!();
2352    ///   // ... details omitted ...
2353    /// }
2354    /// ```
2355    #[derive(Clone, Debug)]
2356    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
2357
2358    impl GetLocation {
2359        pub(crate) fn new(
2360            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2361        ) -> Self {
2362            Self(RequestBuilder::new(stub))
2363        }
2364
2365        /// Sets the full request, replacing any prior values.
2366        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
2367            self.0.request = v.into();
2368            self
2369        }
2370
2371        /// Sets all the options, replacing any prior values.
2372        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2373            self.0.options = v.into();
2374            self
2375        }
2376
2377        /// Sends the request.
2378        pub async fn send(self) -> Result<location::model::Location> {
2379            (*self.0.stub)
2380                .get_location(self.0.request, self.0.options)
2381                .await
2382                .map(gax::response::Response::into_body)
2383        }
2384
2385        /// Sets the value of [name][location::model::GetLocationRequest::name].
2386        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2387            self.0.request.name = v.into();
2388            self
2389        }
2390    }
2391
2392    #[doc(hidden)]
2393    impl gax::options::internal::RequestBuilder for GetLocation {
2394        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2395            &mut self.0.options
2396        }
2397    }
2398
2399    /// The request builder for [CrossNetworkAutomationService::set_iam_policy][crate::client::CrossNetworkAutomationService::set_iam_policy] calls.
2400    ///
2401    /// # Example
2402    /// ```
2403    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::SetIamPolicy;
2404    /// # async fn sample() -> gax::Result<()> {
2405    ///
2406    /// let builder = prepare_request_builder();
2407    /// let response = builder.send().await?;
2408    /// # Ok(()) }
2409    ///
2410    /// fn prepare_request_builder() -> SetIamPolicy {
2411    ///   # panic!();
2412    ///   // ... details omitted ...
2413    /// }
2414    /// ```
2415    #[derive(Clone, Debug)]
2416    pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
2417
2418    impl SetIamPolicy {
2419        pub(crate) fn new(
2420            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2421        ) -> Self {
2422            Self(RequestBuilder::new(stub))
2423        }
2424
2425        /// Sets the full request, replacing any prior values.
2426        pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
2427            self.0.request = v.into();
2428            self
2429        }
2430
2431        /// Sets all the options, replacing any prior values.
2432        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2433            self.0.options = v.into();
2434            self
2435        }
2436
2437        /// Sends the request.
2438        pub async fn send(self) -> Result<iam_v1::model::Policy> {
2439            (*self.0.stub)
2440                .set_iam_policy(self.0.request, self.0.options)
2441                .await
2442                .map(gax::response::Response::into_body)
2443        }
2444
2445        /// Sets the value of [resource][iam_v1::model::SetIamPolicyRequest::resource].
2446        ///
2447        /// This is a **required** field for requests.
2448        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2449            self.0.request.resource = v.into();
2450            self
2451        }
2452
2453        /// Sets the value of [policy][iam_v1::model::SetIamPolicyRequest::policy].
2454        ///
2455        /// This is a **required** field for requests.
2456        pub fn set_policy<T>(mut self, v: T) -> Self
2457        where
2458            T: std::convert::Into<iam_v1::model::Policy>,
2459        {
2460            self.0.request.policy = std::option::Option::Some(v.into());
2461            self
2462        }
2463
2464        /// Sets or clears the value of [policy][iam_v1::model::SetIamPolicyRequest::policy].
2465        ///
2466        /// This is a **required** field for requests.
2467        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
2468        where
2469            T: std::convert::Into<iam_v1::model::Policy>,
2470        {
2471            self.0.request.policy = v.map(|x| x.into());
2472            self
2473        }
2474
2475        /// Sets the value of [update_mask][iam_v1::model::SetIamPolicyRequest::update_mask].
2476        pub fn set_update_mask<T>(mut self, v: T) -> Self
2477        where
2478            T: std::convert::Into<wkt::FieldMask>,
2479        {
2480            self.0.request.update_mask = std::option::Option::Some(v.into());
2481            self
2482        }
2483
2484        /// Sets or clears the value of [update_mask][iam_v1::model::SetIamPolicyRequest::update_mask].
2485        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2486        where
2487            T: std::convert::Into<wkt::FieldMask>,
2488        {
2489            self.0.request.update_mask = v.map(|x| x.into());
2490            self
2491        }
2492    }
2493
2494    #[doc(hidden)]
2495    impl gax::options::internal::RequestBuilder for SetIamPolicy {
2496        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2497            &mut self.0.options
2498        }
2499    }
2500
2501    /// The request builder for [CrossNetworkAutomationService::get_iam_policy][crate::client::CrossNetworkAutomationService::get_iam_policy] calls.
2502    ///
2503    /// # Example
2504    /// ```
2505    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::GetIamPolicy;
2506    /// # async fn sample() -> gax::Result<()> {
2507    ///
2508    /// let builder = prepare_request_builder();
2509    /// let response = builder.send().await?;
2510    /// # Ok(()) }
2511    ///
2512    /// fn prepare_request_builder() -> GetIamPolicy {
2513    ///   # panic!();
2514    ///   // ... details omitted ...
2515    /// }
2516    /// ```
2517    #[derive(Clone, Debug)]
2518    pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
2519
2520    impl GetIamPolicy {
2521        pub(crate) fn new(
2522            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2523        ) -> Self {
2524            Self(RequestBuilder::new(stub))
2525        }
2526
2527        /// Sets the full request, replacing any prior values.
2528        pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
2529            self.0.request = v.into();
2530            self
2531        }
2532
2533        /// Sets all the options, replacing any prior values.
2534        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2535            self.0.options = v.into();
2536            self
2537        }
2538
2539        /// Sends the request.
2540        pub async fn send(self) -> Result<iam_v1::model::Policy> {
2541            (*self.0.stub)
2542                .get_iam_policy(self.0.request, self.0.options)
2543                .await
2544                .map(gax::response::Response::into_body)
2545        }
2546
2547        /// Sets the value of [resource][iam_v1::model::GetIamPolicyRequest::resource].
2548        ///
2549        /// This is a **required** field for requests.
2550        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2551            self.0.request.resource = v.into();
2552            self
2553        }
2554
2555        /// Sets the value of [options][iam_v1::model::GetIamPolicyRequest::options].
2556        pub fn set_options<T>(mut self, v: T) -> Self
2557        where
2558            T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
2559        {
2560            self.0.request.options = std::option::Option::Some(v.into());
2561            self
2562        }
2563
2564        /// Sets or clears the value of [options][iam_v1::model::GetIamPolicyRequest::options].
2565        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
2566        where
2567            T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
2568        {
2569            self.0.request.options = v.map(|x| x.into());
2570            self
2571        }
2572    }
2573
2574    #[doc(hidden)]
2575    impl gax::options::internal::RequestBuilder for GetIamPolicy {
2576        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2577            &mut self.0.options
2578        }
2579    }
2580
2581    /// The request builder for [CrossNetworkAutomationService::test_iam_permissions][crate::client::CrossNetworkAutomationService::test_iam_permissions] calls.
2582    ///
2583    /// # Example
2584    /// ```
2585    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::TestIamPermissions;
2586    /// # async fn sample() -> gax::Result<()> {
2587    ///
2588    /// let builder = prepare_request_builder();
2589    /// let response = builder.send().await?;
2590    /// # Ok(()) }
2591    ///
2592    /// fn prepare_request_builder() -> TestIamPermissions {
2593    ///   # panic!();
2594    ///   // ... details omitted ...
2595    /// }
2596    /// ```
2597    #[derive(Clone, Debug)]
2598    pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
2599
2600    impl TestIamPermissions {
2601        pub(crate) fn new(
2602            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2603        ) -> Self {
2604            Self(RequestBuilder::new(stub))
2605        }
2606
2607        /// Sets the full request, replacing any prior values.
2608        pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
2609            mut self,
2610            v: V,
2611        ) -> Self {
2612            self.0.request = v.into();
2613            self
2614        }
2615
2616        /// Sets all the options, replacing any prior values.
2617        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2618            self.0.options = v.into();
2619            self
2620        }
2621
2622        /// Sends the request.
2623        pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
2624            (*self.0.stub)
2625                .test_iam_permissions(self.0.request, self.0.options)
2626                .await
2627                .map(gax::response::Response::into_body)
2628        }
2629
2630        /// Sets the value of [resource][iam_v1::model::TestIamPermissionsRequest::resource].
2631        ///
2632        /// This is a **required** field for requests.
2633        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2634            self.0.request.resource = v.into();
2635            self
2636        }
2637
2638        /// Sets the value of [permissions][iam_v1::model::TestIamPermissionsRequest::permissions].
2639        ///
2640        /// This is a **required** field for requests.
2641        pub fn set_permissions<T, V>(mut self, v: T) -> Self
2642        where
2643            T: std::iter::IntoIterator<Item = V>,
2644            V: std::convert::Into<std::string::String>,
2645        {
2646            use std::iter::Iterator;
2647            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
2648            self
2649        }
2650    }
2651
2652    #[doc(hidden)]
2653    impl gax::options::internal::RequestBuilder for TestIamPermissions {
2654        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2655            &mut self.0.options
2656        }
2657    }
2658
2659    /// The request builder for [CrossNetworkAutomationService::list_operations][crate::client::CrossNetworkAutomationService::list_operations] calls.
2660    ///
2661    /// # Example
2662    /// ```
2663    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::ListOperations;
2664    /// # async fn sample() -> gax::Result<()> {
2665    /// use gax::paginator::ItemPaginator;
2666    ///
2667    /// let builder = prepare_request_builder();
2668    /// let mut items = builder.by_item();
2669    /// while let Some(result) = items.next().await {
2670    ///   let item = result?;
2671    /// }
2672    /// # Ok(()) }
2673    ///
2674    /// fn prepare_request_builder() -> ListOperations {
2675    ///   # panic!();
2676    ///   // ... details omitted ...
2677    /// }
2678    /// ```
2679    #[derive(Clone, Debug)]
2680    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
2681
2682    impl ListOperations {
2683        pub(crate) fn new(
2684            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2685        ) -> Self {
2686            Self(RequestBuilder::new(stub))
2687        }
2688
2689        /// Sets the full request, replacing any prior values.
2690        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
2691            mut self,
2692            v: V,
2693        ) -> Self {
2694            self.0.request = v.into();
2695            self
2696        }
2697
2698        /// Sets all the options, replacing any prior values.
2699        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2700            self.0.options = v.into();
2701            self
2702        }
2703
2704        /// Sends the request.
2705        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
2706            (*self.0.stub)
2707                .list_operations(self.0.request, self.0.options)
2708                .await
2709                .map(gax::response::Response::into_body)
2710        }
2711
2712        /// Streams each page in the collection.
2713        pub fn by_page(
2714            self,
2715        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
2716        {
2717            use std::clone::Clone;
2718            let token = self.0.request.page_token.clone();
2719            let execute = move |token: String| {
2720                let mut builder = self.clone();
2721                builder.0.request = builder.0.request.set_page_token(token);
2722                builder.send()
2723            };
2724            gax::paginator::internal::new_paginator(token, execute)
2725        }
2726
2727        /// Streams each item in the collection.
2728        pub fn by_item(
2729            self,
2730        ) -> impl gax::paginator::ItemPaginator<
2731            longrunning::model::ListOperationsResponse,
2732            gax::error::Error,
2733        > {
2734            use gax::paginator::Paginator;
2735            self.by_page().items()
2736        }
2737
2738        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
2739        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2740            self.0.request.name = v.into();
2741            self
2742        }
2743
2744        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
2745        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2746            self.0.request.filter = v.into();
2747            self
2748        }
2749
2750        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
2751        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2752            self.0.request.page_size = v.into();
2753            self
2754        }
2755
2756        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
2757        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2758            self.0.request.page_token = v.into();
2759            self
2760        }
2761
2762        /// Sets the value of [return_partial_success][longrunning::model::ListOperationsRequest::return_partial_success].
2763        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
2764            self.0.request.return_partial_success = v.into();
2765            self
2766        }
2767    }
2768
2769    #[doc(hidden)]
2770    impl gax::options::internal::RequestBuilder for ListOperations {
2771        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2772            &mut self.0.options
2773        }
2774    }
2775
2776    /// The request builder for [CrossNetworkAutomationService::get_operation][crate::client::CrossNetworkAutomationService::get_operation] calls.
2777    ///
2778    /// # Example
2779    /// ```
2780    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::GetOperation;
2781    /// # async fn sample() -> gax::Result<()> {
2782    ///
2783    /// let builder = prepare_request_builder();
2784    /// let response = builder.send().await?;
2785    /// # Ok(()) }
2786    ///
2787    /// fn prepare_request_builder() -> GetOperation {
2788    ///   # panic!();
2789    ///   // ... details omitted ...
2790    /// }
2791    /// ```
2792    #[derive(Clone, Debug)]
2793    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
2794
2795    impl GetOperation {
2796        pub(crate) fn new(
2797            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2798        ) -> Self {
2799            Self(RequestBuilder::new(stub))
2800        }
2801
2802        /// Sets the full request, replacing any prior values.
2803        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
2804            mut self,
2805            v: V,
2806        ) -> Self {
2807            self.0.request = v.into();
2808            self
2809        }
2810
2811        /// Sets all the options, replacing any prior values.
2812        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2813            self.0.options = v.into();
2814            self
2815        }
2816
2817        /// Sends the request.
2818        pub async fn send(self) -> Result<longrunning::model::Operation> {
2819            (*self.0.stub)
2820                .get_operation(self.0.request, self.0.options)
2821                .await
2822                .map(gax::response::Response::into_body)
2823        }
2824
2825        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
2826        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2827            self.0.request.name = v.into();
2828            self
2829        }
2830    }
2831
2832    #[doc(hidden)]
2833    impl gax::options::internal::RequestBuilder for GetOperation {
2834        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2835            &mut self.0.options
2836        }
2837    }
2838
2839    /// The request builder for [CrossNetworkAutomationService::delete_operation][crate::client::CrossNetworkAutomationService::delete_operation] calls.
2840    ///
2841    /// # Example
2842    /// ```
2843    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::DeleteOperation;
2844    /// # async fn sample() -> gax::Result<()> {
2845    ///
2846    /// let builder = prepare_request_builder();
2847    /// let response = builder.send().await?;
2848    /// # Ok(()) }
2849    ///
2850    /// fn prepare_request_builder() -> DeleteOperation {
2851    ///   # panic!();
2852    ///   // ... details omitted ...
2853    /// }
2854    /// ```
2855    #[derive(Clone, Debug)]
2856    pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
2857
2858    impl DeleteOperation {
2859        pub(crate) fn new(
2860            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2861        ) -> Self {
2862            Self(RequestBuilder::new(stub))
2863        }
2864
2865        /// Sets the full request, replacing any prior values.
2866        pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
2867            mut self,
2868            v: V,
2869        ) -> Self {
2870            self.0.request = v.into();
2871            self
2872        }
2873
2874        /// Sets all the options, replacing any prior values.
2875        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2876            self.0.options = v.into();
2877            self
2878        }
2879
2880        /// Sends the request.
2881        pub async fn send(self) -> Result<()> {
2882            (*self.0.stub)
2883                .delete_operation(self.0.request, self.0.options)
2884                .await
2885                .map(gax::response::Response::into_body)
2886        }
2887
2888        /// Sets the value of [name][longrunning::model::DeleteOperationRequest::name].
2889        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2890            self.0.request.name = v.into();
2891            self
2892        }
2893    }
2894
2895    #[doc(hidden)]
2896    impl gax::options::internal::RequestBuilder for DeleteOperation {
2897        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2898            &mut self.0.options
2899        }
2900    }
2901
2902    /// The request builder for [CrossNetworkAutomationService::cancel_operation][crate::client::CrossNetworkAutomationService::cancel_operation] calls.
2903    ///
2904    /// # Example
2905    /// ```
2906    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::CancelOperation;
2907    /// # async fn sample() -> gax::Result<()> {
2908    ///
2909    /// let builder = prepare_request_builder();
2910    /// let response = builder.send().await?;
2911    /// # Ok(()) }
2912    ///
2913    /// fn prepare_request_builder() -> CancelOperation {
2914    ///   # panic!();
2915    ///   // ... details omitted ...
2916    /// }
2917    /// ```
2918    #[derive(Clone, Debug)]
2919    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
2920
2921    impl CancelOperation {
2922        pub(crate) fn new(
2923            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2924        ) -> Self {
2925            Self(RequestBuilder::new(stub))
2926        }
2927
2928        /// Sets the full request, replacing any prior values.
2929        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
2930            mut self,
2931            v: V,
2932        ) -> Self {
2933            self.0.request = v.into();
2934            self
2935        }
2936
2937        /// Sets all the options, replacing any prior values.
2938        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2939            self.0.options = v.into();
2940            self
2941        }
2942
2943        /// Sends the request.
2944        pub async fn send(self) -> Result<()> {
2945            (*self.0.stub)
2946                .cancel_operation(self.0.request, self.0.options)
2947                .await
2948                .map(gax::response::Response::into_body)
2949        }
2950
2951        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
2952        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2953            self.0.request.name = v.into();
2954            self
2955        }
2956    }
2957
2958    #[doc(hidden)]
2959    impl gax::options::internal::RequestBuilder for CancelOperation {
2960        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2961            &mut self.0.options
2962        }
2963    }
2964}
2965
2966pub mod data_transfer_service {
2967    use crate::Result;
2968
2969    /// A builder for [DataTransferService][crate::client::DataTransferService].
2970    ///
2971    /// ```
2972    /// # async fn sample() -> gax::client_builder::Result<()> {
2973    /// # use google_cloud_networkconnectivity_v1::*;
2974    /// # use builder::data_transfer_service::ClientBuilder;
2975    /// # use client::DataTransferService;
2976    /// let builder : ClientBuilder = DataTransferService::builder();
2977    /// let client = builder
2978    ///     .with_endpoint("https://networkconnectivity.googleapis.com")
2979    ///     .build().await?;
2980    /// # Ok(()) }
2981    /// ```
2982    pub type ClientBuilder =
2983        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
2984
2985    pub(crate) mod client {
2986        use super::super::super::client::DataTransferService;
2987        pub struct Factory;
2988        impl gax::client_builder::internal::ClientFactory for Factory {
2989            type Client = DataTransferService;
2990            type Credentials = gaxi::options::Credentials;
2991            async fn build(
2992                self,
2993                config: gaxi::options::ClientConfig,
2994            ) -> gax::client_builder::Result<Self::Client> {
2995                Self::Client::new(config).await
2996            }
2997        }
2998    }
2999
3000    /// Common implementation for [crate::client::DataTransferService] request builders.
3001    #[derive(Clone, Debug)]
3002    pub(crate) struct RequestBuilder<R: std::default::Default> {
3003        stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3004        request: R,
3005        options: gax::options::RequestOptions,
3006    }
3007
3008    impl<R> RequestBuilder<R>
3009    where
3010        R: std::default::Default,
3011    {
3012        pub(crate) fn new(
3013            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3014        ) -> Self {
3015            Self {
3016                stub,
3017                request: R::default(),
3018                options: gax::options::RequestOptions::default(),
3019            }
3020        }
3021    }
3022
3023    /// The request builder for [DataTransferService::list_multicloud_data_transfer_configs][crate::client::DataTransferService::list_multicloud_data_transfer_configs] calls.
3024    ///
3025    /// # Example
3026    /// ```
3027    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::ListMulticloudDataTransferConfigs;
3028    /// # async fn sample() -> gax::Result<()> {
3029    /// use gax::paginator::ItemPaginator;
3030    ///
3031    /// let builder = prepare_request_builder();
3032    /// let mut items = builder.by_item();
3033    /// while let Some(result) = items.next().await {
3034    ///   let item = result?;
3035    /// }
3036    /// # Ok(()) }
3037    ///
3038    /// fn prepare_request_builder() -> ListMulticloudDataTransferConfigs {
3039    ///   # panic!();
3040    ///   // ... details omitted ...
3041    /// }
3042    /// ```
3043    #[derive(Clone, Debug)]
3044    pub struct ListMulticloudDataTransferConfigs(
3045        RequestBuilder<crate::model::ListMulticloudDataTransferConfigsRequest>,
3046    );
3047
3048    impl ListMulticloudDataTransferConfigs {
3049        pub(crate) fn new(
3050            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3051        ) -> Self {
3052            Self(RequestBuilder::new(stub))
3053        }
3054
3055        /// Sets the full request, replacing any prior values.
3056        pub fn with_request<V: Into<crate::model::ListMulticloudDataTransferConfigsRequest>>(
3057            mut self,
3058            v: V,
3059        ) -> Self {
3060            self.0.request = v.into();
3061            self
3062        }
3063
3064        /// Sets all the options, replacing any prior values.
3065        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3066            self.0.options = v.into();
3067            self
3068        }
3069
3070        /// Sends the request.
3071        pub async fn send(self) -> Result<crate::model::ListMulticloudDataTransferConfigsResponse> {
3072            (*self.0.stub)
3073                .list_multicloud_data_transfer_configs(self.0.request, self.0.options)
3074                .await
3075                .map(gax::response::Response::into_body)
3076        }
3077
3078        /// Streams each page in the collection.
3079        pub fn by_page(
3080            self,
3081        ) -> impl gax::paginator::Paginator<
3082            crate::model::ListMulticloudDataTransferConfigsResponse,
3083            gax::error::Error,
3084        > {
3085            use std::clone::Clone;
3086            let token = self.0.request.page_token.clone();
3087            let execute = move |token: String| {
3088                let mut builder = self.clone();
3089                builder.0.request = builder.0.request.set_page_token(token);
3090                builder.send()
3091            };
3092            gax::paginator::internal::new_paginator(token, execute)
3093        }
3094
3095        /// Streams each item in the collection.
3096        pub fn by_item(
3097            self,
3098        ) -> impl gax::paginator::ItemPaginator<
3099            crate::model::ListMulticloudDataTransferConfigsResponse,
3100            gax::error::Error,
3101        > {
3102            use gax::paginator::Paginator;
3103            self.by_page().items()
3104        }
3105
3106        /// Sets the value of [parent][crate::model::ListMulticloudDataTransferConfigsRequest::parent].
3107        ///
3108        /// This is a **required** field for requests.
3109        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3110            self.0.request.parent = v.into();
3111            self
3112        }
3113
3114        /// Sets the value of [page_size][crate::model::ListMulticloudDataTransferConfigsRequest::page_size].
3115        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3116            self.0.request.page_size = v.into();
3117            self
3118        }
3119
3120        /// Sets the value of [page_token][crate::model::ListMulticloudDataTransferConfigsRequest::page_token].
3121        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3122            self.0.request.page_token = v.into();
3123            self
3124        }
3125
3126        /// Sets the value of [filter][crate::model::ListMulticloudDataTransferConfigsRequest::filter].
3127        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3128            self.0.request.filter = v.into();
3129            self
3130        }
3131
3132        /// Sets the value of [order_by][crate::model::ListMulticloudDataTransferConfigsRequest::order_by].
3133        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3134            self.0.request.order_by = v.into();
3135            self
3136        }
3137
3138        /// Sets the value of [return_partial_success][crate::model::ListMulticloudDataTransferConfigsRequest::return_partial_success].
3139        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
3140            self.0.request.return_partial_success = v.into();
3141            self
3142        }
3143    }
3144
3145    #[doc(hidden)]
3146    impl gax::options::internal::RequestBuilder for ListMulticloudDataTransferConfigs {
3147        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3148            &mut self.0.options
3149        }
3150    }
3151
3152    /// The request builder for [DataTransferService::get_multicloud_data_transfer_config][crate::client::DataTransferService::get_multicloud_data_transfer_config] calls.
3153    ///
3154    /// # Example
3155    /// ```
3156    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::GetMulticloudDataTransferConfig;
3157    /// # async fn sample() -> gax::Result<()> {
3158    ///
3159    /// let builder = prepare_request_builder();
3160    /// let response = builder.send().await?;
3161    /// # Ok(()) }
3162    ///
3163    /// fn prepare_request_builder() -> GetMulticloudDataTransferConfig {
3164    ///   # panic!();
3165    ///   // ... details omitted ...
3166    /// }
3167    /// ```
3168    #[derive(Clone, Debug)]
3169    pub struct GetMulticloudDataTransferConfig(
3170        RequestBuilder<crate::model::GetMulticloudDataTransferConfigRequest>,
3171    );
3172
3173    impl GetMulticloudDataTransferConfig {
3174        pub(crate) fn new(
3175            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3176        ) -> Self {
3177            Self(RequestBuilder::new(stub))
3178        }
3179
3180        /// Sets the full request, replacing any prior values.
3181        pub fn with_request<V: Into<crate::model::GetMulticloudDataTransferConfigRequest>>(
3182            mut self,
3183            v: V,
3184        ) -> Self {
3185            self.0.request = v.into();
3186            self
3187        }
3188
3189        /// Sets all the options, replacing any prior values.
3190        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3191            self.0.options = v.into();
3192            self
3193        }
3194
3195        /// Sends the request.
3196        pub async fn send(self) -> Result<crate::model::MulticloudDataTransferConfig> {
3197            (*self.0.stub)
3198                .get_multicloud_data_transfer_config(self.0.request, self.0.options)
3199                .await
3200                .map(gax::response::Response::into_body)
3201        }
3202
3203        /// Sets the value of [name][crate::model::GetMulticloudDataTransferConfigRequest::name].
3204        ///
3205        /// This is a **required** field for requests.
3206        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3207            self.0.request.name = v.into();
3208            self
3209        }
3210    }
3211
3212    #[doc(hidden)]
3213    impl gax::options::internal::RequestBuilder for GetMulticloudDataTransferConfig {
3214        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3215            &mut self.0.options
3216        }
3217    }
3218
3219    /// The request builder for [DataTransferService::create_multicloud_data_transfer_config][crate::client::DataTransferService::create_multicloud_data_transfer_config] calls.
3220    ///
3221    /// # Example
3222    /// ```
3223    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::CreateMulticloudDataTransferConfig;
3224    /// # async fn sample() -> gax::Result<()> {
3225    /// use lro::Poller;
3226    ///
3227    /// let builder = prepare_request_builder();
3228    /// let response = builder.poller().until_done().await?;
3229    /// # Ok(()) }
3230    ///
3231    /// fn prepare_request_builder() -> CreateMulticloudDataTransferConfig {
3232    ///   # panic!();
3233    ///   // ... details omitted ...
3234    /// }
3235    /// ```
3236    #[derive(Clone, Debug)]
3237    pub struct CreateMulticloudDataTransferConfig(
3238        RequestBuilder<crate::model::CreateMulticloudDataTransferConfigRequest>,
3239    );
3240
3241    impl CreateMulticloudDataTransferConfig {
3242        pub(crate) fn new(
3243            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3244        ) -> Self {
3245            Self(RequestBuilder::new(stub))
3246        }
3247
3248        /// Sets the full request, replacing any prior values.
3249        pub fn with_request<V: Into<crate::model::CreateMulticloudDataTransferConfigRequest>>(
3250            mut self,
3251            v: V,
3252        ) -> Self {
3253            self.0.request = v.into();
3254            self
3255        }
3256
3257        /// Sets all the options, replacing any prior values.
3258        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3259            self.0.options = v.into();
3260            self
3261        }
3262
3263        /// Sends the request.
3264        ///
3265        /// # Long running operations
3266        ///
3267        /// This starts, but does not poll, a longrunning operation. More information
3268        /// on [create_multicloud_data_transfer_config][crate::client::DataTransferService::create_multicloud_data_transfer_config].
3269        pub async fn send(self) -> Result<longrunning::model::Operation> {
3270            (*self.0.stub)
3271                .create_multicloud_data_transfer_config(self.0.request, self.0.options)
3272                .await
3273                .map(gax::response::Response::into_body)
3274        }
3275
3276        /// Creates a [Poller][lro::Poller] to work with `create_multicloud_data_transfer_config`.
3277        pub fn poller(
3278            self,
3279        ) -> impl lro::Poller<crate::model::MulticloudDataTransferConfig, crate::model::OperationMetadata>
3280        {
3281            type Operation = lro::internal::Operation<
3282                crate::model::MulticloudDataTransferConfig,
3283                crate::model::OperationMetadata,
3284            >;
3285            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3286            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3287
3288            let stub = self.0.stub.clone();
3289            let mut options = self.0.options.clone();
3290            options.set_retry_policy(gax::retry_policy::NeverRetry);
3291            let query = move |name| {
3292                let stub = stub.clone();
3293                let options = options.clone();
3294                async {
3295                    let op = GetOperation::new(stub)
3296                        .set_name(name)
3297                        .with_options(options)
3298                        .send()
3299                        .await?;
3300                    Ok(Operation::new(op))
3301                }
3302            };
3303
3304            let start = move || async {
3305                let op = self.send().await?;
3306                Ok(Operation::new(op))
3307            };
3308
3309            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3310        }
3311
3312        /// Sets the value of [parent][crate::model::CreateMulticloudDataTransferConfigRequest::parent].
3313        ///
3314        /// This is a **required** field for requests.
3315        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3316            self.0.request.parent = v.into();
3317            self
3318        }
3319
3320        /// Sets the value of [multicloud_data_transfer_config_id][crate::model::CreateMulticloudDataTransferConfigRequest::multicloud_data_transfer_config_id].
3321        ///
3322        /// This is a **required** field for requests.
3323        pub fn set_multicloud_data_transfer_config_id<T: Into<std::string::String>>(
3324            mut self,
3325            v: T,
3326        ) -> Self {
3327            self.0.request.multicloud_data_transfer_config_id = v.into();
3328            self
3329        }
3330
3331        /// Sets the value of [multicloud_data_transfer_config][crate::model::CreateMulticloudDataTransferConfigRequest::multicloud_data_transfer_config].
3332        ///
3333        /// This is a **required** field for requests.
3334        pub fn set_multicloud_data_transfer_config<T>(mut self, v: T) -> Self
3335        where
3336            T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
3337        {
3338            self.0.request.multicloud_data_transfer_config = std::option::Option::Some(v.into());
3339            self
3340        }
3341
3342        /// Sets or clears the value of [multicloud_data_transfer_config][crate::model::CreateMulticloudDataTransferConfigRequest::multicloud_data_transfer_config].
3343        ///
3344        /// This is a **required** field for requests.
3345        pub fn set_or_clear_multicloud_data_transfer_config<T>(
3346            mut self,
3347            v: std::option::Option<T>,
3348        ) -> Self
3349        where
3350            T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
3351        {
3352            self.0.request.multicloud_data_transfer_config = v.map(|x| x.into());
3353            self
3354        }
3355
3356        /// Sets the value of [request_id][crate::model::CreateMulticloudDataTransferConfigRequest::request_id].
3357        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3358            self.0.request.request_id = v.into();
3359            self
3360        }
3361    }
3362
3363    #[doc(hidden)]
3364    impl gax::options::internal::RequestBuilder for CreateMulticloudDataTransferConfig {
3365        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3366            &mut self.0.options
3367        }
3368    }
3369
3370    /// The request builder for [DataTransferService::update_multicloud_data_transfer_config][crate::client::DataTransferService::update_multicloud_data_transfer_config] calls.
3371    ///
3372    /// # Example
3373    /// ```
3374    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::UpdateMulticloudDataTransferConfig;
3375    /// # async fn sample() -> gax::Result<()> {
3376    /// use lro::Poller;
3377    ///
3378    /// let builder = prepare_request_builder();
3379    /// let response = builder.poller().until_done().await?;
3380    /// # Ok(()) }
3381    ///
3382    /// fn prepare_request_builder() -> UpdateMulticloudDataTransferConfig {
3383    ///   # panic!();
3384    ///   // ... details omitted ...
3385    /// }
3386    /// ```
3387    #[derive(Clone, Debug)]
3388    pub struct UpdateMulticloudDataTransferConfig(
3389        RequestBuilder<crate::model::UpdateMulticloudDataTransferConfigRequest>,
3390    );
3391
3392    impl UpdateMulticloudDataTransferConfig {
3393        pub(crate) fn new(
3394            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3395        ) -> Self {
3396            Self(RequestBuilder::new(stub))
3397        }
3398
3399        /// Sets the full request, replacing any prior values.
3400        pub fn with_request<V: Into<crate::model::UpdateMulticloudDataTransferConfigRequest>>(
3401            mut self,
3402            v: V,
3403        ) -> Self {
3404            self.0.request = v.into();
3405            self
3406        }
3407
3408        /// Sets all the options, replacing any prior values.
3409        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3410            self.0.options = v.into();
3411            self
3412        }
3413
3414        /// Sends the request.
3415        ///
3416        /// # Long running operations
3417        ///
3418        /// This starts, but does not poll, a longrunning operation. More information
3419        /// on [update_multicloud_data_transfer_config][crate::client::DataTransferService::update_multicloud_data_transfer_config].
3420        pub async fn send(self) -> Result<longrunning::model::Operation> {
3421            (*self.0.stub)
3422                .update_multicloud_data_transfer_config(self.0.request, self.0.options)
3423                .await
3424                .map(gax::response::Response::into_body)
3425        }
3426
3427        /// Creates a [Poller][lro::Poller] to work with `update_multicloud_data_transfer_config`.
3428        pub fn poller(
3429            self,
3430        ) -> impl lro::Poller<crate::model::MulticloudDataTransferConfig, crate::model::OperationMetadata>
3431        {
3432            type Operation = lro::internal::Operation<
3433                crate::model::MulticloudDataTransferConfig,
3434                crate::model::OperationMetadata,
3435            >;
3436            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3437            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3438
3439            let stub = self.0.stub.clone();
3440            let mut options = self.0.options.clone();
3441            options.set_retry_policy(gax::retry_policy::NeverRetry);
3442            let query = move |name| {
3443                let stub = stub.clone();
3444                let options = options.clone();
3445                async {
3446                    let op = GetOperation::new(stub)
3447                        .set_name(name)
3448                        .with_options(options)
3449                        .send()
3450                        .await?;
3451                    Ok(Operation::new(op))
3452                }
3453            };
3454
3455            let start = move || async {
3456                let op = self.send().await?;
3457                Ok(Operation::new(op))
3458            };
3459
3460            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3461        }
3462
3463        /// Sets the value of [update_mask][crate::model::UpdateMulticloudDataTransferConfigRequest::update_mask].
3464        pub fn set_update_mask<T>(mut self, v: T) -> Self
3465        where
3466            T: std::convert::Into<wkt::FieldMask>,
3467        {
3468            self.0.request.update_mask = std::option::Option::Some(v.into());
3469            self
3470        }
3471
3472        /// Sets or clears the value of [update_mask][crate::model::UpdateMulticloudDataTransferConfigRequest::update_mask].
3473        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3474        where
3475            T: std::convert::Into<wkt::FieldMask>,
3476        {
3477            self.0.request.update_mask = v.map(|x| x.into());
3478            self
3479        }
3480
3481        /// Sets the value of [multicloud_data_transfer_config][crate::model::UpdateMulticloudDataTransferConfigRequest::multicloud_data_transfer_config].
3482        ///
3483        /// This is a **required** field for requests.
3484        pub fn set_multicloud_data_transfer_config<T>(mut self, v: T) -> Self
3485        where
3486            T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
3487        {
3488            self.0.request.multicloud_data_transfer_config = std::option::Option::Some(v.into());
3489            self
3490        }
3491
3492        /// Sets or clears the value of [multicloud_data_transfer_config][crate::model::UpdateMulticloudDataTransferConfigRequest::multicloud_data_transfer_config].
3493        ///
3494        /// This is a **required** field for requests.
3495        pub fn set_or_clear_multicloud_data_transfer_config<T>(
3496            mut self,
3497            v: std::option::Option<T>,
3498        ) -> Self
3499        where
3500            T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
3501        {
3502            self.0.request.multicloud_data_transfer_config = v.map(|x| x.into());
3503            self
3504        }
3505
3506        /// Sets the value of [request_id][crate::model::UpdateMulticloudDataTransferConfigRequest::request_id].
3507        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3508            self.0.request.request_id = v.into();
3509            self
3510        }
3511    }
3512
3513    #[doc(hidden)]
3514    impl gax::options::internal::RequestBuilder for UpdateMulticloudDataTransferConfig {
3515        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3516            &mut self.0.options
3517        }
3518    }
3519
3520    /// The request builder for [DataTransferService::delete_multicloud_data_transfer_config][crate::client::DataTransferService::delete_multicloud_data_transfer_config] calls.
3521    ///
3522    /// # Example
3523    /// ```
3524    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::DeleteMulticloudDataTransferConfig;
3525    /// # async fn sample() -> gax::Result<()> {
3526    /// use lro::Poller;
3527    ///
3528    /// let builder = prepare_request_builder();
3529    /// let response = builder.poller().until_done().await?;
3530    /// # Ok(()) }
3531    ///
3532    /// fn prepare_request_builder() -> DeleteMulticloudDataTransferConfig {
3533    ///   # panic!();
3534    ///   // ... details omitted ...
3535    /// }
3536    /// ```
3537    #[derive(Clone, Debug)]
3538    pub struct DeleteMulticloudDataTransferConfig(
3539        RequestBuilder<crate::model::DeleteMulticloudDataTransferConfigRequest>,
3540    );
3541
3542    impl DeleteMulticloudDataTransferConfig {
3543        pub(crate) fn new(
3544            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3545        ) -> Self {
3546            Self(RequestBuilder::new(stub))
3547        }
3548
3549        /// Sets the full request, replacing any prior values.
3550        pub fn with_request<V: Into<crate::model::DeleteMulticloudDataTransferConfigRequest>>(
3551            mut self,
3552            v: V,
3553        ) -> Self {
3554            self.0.request = v.into();
3555            self
3556        }
3557
3558        /// Sets all the options, replacing any prior values.
3559        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3560            self.0.options = v.into();
3561            self
3562        }
3563
3564        /// Sends the request.
3565        ///
3566        /// # Long running operations
3567        ///
3568        /// This starts, but does not poll, a longrunning operation. More information
3569        /// on [delete_multicloud_data_transfer_config][crate::client::DataTransferService::delete_multicloud_data_transfer_config].
3570        pub async fn send(self) -> Result<longrunning::model::Operation> {
3571            (*self.0.stub)
3572                .delete_multicloud_data_transfer_config(self.0.request, self.0.options)
3573                .await
3574                .map(gax::response::Response::into_body)
3575        }
3576
3577        /// Creates a [Poller][lro::Poller] to work with `delete_multicloud_data_transfer_config`.
3578        pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
3579            type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
3580            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3581            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3582
3583            let stub = self.0.stub.clone();
3584            let mut options = self.0.options.clone();
3585            options.set_retry_policy(gax::retry_policy::NeverRetry);
3586            let query = move |name| {
3587                let stub = stub.clone();
3588                let options = options.clone();
3589                async {
3590                    let op = GetOperation::new(stub)
3591                        .set_name(name)
3592                        .with_options(options)
3593                        .send()
3594                        .await?;
3595                    Ok(Operation::new(op))
3596                }
3597            };
3598
3599            let start = move || async {
3600                let op = self.send().await?;
3601                Ok(Operation::new(op))
3602            };
3603
3604            lro::internal::new_unit_response_poller(
3605                polling_error_policy,
3606                polling_backoff_policy,
3607                start,
3608                query,
3609            )
3610        }
3611
3612        /// Sets the value of [name][crate::model::DeleteMulticloudDataTransferConfigRequest::name].
3613        ///
3614        /// This is a **required** field for requests.
3615        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3616            self.0.request.name = v.into();
3617            self
3618        }
3619
3620        /// Sets the value of [request_id][crate::model::DeleteMulticloudDataTransferConfigRequest::request_id].
3621        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3622            self.0.request.request_id = v.into();
3623            self
3624        }
3625
3626        /// Sets the value of [etag][crate::model::DeleteMulticloudDataTransferConfigRequest::etag].
3627        pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
3628            self.0.request.etag = v.into();
3629            self
3630        }
3631    }
3632
3633    #[doc(hidden)]
3634    impl gax::options::internal::RequestBuilder for DeleteMulticloudDataTransferConfig {
3635        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3636            &mut self.0.options
3637        }
3638    }
3639
3640    /// The request builder for [DataTransferService::list_destinations][crate::client::DataTransferService::list_destinations] calls.
3641    ///
3642    /// # Example
3643    /// ```
3644    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::ListDestinations;
3645    /// # async fn sample() -> gax::Result<()> {
3646    /// use gax::paginator::ItemPaginator;
3647    ///
3648    /// let builder = prepare_request_builder();
3649    /// let mut items = builder.by_item();
3650    /// while let Some(result) = items.next().await {
3651    ///   let item = result?;
3652    /// }
3653    /// # Ok(()) }
3654    ///
3655    /// fn prepare_request_builder() -> ListDestinations {
3656    ///   # panic!();
3657    ///   // ... details omitted ...
3658    /// }
3659    /// ```
3660    #[derive(Clone, Debug)]
3661    pub struct ListDestinations(RequestBuilder<crate::model::ListDestinationsRequest>);
3662
3663    impl ListDestinations {
3664        pub(crate) fn new(
3665            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3666        ) -> Self {
3667            Self(RequestBuilder::new(stub))
3668        }
3669
3670        /// Sets the full request, replacing any prior values.
3671        pub fn with_request<V: Into<crate::model::ListDestinationsRequest>>(
3672            mut self,
3673            v: V,
3674        ) -> Self {
3675            self.0.request = v.into();
3676            self
3677        }
3678
3679        /// Sets all the options, replacing any prior values.
3680        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3681            self.0.options = v.into();
3682            self
3683        }
3684
3685        /// Sends the request.
3686        pub async fn send(self) -> Result<crate::model::ListDestinationsResponse> {
3687            (*self.0.stub)
3688                .list_destinations(self.0.request, self.0.options)
3689                .await
3690                .map(gax::response::Response::into_body)
3691        }
3692
3693        /// Streams each page in the collection.
3694        pub fn by_page(
3695            self,
3696        ) -> impl gax::paginator::Paginator<crate::model::ListDestinationsResponse, gax::error::Error>
3697        {
3698            use std::clone::Clone;
3699            let token = self.0.request.page_token.clone();
3700            let execute = move |token: String| {
3701                let mut builder = self.clone();
3702                builder.0.request = builder.0.request.set_page_token(token);
3703                builder.send()
3704            };
3705            gax::paginator::internal::new_paginator(token, execute)
3706        }
3707
3708        /// Streams each item in the collection.
3709        pub fn by_item(
3710            self,
3711        ) -> impl gax::paginator::ItemPaginator<crate::model::ListDestinationsResponse, gax::error::Error>
3712        {
3713            use gax::paginator::Paginator;
3714            self.by_page().items()
3715        }
3716
3717        /// Sets the value of [parent][crate::model::ListDestinationsRequest::parent].
3718        ///
3719        /// This is a **required** field for requests.
3720        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3721            self.0.request.parent = v.into();
3722            self
3723        }
3724
3725        /// Sets the value of [page_size][crate::model::ListDestinationsRequest::page_size].
3726        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3727            self.0.request.page_size = v.into();
3728            self
3729        }
3730
3731        /// Sets the value of [page_token][crate::model::ListDestinationsRequest::page_token].
3732        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3733            self.0.request.page_token = v.into();
3734            self
3735        }
3736
3737        /// Sets the value of [filter][crate::model::ListDestinationsRequest::filter].
3738        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3739            self.0.request.filter = v.into();
3740            self
3741        }
3742
3743        /// Sets the value of [order_by][crate::model::ListDestinationsRequest::order_by].
3744        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3745            self.0.request.order_by = v.into();
3746            self
3747        }
3748
3749        /// Sets the value of [return_partial_success][crate::model::ListDestinationsRequest::return_partial_success].
3750        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
3751            self.0.request.return_partial_success = v.into();
3752            self
3753        }
3754    }
3755
3756    #[doc(hidden)]
3757    impl gax::options::internal::RequestBuilder for ListDestinations {
3758        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3759            &mut self.0.options
3760        }
3761    }
3762
3763    /// The request builder for [DataTransferService::get_destination][crate::client::DataTransferService::get_destination] calls.
3764    ///
3765    /// # Example
3766    /// ```
3767    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::GetDestination;
3768    /// # async fn sample() -> gax::Result<()> {
3769    ///
3770    /// let builder = prepare_request_builder();
3771    /// let response = builder.send().await?;
3772    /// # Ok(()) }
3773    ///
3774    /// fn prepare_request_builder() -> GetDestination {
3775    ///   # panic!();
3776    ///   // ... details omitted ...
3777    /// }
3778    /// ```
3779    #[derive(Clone, Debug)]
3780    pub struct GetDestination(RequestBuilder<crate::model::GetDestinationRequest>);
3781
3782    impl GetDestination {
3783        pub(crate) fn new(
3784            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3785        ) -> Self {
3786            Self(RequestBuilder::new(stub))
3787        }
3788
3789        /// Sets the full request, replacing any prior values.
3790        pub fn with_request<V: Into<crate::model::GetDestinationRequest>>(mut self, v: V) -> Self {
3791            self.0.request = v.into();
3792            self
3793        }
3794
3795        /// Sets all the options, replacing any prior values.
3796        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3797            self.0.options = v.into();
3798            self
3799        }
3800
3801        /// Sends the request.
3802        pub async fn send(self) -> Result<crate::model::Destination> {
3803            (*self.0.stub)
3804                .get_destination(self.0.request, self.0.options)
3805                .await
3806                .map(gax::response::Response::into_body)
3807        }
3808
3809        /// Sets the value of [name][crate::model::GetDestinationRequest::name].
3810        ///
3811        /// This is a **required** field for requests.
3812        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3813            self.0.request.name = v.into();
3814            self
3815        }
3816    }
3817
3818    #[doc(hidden)]
3819    impl gax::options::internal::RequestBuilder for GetDestination {
3820        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3821            &mut self.0.options
3822        }
3823    }
3824
3825    /// The request builder for [DataTransferService::create_destination][crate::client::DataTransferService::create_destination] calls.
3826    ///
3827    /// # Example
3828    /// ```
3829    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::CreateDestination;
3830    /// # async fn sample() -> gax::Result<()> {
3831    /// use lro::Poller;
3832    ///
3833    /// let builder = prepare_request_builder();
3834    /// let response = builder.poller().until_done().await?;
3835    /// # Ok(()) }
3836    ///
3837    /// fn prepare_request_builder() -> CreateDestination {
3838    ///   # panic!();
3839    ///   // ... details omitted ...
3840    /// }
3841    /// ```
3842    #[derive(Clone, Debug)]
3843    pub struct CreateDestination(RequestBuilder<crate::model::CreateDestinationRequest>);
3844
3845    impl CreateDestination {
3846        pub(crate) fn new(
3847            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3848        ) -> Self {
3849            Self(RequestBuilder::new(stub))
3850        }
3851
3852        /// Sets the full request, replacing any prior values.
3853        pub fn with_request<V: Into<crate::model::CreateDestinationRequest>>(
3854            mut self,
3855            v: V,
3856        ) -> Self {
3857            self.0.request = v.into();
3858            self
3859        }
3860
3861        /// Sets all the options, replacing any prior values.
3862        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3863            self.0.options = v.into();
3864            self
3865        }
3866
3867        /// Sends the request.
3868        ///
3869        /// # Long running operations
3870        ///
3871        /// This starts, but does not poll, a longrunning operation. More information
3872        /// on [create_destination][crate::client::DataTransferService::create_destination].
3873        pub async fn send(self) -> Result<longrunning::model::Operation> {
3874            (*self.0.stub)
3875                .create_destination(self.0.request, self.0.options)
3876                .await
3877                .map(gax::response::Response::into_body)
3878        }
3879
3880        /// Creates a [Poller][lro::Poller] to work with `create_destination`.
3881        pub fn poller(
3882            self,
3883        ) -> impl lro::Poller<crate::model::Destination, crate::model::OperationMetadata> {
3884            type Operation = lro::internal::Operation<
3885                crate::model::Destination,
3886                crate::model::OperationMetadata,
3887            >;
3888            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3889            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3890
3891            let stub = self.0.stub.clone();
3892            let mut options = self.0.options.clone();
3893            options.set_retry_policy(gax::retry_policy::NeverRetry);
3894            let query = move |name| {
3895                let stub = stub.clone();
3896                let options = options.clone();
3897                async {
3898                    let op = GetOperation::new(stub)
3899                        .set_name(name)
3900                        .with_options(options)
3901                        .send()
3902                        .await?;
3903                    Ok(Operation::new(op))
3904                }
3905            };
3906
3907            let start = move || async {
3908                let op = self.send().await?;
3909                Ok(Operation::new(op))
3910            };
3911
3912            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3913        }
3914
3915        /// Sets the value of [parent][crate::model::CreateDestinationRequest::parent].
3916        ///
3917        /// This is a **required** field for requests.
3918        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3919            self.0.request.parent = v.into();
3920            self
3921        }
3922
3923        /// Sets the value of [destination_id][crate::model::CreateDestinationRequest::destination_id].
3924        ///
3925        /// This is a **required** field for requests.
3926        pub fn set_destination_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3927            self.0.request.destination_id = v.into();
3928            self
3929        }
3930
3931        /// Sets the value of [destination][crate::model::CreateDestinationRequest::destination].
3932        ///
3933        /// This is a **required** field for requests.
3934        pub fn set_destination<T>(mut self, v: T) -> Self
3935        where
3936            T: std::convert::Into<crate::model::Destination>,
3937        {
3938            self.0.request.destination = std::option::Option::Some(v.into());
3939            self
3940        }
3941
3942        /// Sets or clears the value of [destination][crate::model::CreateDestinationRequest::destination].
3943        ///
3944        /// This is a **required** field for requests.
3945        pub fn set_or_clear_destination<T>(mut self, v: std::option::Option<T>) -> Self
3946        where
3947            T: std::convert::Into<crate::model::Destination>,
3948        {
3949            self.0.request.destination = v.map(|x| x.into());
3950            self
3951        }
3952
3953        /// Sets the value of [request_id][crate::model::CreateDestinationRequest::request_id].
3954        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3955            self.0.request.request_id = v.into();
3956            self
3957        }
3958    }
3959
3960    #[doc(hidden)]
3961    impl gax::options::internal::RequestBuilder for CreateDestination {
3962        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3963            &mut self.0.options
3964        }
3965    }
3966
3967    /// The request builder for [DataTransferService::update_destination][crate::client::DataTransferService::update_destination] calls.
3968    ///
3969    /// # Example
3970    /// ```
3971    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::UpdateDestination;
3972    /// # async fn sample() -> gax::Result<()> {
3973    /// use lro::Poller;
3974    ///
3975    /// let builder = prepare_request_builder();
3976    /// let response = builder.poller().until_done().await?;
3977    /// # Ok(()) }
3978    ///
3979    /// fn prepare_request_builder() -> UpdateDestination {
3980    ///   # panic!();
3981    ///   // ... details omitted ...
3982    /// }
3983    /// ```
3984    #[derive(Clone, Debug)]
3985    pub struct UpdateDestination(RequestBuilder<crate::model::UpdateDestinationRequest>);
3986
3987    impl UpdateDestination {
3988        pub(crate) fn new(
3989            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3990        ) -> Self {
3991            Self(RequestBuilder::new(stub))
3992        }
3993
3994        /// Sets the full request, replacing any prior values.
3995        pub fn with_request<V: Into<crate::model::UpdateDestinationRequest>>(
3996            mut self,
3997            v: V,
3998        ) -> Self {
3999            self.0.request = v.into();
4000            self
4001        }
4002
4003        /// Sets all the options, replacing any prior values.
4004        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4005            self.0.options = v.into();
4006            self
4007        }
4008
4009        /// Sends the request.
4010        ///
4011        /// # Long running operations
4012        ///
4013        /// This starts, but does not poll, a longrunning operation. More information
4014        /// on [update_destination][crate::client::DataTransferService::update_destination].
4015        pub async fn send(self) -> Result<longrunning::model::Operation> {
4016            (*self.0.stub)
4017                .update_destination(self.0.request, self.0.options)
4018                .await
4019                .map(gax::response::Response::into_body)
4020        }
4021
4022        /// Creates a [Poller][lro::Poller] to work with `update_destination`.
4023        pub fn poller(
4024            self,
4025        ) -> impl lro::Poller<crate::model::Destination, crate::model::OperationMetadata> {
4026            type Operation = lro::internal::Operation<
4027                crate::model::Destination,
4028                crate::model::OperationMetadata,
4029            >;
4030            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4031            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4032
4033            let stub = self.0.stub.clone();
4034            let mut options = self.0.options.clone();
4035            options.set_retry_policy(gax::retry_policy::NeverRetry);
4036            let query = move |name| {
4037                let stub = stub.clone();
4038                let options = options.clone();
4039                async {
4040                    let op = GetOperation::new(stub)
4041                        .set_name(name)
4042                        .with_options(options)
4043                        .send()
4044                        .await?;
4045                    Ok(Operation::new(op))
4046                }
4047            };
4048
4049            let start = move || async {
4050                let op = self.send().await?;
4051                Ok(Operation::new(op))
4052            };
4053
4054            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
4055        }
4056
4057        /// Sets the value of [update_mask][crate::model::UpdateDestinationRequest::update_mask].
4058        pub fn set_update_mask<T>(mut self, v: T) -> Self
4059        where
4060            T: std::convert::Into<wkt::FieldMask>,
4061        {
4062            self.0.request.update_mask = std::option::Option::Some(v.into());
4063            self
4064        }
4065
4066        /// Sets or clears the value of [update_mask][crate::model::UpdateDestinationRequest::update_mask].
4067        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4068        where
4069            T: std::convert::Into<wkt::FieldMask>,
4070        {
4071            self.0.request.update_mask = v.map(|x| x.into());
4072            self
4073        }
4074
4075        /// Sets the value of [destination][crate::model::UpdateDestinationRequest::destination].
4076        ///
4077        /// This is a **required** field for requests.
4078        pub fn set_destination<T>(mut self, v: T) -> Self
4079        where
4080            T: std::convert::Into<crate::model::Destination>,
4081        {
4082            self.0.request.destination = std::option::Option::Some(v.into());
4083            self
4084        }
4085
4086        /// Sets or clears the value of [destination][crate::model::UpdateDestinationRequest::destination].
4087        ///
4088        /// This is a **required** field for requests.
4089        pub fn set_or_clear_destination<T>(mut self, v: std::option::Option<T>) -> Self
4090        where
4091            T: std::convert::Into<crate::model::Destination>,
4092        {
4093            self.0.request.destination = v.map(|x| x.into());
4094            self
4095        }
4096
4097        /// Sets the value of [request_id][crate::model::UpdateDestinationRequest::request_id].
4098        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4099            self.0.request.request_id = v.into();
4100            self
4101        }
4102    }
4103
4104    #[doc(hidden)]
4105    impl gax::options::internal::RequestBuilder for UpdateDestination {
4106        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4107            &mut self.0.options
4108        }
4109    }
4110
4111    /// The request builder for [DataTransferService::delete_destination][crate::client::DataTransferService::delete_destination] calls.
4112    ///
4113    /// # Example
4114    /// ```
4115    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::DeleteDestination;
4116    /// # async fn sample() -> gax::Result<()> {
4117    /// use lro::Poller;
4118    ///
4119    /// let builder = prepare_request_builder();
4120    /// let response = builder.poller().until_done().await?;
4121    /// # Ok(()) }
4122    ///
4123    /// fn prepare_request_builder() -> DeleteDestination {
4124    ///   # panic!();
4125    ///   // ... details omitted ...
4126    /// }
4127    /// ```
4128    #[derive(Clone, Debug)]
4129    pub struct DeleteDestination(RequestBuilder<crate::model::DeleteDestinationRequest>);
4130
4131    impl DeleteDestination {
4132        pub(crate) fn new(
4133            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4134        ) -> Self {
4135            Self(RequestBuilder::new(stub))
4136        }
4137
4138        /// Sets the full request, replacing any prior values.
4139        pub fn with_request<V: Into<crate::model::DeleteDestinationRequest>>(
4140            mut self,
4141            v: V,
4142        ) -> Self {
4143            self.0.request = v.into();
4144            self
4145        }
4146
4147        /// Sets all the options, replacing any prior values.
4148        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4149            self.0.options = v.into();
4150            self
4151        }
4152
4153        /// Sends the request.
4154        ///
4155        /// # Long running operations
4156        ///
4157        /// This starts, but does not poll, a longrunning operation. More information
4158        /// on [delete_destination][crate::client::DataTransferService::delete_destination].
4159        pub async fn send(self) -> Result<longrunning::model::Operation> {
4160            (*self.0.stub)
4161                .delete_destination(self.0.request, self.0.options)
4162                .await
4163                .map(gax::response::Response::into_body)
4164        }
4165
4166        /// Creates a [Poller][lro::Poller] to work with `delete_destination`.
4167        pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
4168            type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
4169            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4170            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4171
4172            let stub = self.0.stub.clone();
4173            let mut options = self.0.options.clone();
4174            options.set_retry_policy(gax::retry_policy::NeverRetry);
4175            let query = move |name| {
4176                let stub = stub.clone();
4177                let options = options.clone();
4178                async {
4179                    let op = GetOperation::new(stub)
4180                        .set_name(name)
4181                        .with_options(options)
4182                        .send()
4183                        .await?;
4184                    Ok(Operation::new(op))
4185                }
4186            };
4187
4188            let start = move || async {
4189                let op = self.send().await?;
4190                Ok(Operation::new(op))
4191            };
4192
4193            lro::internal::new_unit_response_poller(
4194                polling_error_policy,
4195                polling_backoff_policy,
4196                start,
4197                query,
4198            )
4199        }
4200
4201        /// Sets the value of [name][crate::model::DeleteDestinationRequest::name].
4202        ///
4203        /// This is a **required** field for requests.
4204        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4205            self.0.request.name = v.into();
4206            self
4207        }
4208
4209        /// Sets the value of [request_id][crate::model::DeleteDestinationRequest::request_id].
4210        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4211            self.0.request.request_id = v.into();
4212            self
4213        }
4214
4215        /// Sets the value of [etag][crate::model::DeleteDestinationRequest::etag].
4216        pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
4217            self.0.request.etag = v.into();
4218            self
4219        }
4220    }
4221
4222    #[doc(hidden)]
4223    impl gax::options::internal::RequestBuilder for DeleteDestination {
4224        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4225            &mut self.0.options
4226        }
4227    }
4228
4229    /// The request builder for [DataTransferService::get_multicloud_data_transfer_supported_service][crate::client::DataTransferService::get_multicloud_data_transfer_supported_service] calls.
4230    ///
4231    /// # Example
4232    /// ```
4233    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::GetMulticloudDataTransferSupportedService;
4234    /// # async fn sample() -> gax::Result<()> {
4235    ///
4236    /// let builder = prepare_request_builder();
4237    /// let response = builder.send().await?;
4238    /// # Ok(()) }
4239    ///
4240    /// fn prepare_request_builder() -> GetMulticloudDataTransferSupportedService {
4241    ///   # panic!();
4242    ///   // ... details omitted ...
4243    /// }
4244    /// ```
4245    #[derive(Clone, Debug)]
4246    pub struct GetMulticloudDataTransferSupportedService(
4247        RequestBuilder<crate::model::GetMulticloudDataTransferSupportedServiceRequest>,
4248    );
4249
4250    impl GetMulticloudDataTransferSupportedService {
4251        pub(crate) fn new(
4252            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4253        ) -> Self {
4254            Self(RequestBuilder::new(stub))
4255        }
4256
4257        /// Sets the full request, replacing any prior values.
4258        pub fn with_request<
4259            V: Into<crate::model::GetMulticloudDataTransferSupportedServiceRequest>,
4260        >(
4261            mut self,
4262            v: V,
4263        ) -> Self {
4264            self.0.request = v.into();
4265            self
4266        }
4267
4268        /// Sets all the options, replacing any prior values.
4269        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4270            self.0.options = v.into();
4271            self
4272        }
4273
4274        /// Sends the request.
4275        pub async fn send(self) -> Result<crate::model::MulticloudDataTransferSupportedService> {
4276            (*self.0.stub)
4277                .get_multicloud_data_transfer_supported_service(self.0.request, self.0.options)
4278                .await
4279                .map(gax::response::Response::into_body)
4280        }
4281
4282        /// Sets the value of [name][crate::model::GetMulticloudDataTransferSupportedServiceRequest::name].
4283        ///
4284        /// This is a **required** field for requests.
4285        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4286            self.0.request.name = v.into();
4287            self
4288        }
4289    }
4290
4291    #[doc(hidden)]
4292    impl gax::options::internal::RequestBuilder for GetMulticloudDataTransferSupportedService {
4293        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4294            &mut self.0.options
4295        }
4296    }
4297
4298    /// The request builder for [DataTransferService::list_multicloud_data_transfer_supported_services][crate::client::DataTransferService::list_multicloud_data_transfer_supported_services] calls.
4299    ///
4300    /// # Example
4301    /// ```
4302    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::ListMulticloudDataTransferSupportedServices;
4303    /// # async fn sample() -> gax::Result<()> {
4304    /// use gax::paginator::ItemPaginator;
4305    ///
4306    /// let builder = prepare_request_builder();
4307    /// let mut items = builder.by_item();
4308    /// while let Some(result) = items.next().await {
4309    ///   let item = result?;
4310    /// }
4311    /// # Ok(()) }
4312    ///
4313    /// fn prepare_request_builder() -> ListMulticloudDataTransferSupportedServices {
4314    ///   # panic!();
4315    ///   // ... details omitted ...
4316    /// }
4317    /// ```
4318    #[derive(Clone, Debug)]
4319    pub struct ListMulticloudDataTransferSupportedServices(
4320        RequestBuilder<crate::model::ListMulticloudDataTransferSupportedServicesRequest>,
4321    );
4322
4323    impl ListMulticloudDataTransferSupportedServices {
4324        pub(crate) fn new(
4325            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4326        ) -> Self {
4327            Self(RequestBuilder::new(stub))
4328        }
4329
4330        /// Sets the full request, replacing any prior values.
4331        pub fn with_request<
4332            V: Into<crate::model::ListMulticloudDataTransferSupportedServicesRequest>,
4333        >(
4334            mut self,
4335            v: V,
4336        ) -> Self {
4337            self.0.request = v.into();
4338            self
4339        }
4340
4341        /// Sets all the options, replacing any prior values.
4342        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4343            self.0.options = v.into();
4344            self
4345        }
4346
4347        /// Sends the request.
4348        pub async fn send(
4349            self,
4350        ) -> Result<crate::model::ListMulticloudDataTransferSupportedServicesResponse> {
4351            (*self.0.stub)
4352                .list_multicloud_data_transfer_supported_services(self.0.request, self.0.options)
4353                .await
4354                .map(gax::response::Response::into_body)
4355        }
4356
4357        /// Streams each page in the collection.
4358        pub fn by_page(
4359            self,
4360        ) -> impl gax::paginator::Paginator<
4361            crate::model::ListMulticloudDataTransferSupportedServicesResponse,
4362            gax::error::Error,
4363        > {
4364            use std::clone::Clone;
4365            let token = self.0.request.page_token.clone();
4366            let execute = move |token: String| {
4367                let mut builder = self.clone();
4368                builder.0.request = builder.0.request.set_page_token(token);
4369                builder.send()
4370            };
4371            gax::paginator::internal::new_paginator(token, execute)
4372        }
4373
4374        /// Streams each item in the collection.
4375        pub fn by_item(
4376            self,
4377        ) -> impl gax::paginator::ItemPaginator<
4378            crate::model::ListMulticloudDataTransferSupportedServicesResponse,
4379            gax::error::Error,
4380        > {
4381            use gax::paginator::Paginator;
4382            self.by_page().items()
4383        }
4384
4385        /// Sets the value of [parent][crate::model::ListMulticloudDataTransferSupportedServicesRequest::parent].
4386        ///
4387        /// This is a **required** field for requests.
4388        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4389            self.0.request.parent = v.into();
4390            self
4391        }
4392
4393        /// Sets the value of [page_size][crate::model::ListMulticloudDataTransferSupportedServicesRequest::page_size].
4394        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4395            self.0.request.page_size = v.into();
4396            self
4397        }
4398
4399        /// Sets the value of [page_token][crate::model::ListMulticloudDataTransferSupportedServicesRequest::page_token].
4400        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4401            self.0.request.page_token = v.into();
4402            self
4403        }
4404    }
4405
4406    #[doc(hidden)]
4407    impl gax::options::internal::RequestBuilder for ListMulticloudDataTransferSupportedServices {
4408        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4409            &mut self.0.options
4410        }
4411    }
4412
4413    /// The request builder for [DataTransferService::list_locations][crate::client::DataTransferService::list_locations] calls.
4414    ///
4415    /// # Example
4416    /// ```
4417    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::ListLocations;
4418    /// # async fn sample() -> gax::Result<()> {
4419    /// use gax::paginator::ItemPaginator;
4420    ///
4421    /// let builder = prepare_request_builder();
4422    /// let mut items = builder.by_item();
4423    /// while let Some(result) = items.next().await {
4424    ///   let item = result?;
4425    /// }
4426    /// # Ok(()) }
4427    ///
4428    /// fn prepare_request_builder() -> ListLocations {
4429    ///   # panic!();
4430    ///   // ... details omitted ...
4431    /// }
4432    /// ```
4433    #[derive(Clone, Debug)]
4434    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
4435
4436    impl ListLocations {
4437        pub(crate) fn new(
4438            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4439        ) -> Self {
4440            Self(RequestBuilder::new(stub))
4441        }
4442
4443        /// Sets the full request, replacing any prior values.
4444        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
4445            mut self,
4446            v: V,
4447        ) -> Self {
4448            self.0.request = v.into();
4449            self
4450        }
4451
4452        /// Sets all the options, replacing any prior values.
4453        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4454            self.0.options = v.into();
4455            self
4456        }
4457
4458        /// Sends the request.
4459        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
4460            (*self.0.stub)
4461                .list_locations(self.0.request, self.0.options)
4462                .await
4463                .map(gax::response::Response::into_body)
4464        }
4465
4466        /// Streams each page in the collection.
4467        pub fn by_page(
4468            self,
4469        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
4470        {
4471            use std::clone::Clone;
4472            let token = self.0.request.page_token.clone();
4473            let execute = move |token: String| {
4474                let mut builder = self.clone();
4475                builder.0.request = builder.0.request.set_page_token(token);
4476                builder.send()
4477            };
4478            gax::paginator::internal::new_paginator(token, execute)
4479        }
4480
4481        /// Streams each item in the collection.
4482        pub fn by_item(
4483            self,
4484        ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
4485        {
4486            use gax::paginator::Paginator;
4487            self.by_page().items()
4488        }
4489
4490        /// Sets the value of [name][location::model::ListLocationsRequest::name].
4491        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4492            self.0.request.name = v.into();
4493            self
4494        }
4495
4496        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
4497        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4498            self.0.request.filter = v.into();
4499            self
4500        }
4501
4502        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
4503        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4504            self.0.request.page_size = v.into();
4505            self
4506        }
4507
4508        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
4509        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4510            self.0.request.page_token = v.into();
4511            self
4512        }
4513    }
4514
4515    #[doc(hidden)]
4516    impl gax::options::internal::RequestBuilder for ListLocations {
4517        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4518            &mut self.0.options
4519        }
4520    }
4521
4522    /// The request builder for [DataTransferService::get_location][crate::client::DataTransferService::get_location] calls.
4523    ///
4524    /// # Example
4525    /// ```
4526    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::GetLocation;
4527    /// # async fn sample() -> gax::Result<()> {
4528    ///
4529    /// let builder = prepare_request_builder();
4530    /// let response = builder.send().await?;
4531    /// # Ok(()) }
4532    ///
4533    /// fn prepare_request_builder() -> GetLocation {
4534    ///   # panic!();
4535    ///   // ... details omitted ...
4536    /// }
4537    /// ```
4538    #[derive(Clone, Debug)]
4539    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
4540
4541    impl GetLocation {
4542        pub(crate) fn new(
4543            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4544        ) -> Self {
4545            Self(RequestBuilder::new(stub))
4546        }
4547
4548        /// Sets the full request, replacing any prior values.
4549        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
4550            self.0.request = v.into();
4551            self
4552        }
4553
4554        /// Sets all the options, replacing any prior values.
4555        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4556            self.0.options = v.into();
4557            self
4558        }
4559
4560        /// Sends the request.
4561        pub async fn send(self) -> Result<location::model::Location> {
4562            (*self.0.stub)
4563                .get_location(self.0.request, self.0.options)
4564                .await
4565                .map(gax::response::Response::into_body)
4566        }
4567
4568        /// Sets the value of [name][location::model::GetLocationRequest::name].
4569        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4570            self.0.request.name = v.into();
4571            self
4572        }
4573    }
4574
4575    #[doc(hidden)]
4576    impl gax::options::internal::RequestBuilder for GetLocation {
4577        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4578            &mut self.0.options
4579        }
4580    }
4581
4582    /// The request builder for [DataTransferService::set_iam_policy][crate::client::DataTransferService::set_iam_policy] calls.
4583    ///
4584    /// # Example
4585    /// ```
4586    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::SetIamPolicy;
4587    /// # async fn sample() -> gax::Result<()> {
4588    ///
4589    /// let builder = prepare_request_builder();
4590    /// let response = builder.send().await?;
4591    /// # Ok(()) }
4592    ///
4593    /// fn prepare_request_builder() -> SetIamPolicy {
4594    ///   # panic!();
4595    ///   // ... details omitted ...
4596    /// }
4597    /// ```
4598    #[derive(Clone, Debug)]
4599    pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
4600
4601    impl SetIamPolicy {
4602        pub(crate) fn new(
4603            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4604        ) -> Self {
4605            Self(RequestBuilder::new(stub))
4606        }
4607
4608        /// Sets the full request, replacing any prior values.
4609        pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
4610            self.0.request = v.into();
4611            self
4612        }
4613
4614        /// Sets all the options, replacing any prior values.
4615        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4616            self.0.options = v.into();
4617            self
4618        }
4619
4620        /// Sends the request.
4621        pub async fn send(self) -> Result<iam_v1::model::Policy> {
4622            (*self.0.stub)
4623                .set_iam_policy(self.0.request, self.0.options)
4624                .await
4625                .map(gax::response::Response::into_body)
4626        }
4627
4628        /// Sets the value of [resource][iam_v1::model::SetIamPolicyRequest::resource].
4629        ///
4630        /// This is a **required** field for requests.
4631        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4632            self.0.request.resource = v.into();
4633            self
4634        }
4635
4636        /// Sets the value of [policy][iam_v1::model::SetIamPolicyRequest::policy].
4637        ///
4638        /// This is a **required** field for requests.
4639        pub fn set_policy<T>(mut self, v: T) -> Self
4640        where
4641            T: std::convert::Into<iam_v1::model::Policy>,
4642        {
4643            self.0.request.policy = std::option::Option::Some(v.into());
4644            self
4645        }
4646
4647        /// Sets or clears the value of [policy][iam_v1::model::SetIamPolicyRequest::policy].
4648        ///
4649        /// This is a **required** field for requests.
4650        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
4651        where
4652            T: std::convert::Into<iam_v1::model::Policy>,
4653        {
4654            self.0.request.policy = v.map(|x| x.into());
4655            self
4656        }
4657
4658        /// Sets the value of [update_mask][iam_v1::model::SetIamPolicyRequest::update_mask].
4659        pub fn set_update_mask<T>(mut self, v: T) -> Self
4660        where
4661            T: std::convert::Into<wkt::FieldMask>,
4662        {
4663            self.0.request.update_mask = std::option::Option::Some(v.into());
4664            self
4665        }
4666
4667        /// Sets or clears the value of [update_mask][iam_v1::model::SetIamPolicyRequest::update_mask].
4668        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4669        where
4670            T: std::convert::Into<wkt::FieldMask>,
4671        {
4672            self.0.request.update_mask = v.map(|x| x.into());
4673            self
4674        }
4675    }
4676
4677    #[doc(hidden)]
4678    impl gax::options::internal::RequestBuilder for SetIamPolicy {
4679        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4680            &mut self.0.options
4681        }
4682    }
4683
4684    /// The request builder for [DataTransferService::get_iam_policy][crate::client::DataTransferService::get_iam_policy] calls.
4685    ///
4686    /// # Example
4687    /// ```
4688    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::GetIamPolicy;
4689    /// # async fn sample() -> gax::Result<()> {
4690    ///
4691    /// let builder = prepare_request_builder();
4692    /// let response = builder.send().await?;
4693    /// # Ok(()) }
4694    ///
4695    /// fn prepare_request_builder() -> GetIamPolicy {
4696    ///   # panic!();
4697    ///   // ... details omitted ...
4698    /// }
4699    /// ```
4700    #[derive(Clone, Debug)]
4701    pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
4702
4703    impl GetIamPolicy {
4704        pub(crate) fn new(
4705            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4706        ) -> Self {
4707            Self(RequestBuilder::new(stub))
4708        }
4709
4710        /// Sets the full request, replacing any prior values.
4711        pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
4712            self.0.request = v.into();
4713            self
4714        }
4715
4716        /// Sets all the options, replacing any prior values.
4717        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4718            self.0.options = v.into();
4719            self
4720        }
4721
4722        /// Sends the request.
4723        pub async fn send(self) -> Result<iam_v1::model::Policy> {
4724            (*self.0.stub)
4725                .get_iam_policy(self.0.request, self.0.options)
4726                .await
4727                .map(gax::response::Response::into_body)
4728        }
4729
4730        /// Sets the value of [resource][iam_v1::model::GetIamPolicyRequest::resource].
4731        ///
4732        /// This is a **required** field for requests.
4733        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4734            self.0.request.resource = v.into();
4735            self
4736        }
4737
4738        /// Sets the value of [options][iam_v1::model::GetIamPolicyRequest::options].
4739        pub fn set_options<T>(mut self, v: T) -> Self
4740        where
4741            T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
4742        {
4743            self.0.request.options = std::option::Option::Some(v.into());
4744            self
4745        }
4746
4747        /// Sets or clears the value of [options][iam_v1::model::GetIamPolicyRequest::options].
4748        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
4749        where
4750            T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
4751        {
4752            self.0.request.options = v.map(|x| x.into());
4753            self
4754        }
4755    }
4756
4757    #[doc(hidden)]
4758    impl gax::options::internal::RequestBuilder for GetIamPolicy {
4759        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4760            &mut self.0.options
4761        }
4762    }
4763
4764    /// The request builder for [DataTransferService::test_iam_permissions][crate::client::DataTransferService::test_iam_permissions] calls.
4765    ///
4766    /// # Example
4767    /// ```
4768    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::TestIamPermissions;
4769    /// # async fn sample() -> gax::Result<()> {
4770    ///
4771    /// let builder = prepare_request_builder();
4772    /// let response = builder.send().await?;
4773    /// # Ok(()) }
4774    ///
4775    /// fn prepare_request_builder() -> TestIamPermissions {
4776    ///   # panic!();
4777    ///   // ... details omitted ...
4778    /// }
4779    /// ```
4780    #[derive(Clone, Debug)]
4781    pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
4782
4783    impl TestIamPermissions {
4784        pub(crate) fn new(
4785            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4786        ) -> Self {
4787            Self(RequestBuilder::new(stub))
4788        }
4789
4790        /// Sets the full request, replacing any prior values.
4791        pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
4792            mut self,
4793            v: V,
4794        ) -> Self {
4795            self.0.request = v.into();
4796            self
4797        }
4798
4799        /// Sets all the options, replacing any prior values.
4800        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4801            self.0.options = v.into();
4802            self
4803        }
4804
4805        /// Sends the request.
4806        pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
4807            (*self.0.stub)
4808                .test_iam_permissions(self.0.request, self.0.options)
4809                .await
4810                .map(gax::response::Response::into_body)
4811        }
4812
4813        /// Sets the value of [resource][iam_v1::model::TestIamPermissionsRequest::resource].
4814        ///
4815        /// This is a **required** field for requests.
4816        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4817            self.0.request.resource = v.into();
4818            self
4819        }
4820
4821        /// Sets the value of [permissions][iam_v1::model::TestIamPermissionsRequest::permissions].
4822        ///
4823        /// This is a **required** field for requests.
4824        pub fn set_permissions<T, V>(mut self, v: T) -> Self
4825        where
4826            T: std::iter::IntoIterator<Item = V>,
4827            V: std::convert::Into<std::string::String>,
4828        {
4829            use std::iter::Iterator;
4830            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
4831            self
4832        }
4833    }
4834
4835    #[doc(hidden)]
4836    impl gax::options::internal::RequestBuilder for TestIamPermissions {
4837        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4838            &mut self.0.options
4839        }
4840    }
4841
4842    /// The request builder for [DataTransferService::list_operations][crate::client::DataTransferService::list_operations] calls.
4843    ///
4844    /// # Example
4845    /// ```
4846    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::ListOperations;
4847    /// # async fn sample() -> gax::Result<()> {
4848    /// use gax::paginator::ItemPaginator;
4849    ///
4850    /// let builder = prepare_request_builder();
4851    /// let mut items = builder.by_item();
4852    /// while let Some(result) = items.next().await {
4853    ///   let item = result?;
4854    /// }
4855    /// # Ok(()) }
4856    ///
4857    /// fn prepare_request_builder() -> ListOperations {
4858    ///   # panic!();
4859    ///   // ... details omitted ...
4860    /// }
4861    /// ```
4862    #[derive(Clone, Debug)]
4863    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
4864
4865    impl ListOperations {
4866        pub(crate) fn new(
4867            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4868        ) -> Self {
4869            Self(RequestBuilder::new(stub))
4870        }
4871
4872        /// Sets the full request, replacing any prior values.
4873        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
4874            mut self,
4875            v: V,
4876        ) -> Self {
4877            self.0.request = v.into();
4878            self
4879        }
4880
4881        /// Sets all the options, replacing any prior values.
4882        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4883            self.0.options = v.into();
4884            self
4885        }
4886
4887        /// Sends the request.
4888        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
4889            (*self.0.stub)
4890                .list_operations(self.0.request, self.0.options)
4891                .await
4892                .map(gax::response::Response::into_body)
4893        }
4894
4895        /// Streams each page in the collection.
4896        pub fn by_page(
4897            self,
4898        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
4899        {
4900            use std::clone::Clone;
4901            let token = self.0.request.page_token.clone();
4902            let execute = move |token: String| {
4903                let mut builder = self.clone();
4904                builder.0.request = builder.0.request.set_page_token(token);
4905                builder.send()
4906            };
4907            gax::paginator::internal::new_paginator(token, execute)
4908        }
4909
4910        /// Streams each item in the collection.
4911        pub fn by_item(
4912            self,
4913        ) -> impl gax::paginator::ItemPaginator<
4914            longrunning::model::ListOperationsResponse,
4915            gax::error::Error,
4916        > {
4917            use gax::paginator::Paginator;
4918            self.by_page().items()
4919        }
4920
4921        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
4922        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4923            self.0.request.name = v.into();
4924            self
4925        }
4926
4927        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
4928        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4929            self.0.request.filter = v.into();
4930            self
4931        }
4932
4933        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
4934        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4935            self.0.request.page_size = v.into();
4936            self
4937        }
4938
4939        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
4940        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4941            self.0.request.page_token = v.into();
4942            self
4943        }
4944
4945        /// Sets the value of [return_partial_success][longrunning::model::ListOperationsRequest::return_partial_success].
4946        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
4947            self.0.request.return_partial_success = v.into();
4948            self
4949        }
4950    }
4951
4952    #[doc(hidden)]
4953    impl gax::options::internal::RequestBuilder for ListOperations {
4954        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4955            &mut self.0.options
4956        }
4957    }
4958
4959    /// The request builder for [DataTransferService::get_operation][crate::client::DataTransferService::get_operation] calls.
4960    ///
4961    /// # Example
4962    /// ```
4963    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::GetOperation;
4964    /// # async fn sample() -> gax::Result<()> {
4965    ///
4966    /// let builder = prepare_request_builder();
4967    /// let response = builder.send().await?;
4968    /// # Ok(()) }
4969    ///
4970    /// fn prepare_request_builder() -> GetOperation {
4971    ///   # panic!();
4972    ///   // ... details omitted ...
4973    /// }
4974    /// ```
4975    #[derive(Clone, Debug)]
4976    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
4977
4978    impl GetOperation {
4979        pub(crate) fn new(
4980            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4981        ) -> Self {
4982            Self(RequestBuilder::new(stub))
4983        }
4984
4985        /// Sets the full request, replacing any prior values.
4986        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
4987            mut self,
4988            v: V,
4989        ) -> Self {
4990            self.0.request = v.into();
4991            self
4992        }
4993
4994        /// Sets all the options, replacing any prior values.
4995        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4996            self.0.options = v.into();
4997            self
4998        }
4999
5000        /// Sends the request.
5001        pub async fn send(self) -> Result<longrunning::model::Operation> {
5002            (*self.0.stub)
5003                .get_operation(self.0.request, self.0.options)
5004                .await
5005                .map(gax::response::Response::into_body)
5006        }
5007
5008        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
5009        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5010            self.0.request.name = v.into();
5011            self
5012        }
5013    }
5014
5015    #[doc(hidden)]
5016    impl gax::options::internal::RequestBuilder for GetOperation {
5017        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5018            &mut self.0.options
5019        }
5020    }
5021
5022    /// The request builder for [DataTransferService::delete_operation][crate::client::DataTransferService::delete_operation] calls.
5023    ///
5024    /// # Example
5025    /// ```
5026    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::DeleteOperation;
5027    /// # async fn sample() -> gax::Result<()> {
5028    ///
5029    /// let builder = prepare_request_builder();
5030    /// let response = builder.send().await?;
5031    /// # Ok(()) }
5032    ///
5033    /// fn prepare_request_builder() -> DeleteOperation {
5034    ///   # panic!();
5035    ///   // ... details omitted ...
5036    /// }
5037    /// ```
5038    #[derive(Clone, Debug)]
5039    pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
5040
5041    impl DeleteOperation {
5042        pub(crate) fn new(
5043            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
5044        ) -> Self {
5045            Self(RequestBuilder::new(stub))
5046        }
5047
5048        /// Sets the full request, replacing any prior values.
5049        pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
5050            mut self,
5051            v: V,
5052        ) -> Self {
5053            self.0.request = v.into();
5054            self
5055        }
5056
5057        /// Sets all the options, replacing any prior values.
5058        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5059            self.0.options = v.into();
5060            self
5061        }
5062
5063        /// Sends the request.
5064        pub async fn send(self) -> Result<()> {
5065            (*self.0.stub)
5066                .delete_operation(self.0.request, self.0.options)
5067                .await
5068                .map(gax::response::Response::into_body)
5069        }
5070
5071        /// Sets the value of [name][longrunning::model::DeleteOperationRequest::name].
5072        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5073            self.0.request.name = v.into();
5074            self
5075        }
5076    }
5077
5078    #[doc(hidden)]
5079    impl gax::options::internal::RequestBuilder for DeleteOperation {
5080        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5081            &mut self.0.options
5082        }
5083    }
5084
5085    /// The request builder for [DataTransferService::cancel_operation][crate::client::DataTransferService::cancel_operation] calls.
5086    ///
5087    /// # Example
5088    /// ```
5089    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::CancelOperation;
5090    /// # async fn sample() -> gax::Result<()> {
5091    ///
5092    /// let builder = prepare_request_builder();
5093    /// let response = builder.send().await?;
5094    /// # Ok(()) }
5095    ///
5096    /// fn prepare_request_builder() -> CancelOperation {
5097    ///   # panic!();
5098    ///   // ... details omitted ...
5099    /// }
5100    /// ```
5101    #[derive(Clone, Debug)]
5102    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
5103
5104    impl CancelOperation {
5105        pub(crate) fn new(
5106            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
5107        ) -> Self {
5108            Self(RequestBuilder::new(stub))
5109        }
5110
5111        /// Sets the full request, replacing any prior values.
5112        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
5113            mut self,
5114            v: V,
5115        ) -> Self {
5116            self.0.request = v.into();
5117            self
5118        }
5119
5120        /// Sets all the options, replacing any prior values.
5121        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5122            self.0.options = v.into();
5123            self
5124        }
5125
5126        /// Sends the request.
5127        pub async fn send(self) -> Result<()> {
5128            (*self.0.stub)
5129                .cancel_operation(self.0.request, self.0.options)
5130                .await
5131                .map(gax::response::Response::into_body)
5132        }
5133
5134        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
5135        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5136            self.0.request.name = v.into();
5137            self
5138        }
5139    }
5140
5141    #[doc(hidden)]
5142    impl gax::options::internal::RequestBuilder for CancelOperation {
5143        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5144            &mut self.0.options
5145        }
5146    }
5147}
5148
5149pub mod hub_service {
5150    use crate::Result;
5151
5152    /// A builder for [HubService][crate::client::HubService].
5153    ///
5154    /// ```
5155    /// # async fn sample() -> gax::client_builder::Result<()> {
5156    /// # use google_cloud_networkconnectivity_v1::*;
5157    /// # use builder::hub_service::ClientBuilder;
5158    /// # use client::HubService;
5159    /// let builder : ClientBuilder = HubService::builder();
5160    /// let client = builder
5161    ///     .with_endpoint("https://networkconnectivity.googleapis.com")
5162    ///     .build().await?;
5163    /// # Ok(()) }
5164    /// ```
5165    pub type ClientBuilder =
5166        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
5167
5168    pub(crate) mod client {
5169        use super::super::super::client::HubService;
5170        pub struct Factory;
5171        impl gax::client_builder::internal::ClientFactory for Factory {
5172            type Client = HubService;
5173            type Credentials = gaxi::options::Credentials;
5174            async fn build(
5175                self,
5176                config: gaxi::options::ClientConfig,
5177            ) -> gax::client_builder::Result<Self::Client> {
5178                Self::Client::new(config).await
5179            }
5180        }
5181    }
5182
5183    /// Common implementation for [crate::client::HubService] request builders.
5184    #[derive(Clone, Debug)]
5185    pub(crate) struct RequestBuilder<R: std::default::Default> {
5186        stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5187        request: R,
5188        options: gax::options::RequestOptions,
5189    }
5190
5191    impl<R> RequestBuilder<R>
5192    where
5193        R: std::default::Default,
5194    {
5195        pub(crate) fn new(
5196            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5197        ) -> Self {
5198            Self {
5199                stub,
5200                request: R::default(),
5201                options: gax::options::RequestOptions::default(),
5202            }
5203        }
5204    }
5205
5206    /// The request builder for [HubService::list_hubs][crate::client::HubService::list_hubs] calls.
5207    ///
5208    /// # Example
5209    /// ```
5210    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::ListHubs;
5211    /// # async fn sample() -> gax::Result<()> {
5212    /// use gax::paginator::ItemPaginator;
5213    ///
5214    /// let builder = prepare_request_builder();
5215    /// let mut items = builder.by_item();
5216    /// while let Some(result) = items.next().await {
5217    ///   let item = result?;
5218    /// }
5219    /// # Ok(()) }
5220    ///
5221    /// fn prepare_request_builder() -> ListHubs {
5222    ///   # panic!();
5223    ///   // ... details omitted ...
5224    /// }
5225    /// ```
5226    #[derive(Clone, Debug)]
5227    pub struct ListHubs(RequestBuilder<crate::model::ListHubsRequest>);
5228
5229    impl ListHubs {
5230        pub(crate) fn new(
5231            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5232        ) -> Self {
5233            Self(RequestBuilder::new(stub))
5234        }
5235
5236        /// Sets the full request, replacing any prior values.
5237        pub fn with_request<V: Into<crate::model::ListHubsRequest>>(mut self, v: V) -> Self {
5238            self.0.request = v.into();
5239            self
5240        }
5241
5242        /// Sets all the options, replacing any prior values.
5243        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5244            self.0.options = v.into();
5245            self
5246        }
5247
5248        /// Sends the request.
5249        pub async fn send(self) -> Result<crate::model::ListHubsResponse> {
5250            (*self.0.stub)
5251                .list_hubs(self.0.request, self.0.options)
5252                .await
5253                .map(gax::response::Response::into_body)
5254        }
5255
5256        /// Streams each page in the collection.
5257        pub fn by_page(
5258            self,
5259        ) -> impl gax::paginator::Paginator<crate::model::ListHubsResponse, gax::error::Error>
5260        {
5261            use std::clone::Clone;
5262            let token = self.0.request.page_token.clone();
5263            let execute = move |token: String| {
5264                let mut builder = self.clone();
5265                builder.0.request = builder.0.request.set_page_token(token);
5266                builder.send()
5267            };
5268            gax::paginator::internal::new_paginator(token, execute)
5269        }
5270
5271        /// Streams each item in the collection.
5272        pub fn by_item(
5273            self,
5274        ) -> impl gax::paginator::ItemPaginator<crate::model::ListHubsResponse, gax::error::Error>
5275        {
5276            use gax::paginator::Paginator;
5277            self.by_page().items()
5278        }
5279
5280        /// Sets the value of [parent][crate::model::ListHubsRequest::parent].
5281        ///
5282        /// This is a **required** field for requests.
5283        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5284            self.0.request.parent = v.into();
5285            self
5286        }
5287
5288        /// Sets the value of [page_size][crate::model::ListHubsRequest::page_size].
5289        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5290            self.0.request.page_size = v.into();
5291            self
5292        }
5293
5294        /// Sets the value of [page_token][crate::model::ListHubsRequest::page_token].
5295        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5296            self.0.request.page_token = v.into();
5297            self
5298        }
5299
5300        /// Sets the value of [filter][crate::model::ListHubsRequest::filter].
5301        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5302            self.0.request.filter = v.into();
5303            self
5304        }
5305
5306        /// Sets the value of [order_by][crate::model::ListHubsRequest::order_by].
5307        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
5308            self.0.request.order_by = v.into();
5309            self
5310        }
5311    }
5312
5313    #[doc(hidden)]
5314    impl gax::options::internal::RequestBuilder for ListHubs {
5315        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5316            &mut self.0.options
5317        }
5318    }
5319
5320    /// The request builder for [HubService::get_hub][crate::client::HubService::get_hub] calls.
5321    ///
5322    /// # Example
5323    /// ```
5324    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::GetHub;
5325    /// # async fn sample() -> gax::Result<()> {
5326    ///
5327    /// let builder = prepare_request_builder();
5328    /// let response = builder.send().await?;
5329    /// # Ok(()) }
5330    ///
5331    /// fn prepare_request_builder() -> GetHub {
5332    ///   # panic!();
5333    ///   // ... details omitted ...
5334    /// }
5335    /// ```
5336    #[derive(Clone, Debug)]
5337    pub struct GetHub(RequestBuilder<crate::model::GetHubRequest>);
5338
5339    impl GetHub {
5340        pub(crate) fn new(
5341            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5342        ) -> Self {
5343            Self(RequestBuilder::new(stub))
5344        }
5345
5346        /// Sets the full request, replacing any prior values.
5347        pub fn with_request<V: Into<crate::model::GetHubRequest>>(mut self, v: V) -> Self {
5348            self.0.request = v.into();
5349            self
5350        }
5351
5352        /// Sets all the options, replacing any prior values.
5353        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5354            self.0.options = v.into();
5355            self
5356        }
5357
5358        /// Sends the request.
5359        pub async fn send(self) -> Result<crate::model::Hub> {
5360            (*self.0.stub)
5361                .get_hub(self.0.request, self.0.options)
5362                .await
5363                .map(gax::response::Response::into_body)
5364        }
5365
5366        /// Sets the value of [name][crate::model::GetHubRequest::name].
5367        ///
5368        /// This is a **required** field for requests.
5369        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5370            self.0.request.name = v.into();
5371            self
5372        }
5373    }
5374
5375    #[doc(hidden)]
5376    impl gax::options::internal::RequestBuilder for GetHub {
5377        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5378            &mut self.0.options
5379        }
5380    }
5381
5382    /// The request builder for [HubService::create_hub][crate::client::HubService::create_hub] calls.
5383    ///
5384    /// # Example
5385    /// ```
5386    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::CreateHub;
5387    /// # async fn sample() -> gax::Result<()> {
5388    /// use lro::Poller;
5389    ///
5390    /// let builder = prepare_request_builder();
5391    /// let response = builder.poller().until_done().await?;
5392    /// # Ok(()) }
5393    ///
5394    /// fn prepare_request_builder() -> CreateHub {
5395    ///   # panic!();
5396    ///   // ... details omitted ...
5397    /// }
5398    /// ```
5399    #[derive(Clone, Debug)]
5400    pub struct CreateHub(RequestBuilder<crate::model::CreateHubRequest>);
5401
5402    impl CreateHub {
5403        pub(crate) fn new(
5404            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5405        ) -> Self {
5406            Self(RequestBuilder::new(stub))
5407        }
5408
5409        /// Sets the full request, replacing any prior values.
5410        pub fn with_request<V: Into<crate::model::CreateHubRequest>>(mut self, v: V) -> Self {
5411            self.0.request = v.into();
5412            self
5413        }
5414
5415        /// Sets all the options, replacing any prior values.
5416        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5417            self.0.options = v.into();
5418            self
5419        }
5420
5421        /// Sends the request.
5422        ///
5423        /// # Long running operations
5424        ///
5425        /// This starts, but does not poll, a longrunning operation. More information
5426        /// on [create_hub][crate::client::HubService::create_hub].
5427        pub async fn send(self) -> Result<longrunning::model::Operation> {
5428            (*self.0.stub)
5429                .create_hub(self.0.request, self.0.options)
5430                .await
5431                .map(gax::response::Response::into_body)
5432        }
5433
5434        /// Creates a [Poller][lro::Poller] to work with `create_hub`.
5435        pub fn poller(
5436            self,
5437        ) -> impl lro::Poller<crate::model::Hub, crate::model::OperationMetadata> {
5438            type Operation =
5439                lro::internal::Operation<crate::model::Hub, crate::model::OperationMetadata>;
5440            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5441            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5442
5443            let stub = self.0.stub.clone();
5444            let mut options = self.0.options.clone();
5445            options.set_retry_policy(gax::retry_policy::NeverRetry);
5446            let query = move |name| {
5447                let stub = stub.clone();
5448                let options = options.clone();
5449                async {
5450                    let op = GetOperation::new(stub)
5451                        .set_name(name)
5452                        .with_options(options)
5453                        .send()
5454                        .await?;
5455                    Ok(Operation::new(op))
5456                }
5457            };
5458
5459            let start = move || async {
5460                let op = self.send().await?;
5461                Ok(Operation::new(op))
5462            };
5463
5464            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
5465        }
5466
5467        /// Sets the value of [parent][crate::model::CreateHubRequest::parent].
5468        ///
5469        /// This is a **required** field for requests.
5470        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5471            self.0.request.parent = v.into();
5472            self
5473        }
5474
5475        /// Sets the value of [hub_id][crate::model::CreateHubRequest::hub_id].
5476        ///
5477        /// This is a **required** field for requests.
5478        pub fn set_hub_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5479            self.0.request.hub_id = v.into();
5480            self
5481        }
5482
5483        /// Sets the value of [hub][crate::model::CreateHubRequest::hub].
5484        ///
5485        /// This is a **required** field for requests.
5486        pub fn set_hub<T>(mut self, v: T) -> Self
5487        where
5488            T: std::convert::Into<crate::model::Hub>,
5489        {
5490            self.0.request.hub = std::option::Option::Some(v.into());
5491            self
5492        }
5493
5494        /// Sets or clears the value of [hub][crate::model::CreateHubRequest::hub].
5495        ///
5496        /// This is a **required** field for requests.
5497        pub fn set_or_clear_hub<T>(mut self, v: std::option::Option<T>) -> Self
5498        where
5499            T: std::convert::Into<crate::model::Hub>,
5500        {
5501            self.0.request.hub = v.map(|x| x.into());
5502            self
5503        }
5504
5505        /// Sets the value of [request_id][crate::model::CreateHubRequest::request_id].
5506        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5507            self.0.request.request_id = v.into();
5508            self
5509        }
5510    }
5511
5512    #[doc(hidden)]
5513    impl gax::options::internal::RequestBuilder for CreateHub {
5514        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5515            &mut self.0.options
5516        }
5517    }
5518
5519    /// The request builder for [HubService::update_hub][crate::client::HubService::update_hub] calls.
5520    ///
5521    /// # Example
5522    /// ```
5523    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::UpdateHub;
5524    /// # async fn sample() -> gax::Result<()> {
5525    /// use lro::Poller;
5526    ///
5527    /// let builder = prepare_request_builder();
5528    /// let response = builder.poller().until_done().await?;
5529    /// # Ok(()) }
5530    ///
5531    /// fn prepare_request_builder() -> UpdateHub {
5532    ///   # panic!();
5533    ///   // ... details omitted ...
5534    /// }
5535    /// ```
5536    #[derive(Clone, Debug)]
5537    pub struct UpdateHub(RequestBuilder<crate::model::UpdateHubRequest>);
5538
5539    impl UpdateHub {
5540        pub(crate) fn new(
5541            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5542        ) -> Self {
5543            Self(RequestBuilder::new(stub))
5544        }
5545
5546        /// Sets the full request, replacing any prior values.
5547        pub fn with_request<V: Into<crate::model::UpdateHubRequest>>(mut self, v: V) -> Self {
5548            self.0.request = v.into();
5549            self
5550        }
5551
5552        /// Sets all the options, replacing any prior values.
5553        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5554            self.0.options = v.into();
5555            self
5556        }
5557
5558        /// Sends the request.
5559        ///
5560        /// # Long running operations
5561        ///
5562        /// This starts, but does not poll, a longrunning operation. More information
5563        /// on [update_hub][crate::client::HubService::update_hub].
5564        pub async fn send(self) -> Result<longrunning::model::Operation> {
5565            (*self.0.stub)
5566                .update_hub(self.0.request, self.0.options)
5567                .await
5568                .map(gax::response::Response::into_body)
5569        }
5570
5571        /// Creates a [Poller][lro::Poller] to work with `update_hub`.
5572        pub fn poller(
5573            self,
5574        ) -> impl lro::Poller<crate::model::Hub, crate::model::OperationMetadata> {
5575            type Operation =
5576                lro::internal::Operation<crate::model::Hub, crate::model::OperationMetadata>;
5577            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5578            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5579
5580            let stub = self.0.stub.clone();
5581            let mut options = self.0.options.clone();
5582            options.set_retry_policy(gax::retry_policy::NeverRetry);
5583            let query = move |name| {
5584                let stub = stub.clone();
5585                let options = options.clone();
5586                async {
5587                    let op = GetOperation::new(stub)
5588                        .set_name(name)
5589                        .with_options(options)
5590                        .send()
5591                        .await?;
5592                    Ok(Operation::new(op))
5593                }
5594            };
5595
5596            let start = move || async {
5597                let op = self.send().await?;
5598                Ok(Operation::new(op))
5599            };
5600
5601            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
5602        }
5603
5604        /// Sets the value of [update_mask][crate::model::UpdateHubRequest::update_mask].
5605        pub fn set_update_mask<T>(mut self, v: T) -> Self
5606        where
5607            T: std::convert::Into<wkt::FieldMask>,
5608        {
5609            self.0.request.update_mask = std::option::Option::Some(v.into());
5610            self
5611        }
5612
5613        /// Sets or clears the value of [update_mask][crate::model::UpdateHubRequest::update_mask].
5614        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5615        where
5616            T: std::convert::Into<wkt::FieldMask>,
5617        {
5618            self.0.request.update_mask = v.map(|x| x.into());
5619            self
5620        }
5621
5622        /// Sets the value of [hub][crate::model::UpdateHubRequest::hub].
5623        ///
5624        /// This is a **required** field for requests.
5625        pub fn set_hub<T>(mut self, v: T) -> Self
5626        where
5627            T: std::convert::Into<crate::model::Hub>,
5628        {
5629            self.0.request.hub = std::option::Option::Some(v.into());
5630            self
5631        }
5632
5633        /// Sets or clears the value of [hub][crate::model::UpdateHubRequest::hub].
5634        ///
5635        /// This is a **required** field for requests.
5636        pub fn set_or_clear_hub<T>(mut self, v: std::option::Option<T>) -> Self
5637        where
5638            T: std::convert::Into<crate::model::Hub>,
5639        {
5640            self.0.request.hub = v.map(|x| x.into());
5641            self
5642        }
5643
5644        /// Sets the value of [request_id][crate::model::UpdateHubRequest::request_id].
5645        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5646            self.0.request.request_id = v.into();
5647            self
5648        }
5649    }
5650
5651    #[doc(hidden)]
5652    impl gax::options::internal::RequestBuilder for UpdateHub {
5653        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5654            &mut self.0.options
5655        }
5656    }
5657
5658    /// The request builder for [HubService::delete_hub][crate::client::HubService::delete_hub] calls.
5659    ///
5660    /// # Example
5661    /// ```
5662    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::DeleteHub;
5663    /// # async fn sample() -> gax::Result<()> {
5664    /// use lro::Poller;
5665    ///
5666    /// let builder = prepare_request_builder();
5667    /// let response = builder.poller().until_done().await?;
5668    /// # Ok(()) }
5669    ///
5670    /// fn prepare_request_builder() -> DeleteHub {
5671    ///   # panic!();
5672    ///   // ... details omitted ...
5673    /// }
5674    /// ```
5675    #[derive(Clone, Debug)]
5676    pub struct DeleteHub(RequestBuilder<crate::model::DeleteHubRequest>);
5677
5678    impl DeleteHub {
5679        pub(crate) fn new(
5680            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5681        ) -> Self {
5682            Self(RequestBuilder::new(stub))
5683        }
5684
5685        /// Sets the full request, replacing any prior values.
5686        pub fn with_request<V: Into<crate::model::DeleteHubRequest>>(mut self, v: V) -> Self {
5687            self.0.request = v.into();
5688            self
5689        }
5690
5691        /// Sets all the options, replacing any prior values.
5692        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5693            self.0.options = v.into();
5694            self
5695        }
5696
5697        /// Sends the request.
5698        ///
5699        /// # Long running operations
5700        ///
5701        /// This starts, but does not poll, a longrunning operation. More information
5702        /// on [delete_hub][crate::client::HubService::delete_hub].
5703        pub async fn send(self) -> Result<longrunning::model::Operation> {
5704            (*self.0.stub)
5705                .delete_hub(self.0.request, self.0.options)
5706                .await
5707                .map(gax::response::Response::into_body)
5708        }
5709
5710        /// Creates a [Poller][lro::Poller] to work with `delete_hub`.
5711        pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
5712            type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
5713            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5714            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5715
5716            let stub = self.0.stub.clone();
5717            let mut options = self.0.options.clone();
5718            options.set_retry_policy(gax::retry_policy::NeverRetry);
5719            let query = move |name| {
5720                let stub = stub.clone();
5721                let options = options.clone();
5722                async {
5723                    let op = GetOperation::new(stub)
5724                        .set_name(name)
5725                        .with_options(options)
5726                        .send()
5727                        .await?;
5728                    Ok(Operation::new(op))
5729                }
5730            };
5731
5732            let start = move || async {
5733                let op = self.send().await?;
5734                Ok(Operation::new(op))
5735            };
5736
5737            lro::internal::new_unit_response_poller(
5738                polling_error_policy,
5739                polling_backoff_policy,
5740                start,
5741                query,
5742            )
5743        }
5744
5745        /// Sets the value of [name][crate::model::DeleteHubRequest::name].
5746        ///
5747        /// This is a **required** field for requests.
5748        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5749            self.0.request.name = v.into();
5750            self
5751        }
5752
5753        /// Sets the value of [request_id][crate::model::DeleteHubRequest::request_id].
5754        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5755            self.0.request.request_id = v.into();
5756            self
5757        }
5758    }
5759
5760    #[doc(hidden)]
5761    impl gax::options::internal::RequestBuilder for DeleteHub {
5762        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5763            &mut self.0.options
5764        }
5765    }
5766
5767    /// The request builder for [HubService::list_hub_spokes][crate::client::HubService::list_hub_spokes] calls.
5768    ///
5769    /// # Example
5770    /// ```
5771    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::ListHubSpokes;
5772    /// # async fn sample() -> gax::Result<()> {
5773    /// use gax::paginator::ItemPaginator;
5774    ///
5775    /// let builder = prepare_request_builder();
5776    /// let mut items = builder.by_item();
5777    /// while let Some(result) = items.next().await {
5778    ///   let item = result?;
5779    /// }
5780    /// # Ok(()) }
5781    ///
5782    /// fn prepare_request_builder() -> ListHubSpokes {
5783    ///   # panic!();
5784    ///   // ... details omitted ...
5785    /// }
5786    /// ```
5787    #[derive(Clone, Debug)]
5788    pub struct ListHubSpokes(RequestBuilder<crate::model::ListHubSpokesRequest>);
5789
5790    impl ListHubSpokes {
5791        pub(crate) fn new(
5792            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5793        ) -> Self {
5794            Self(RequestBuilder::new(stub))
5795        }
5796
5797        /// Sets the full request, replacing any prior values.
5798        pub fn with_request<V: Into<crate::model::ListHubSpokesRequest>>(mut self, v: V) -> Self {
5799            self.0.request = v.into();
5800            self
5801        }
5802
5803        /// Sets all the options, replacing any prior values.
5804        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5805            self.0.options = v.into();
5806            self
5807        }
5808
5809        /// Sends the request.
5810        pub async fn send(self) -> Result<crate::model::ListHubSpokesResponse> {
5811            (*self.0.stub)
5812                .list_hub_spokes(self.0.request, self.0.options)
5813                .await
5814                .map(gax::response::Response::into_body)
5815        }
5816
5817        /// Streams each page in the collection.
5818        pub fn by_page(
5819            self,
5820        ) -> impl gax::paginator::Paginator<crate::model::ListHubSpokesResponse, gax::error::Error>
5821        {
5822            use std::clone::Clone;
5823            let token = self.0.request.page_token.clone();
5824            let execute = move |token: String| {
5825                let mut builder = self.clone();
5826                builder.0.request = builder.0.request.set_page_token(token);
5827                builder.send()
5828            };
5829            gax::paginator::internal::new_paginator(token, execute)
5830        }
5831
5832        /// Streams each item in the collection.
5833        pub fn by_item(
5834            self,
5835        ) -> impl gax::paginator::ItemPaginator<crate::model::ListHubSpokesResponse, gax::error::Error>
5836        {
5837            use gax::paginator::Paginator;
5838            self.by_page().items()
5839        }
5840
5841        /// Sets the value of [name][crate::model::ListHubSpokesRequest::name].
5842        ///
5843        /// This is a **required** field for requests.
5844        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5845            self.0.request.name = v.into();
5846            self
5847        }
5848
5849        /// Sets the value of [spoke_locations][crate::model::ListHubSpokesRequest::spoke_locations].
5850        pub fn set_spoke_locations<T, V>(mut self, v: T) -> Self
5851        where
5852            T: std::iter::IntoIterator<Item = V>,
5853            V: std::convert::Into<std::string::String>,
5854        {
5855            use std::iter::Iterator;
5856            self.0.request.spoke_locations = v.into_iter().map(|i| i.into()).collect();
5857            self
5858        }
5859
5860        /// Sets the value of [page_size][crate::model::ListHubSpokesRequest::page_size].
5861        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5862            self.0.request.page_size = v.into();
5863            self
5864        }
5865
5866        /// Sets the value of [page_token][crate::model::ListHubSpokesRequest::page_token].
5867        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5868            self.0.request.page_token = v.into();
5869            self
5870        }
5871
5872        /// Sets the value of [filter][crate::model::ListHubSpokesRequest::filter].
5873        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5874            self.0.request.filter = v.into();
5875            self
5876        }
5877
5878        /// Sets the value of [order_by][crate::model::ListHubSpokesRequest::order_by].
5879        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
5880            self.0.request.order_by = v.into();
5881            self
5882        }
5883
5884        /// Sets the value of [view][crate::model::ListHubSpokesRequest::view].
5885        pub fn set_view<T: Into<crate::model::list_hub_spokes_request::SpokeView>>(
5886            mut self,
5887            v: T,
5888        ) -> Self {
5889            self.0.request.view = v.into();
5890            self
5891        }
5892    }
5893
5894    #[doc(hidden)]
5895    impl gax::options::internal::RequestBuilder for ListHubSpokes {
5896        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5897            &mut self.0.options
5898        }
5899    }
5900
5901    /// The request builder for [HubService::query_hub_status][crate::client::HubService::query_hub_status] calls.
5902    ///
5903    /// # Example
5904    /// ```
5905    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::QueryHubStatus;
5906    /// # async fn sample() -> gax::Result<()> {
5907    /// use gax::paginator::ItemPaginator;
5908    ///
5909    /// let builder = prepare_request_builder();
5910    /// let mut items = builder.by_item();
5911    /// while let Some(result) = items.next().await {
5912    ///   let item = result?;
5913    /// }
5914    /// # Ok(()) }
5915    ///
5916    /// fn prepare_request_builder() -> QueryHubStatus {
5917    ///   # panic!();
5918    ///   // ... details omitted ...
5919    /// }
5920    /// ```
5921    #[derive(Clone, Debug)]
5922    pub struct QueryHubStatus(RequestBuilder<crate::model::QueryHubStatusRequest>);
5923
5924    impl QueryHubStatus {
5925        pub(crate) fn new(
5926            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5927        ) -> Self {
5928            Self(RequestBuilder::new(stub))
5929        }
5930
5931        /// Sets the full request, replacing any prior values.
5932        pub fn with_request<V: Into<crate::model::QueryHubStatusRequest>>(mut self, v: V) -> Self {
5933            self.0.request = v.into();
5934            self
5935        }
5936
5937        /// Sets all the options, replacing any prior values.
5938        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5939            self.0.options = v.into();
5940            self
5941        }
5942
5943        /// Sends the request.
5944        pub async fn send(self) -> Result<crate::model::QueryHubStatusResponse> {
5945            (*self.0.stub)
5946                .query_hub_status(self.0.request, self.0.options)
5947                .await
5948                .map(gax::response::Response::into_body)
5949        }
5950
5951        /// Streams each page in the collection.
5952        pub fn by_page(
5953            self,
5954        ) -> impl gax::paginator::Paginator<crate::model::QueryHubStatusResponse, gax::error::Error>
5955        {
5956            use std::clone::Clone;
5957            let token = self.0.request.page_token.clone();
5958            let execute = move |token: String| {
5959                let mut builder = self.clone();
5960                builder.0.request = builder.0.request.set_page_token(token);
5961                builder.send()
5962            };
5963            gax::paginator::internal::new_paginator(token, execute)
5964        }
5965
5966        /// Streams each item in the collection.
5967        pub fn by_item(
5968            self,
5969        ) -> impl gax::paginator::ItemPaginator<crate::model::QueryHubStatusResponse, gax::error::Error>
5970        {
5971            use gax::paginator::Paginator;
5972            self.by_page().items()
5973        }
5974
5975        /// Sets the value of [name][crate::model::QueryHubStatusRequest::name].
5976        ///
5977        /// This is a **required** field for requests.
5978        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5979            self.0.request.name = v.into();
5980            self
5981        }
5982
5983        /// Sets the value of [page_size][crate::model::QueryHubStatusRequest::page_size].
5984        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5985            self.0.request.page_size = v.into();
5986            self
5987        }
5988
5989        /// Sets the value of [page_token][crate::model::QueryHubStatusRequest::page_token].
5990        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5991            self.0.request.page_token = v.into();
5992            self
5993        }
5994
5995        /// Sets the value of [filter][crate::model::QueryHubStatusRequest::filter].
5996        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5997            self.0.request.filter = v.into();
5998            self
5999        }
6000
6001        /// Sets the value of [order_by][crate::model::QueryHubStatusRequest::order_by].
6002        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
6003            self.0.request.order_by = v.into();
6004            self
6005        }
6006
6007        /// Sets the value of [group_by][crate::model::QueryHubStatusRequest::group_by].
6008        pub fn set_group_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
6009            self.0.request.group_by = v.into();
6010            self
6011        }
6012    }
6013
6014    #[doc(hidden)]
6015    impl gax::options::internal::RequestBuilder for QueryHubStatus {
6016        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6017            &mut self.0.options
6018        }
6019    }
6020
6021    /// The request builder for [HubService::list_spokes][crate::client::HubService::list_spokes] calls.
6022    ///
6023    /// # Example
6024    /// ```
6025    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::ListSpokes;
6026    /// # async fn sample() -> gax::Result<()> {
6027    /// use gax::paginator::ItemPaginator;
6028    ///
6029    /// let builder = prepare_request_builder();
6030    /// let mut items = builder.by_item();
6031    /// while let Some(result) = items.next().await {
6032    ///   let item = result?;
6033    /// }
6034    /// # Ok(()) }
6035    ///
6036    /// fn prepare_request_builder() -> ListSpokes {
6037    ///   # panic!();
6038    ///   // ... details omitted ...
6039    /// }
6040    /// ```
6041    #[derive(Clone, Debug)]
6042    pub struct ListSpokes(RequestBuilder<crate::model::ListSpokesRequest>);
6043
6044    impl ListSpokes {
6045        pub(crate) fn new(
6046            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6047        ) -> Self {
6048            Self(RequestBuilder::new(stub))
6049        }
6050
6051        /// Sets the full request, replacing any prior values.
6052        pub fn with_request<V: Into<crate::model::ListSpokesRequest>>(mut self, v: V) -> Self {
6053            self.0.request = v.into();
6054            self
6055        }
6056
6057        /// Sets all the options, replacing any prior values.
6058        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6059            self.0.options = v.into();
6060            self
6061        }
6062
6063        /// Sends the request.
6064        pub async fn send(self) -> Result<crate::model::ListSpokesResponse> {
6065            (*self.0.stub)
6066                .list_spokes(self.0.request, self.0.options)
6067                .await
6068                .map(gax::response::Response::into_body)
6069        }
6070
6071        /// Streams each page in the collection.
6072        pub fn by_page(
6073            self,
6074        ) -> impl gax::paginator::Paginator<crate::model::ListSpokesResponse, gax::error::Error>
6075        {
6076            use std::clone::Clone;
6077            let token = self.0.request.page_token.clone();
6078            let execute = move |token: String| {
6079                let mut builder = self.clone();
6080                builder.0.request = builder.0.request.set_page_token(token);
6081                builder.send()
6082            };
6083            gax::paginator::internal::new_paginator(token, execute)
6084        }
6085
6086        /// Streams each item in the collection.
6087        pub fn by_item(
6088            self,
6089        ) -> impl gax::paginator::ItemPaginator<crate::model::ListSpokesResponse, gax::error::Error>
6090        {
6091            use gax::paginator::Paginator;
6092            self.by_page().items()
6093        }
6094
6095        /// Sets the value of [parent][crate::model::ListSpokesRequest::parent].
6096        ///
6097        /// This is a **required** field for requests.
6098        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6099            self.0.request.parent = v.into();
6100            self
6101        }
6102
6103        /// Sets the value of [page_size][crate::model::ListSpokesRequest::page_size].
6104        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6105            self.0.request.page_size = v.into();
6106            self
6107        }
6108
6109        /// Sets the value of [page_token][crate::model::ListSpokesRequest::page_token].
6110        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6111            self.0.request.page_token = v.into();
6112            self
6113        }
6114
6115        /// Sets the value of [filter][crate::model::ListSpokesRequest::filter].
6116        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6117            self.0.request.filter = v.into();
6118            self
6119        }
6120
6121        /// Sets the value of [order_by][crate::model::ListSpokesRequest::order_by].
6122        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
6123            self.0.request.order_by = v.into();
6124            self
6125        }
6126    }
6127
6128    #[doc(hidden)]
6129    impl gax::options::internal::RequestBuilder for ListSpokes {
6130        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6131            &mut self.0.options
6132        }
6133    }
6134
6135    /// The request builder for [HubService::get_spoke][crate::client::HubService::get_spoke] calls.
6136    ///
6137    /// # Example
6138    /// ```
6139    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::GetSpoke;
6140    /// # async fn sample() -> gax::Result<()> {
6141    ///
6142    /// let builder = prepare_request_builder();
6143    /// let response = builder.send().await?;
6144    /// # Ok(()) }
6145    ///
6146    /// fn prepare_request_builder() -> GetSpoke {
6147    ///   # panic!();
6148    ///   // ... details omitted ...
6149    /// }
6150    /// ```
6151    #[derive(Clone, Debug)]
6152    pub struct GetSpoke(RequestBuilder<crate::model::GetSpokeRequest>);
6153
6154    impl GetSpoke {
6155        pub(crate) fn new(
6156            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6157        ) -> Self {
6158            Self(RequestBuilder::new(stub))
6159        }
6160
6161        /// Sets the full request, replacing any prior values.
6162        pub fn with_request<V: Into<crate::model::GetSpokeRequest>>(mut self, v: V) -> Self {
6163            self.0.request = v.into();
6164            self
6165        }
6166
6167        /// Sets all the options, replacing any prior values.
6168        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6169            self.0.options = v.into();
6170            self
6171        }
6172
6173        /// Sends the request.
6174        pub async fn send(self) -> Result<crate::model::Spoke> {
6175            (*self.0.stub)
6176                .get_spoke(self.0.request, self.0.options)
6177                .await
6178                .map(gax::response::Response::into_body)
6179        }
6180
6181        /// Sets the value of [name][crate::model::GetSpokeRequest::name].
6182        ///
6183        /// This is a **required** field for requests.
6184        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6185            self.0.request.name = v.into();
6186            self
6187        }
6188    }
6189
6190    #[doc(hidden)]
6191    impl gax::options::internal::RequestBuilder for GetSpoke {
6192        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6193            &mut self.0.options
6194        }
6195    }
6196
6197    /// The request builder for [HubService::create_spoke][crate::client::HubService::create_spoke] calls.
6198    ///
6199    /// # Example
6200    /// ```
6201    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::CreateSpoke;
6202    /// # async fn sample() -> gax::Result<()> {
6203    /// use lro::Poller;
6204    ///
6205    /// let builder = prepare_request_builder();
6206    /// let response = builder.poller().until_done().await?;
6207    /// # Ok(()) }
6208    ///
6209    /// fn prepare_request_builder() -> CreateSpoke {
6210    ///   # panic!();
6211    ///   // ... details omitted ...
6212    /// }
6213    /// ```
6214    #[derive(Clone, Debug)]
6215    pub struct CreateSpoke(RequestBuilder<crate::model::CreateSpokeRequest>);
6216
6217    impl CreateSpoke {
6218        pub(crate) fn new(
6219            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6220        ) -> Self {
6221            Self(RequestBuilder::new(stub))
6222        }
6223
6224        /// Sets the full request, replacing any prior values.
6225        pub fn with_request<V: Into<crate::model::CreateSpokeRequest>>(mut self, v: V) -> Self {
6226            self.0.request = v.into();
6227            self
6228        }
6229
6230        /// Sets all the options, replacing any prior values.
6231        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6232            self.0.options = v.into();
6233            self
6234        }
6235
6236        /// Sends the request.
6237        ///
6238        /// # Long running operations
6239        ///
6240        /// This starts, but does not poll, a longrunning operation. More information
6241        /// on [create_spoke][crate::client::HubService::create_spoke].
6242        pub async fn send(self) -> Result<longrunning::model::Operation> {
6243            (*self.0.stub)
6244                .create_spoke(self.0.request, self.0.options)
6245                .await
6246                .map(gax::response::Response::into_body)
6247        }
6248
6249        /// Creates a [Poller][lro::Poller] to work with `create_spoke`.
6250        pub fn poller(
6251            self,
6252        ) -> impl lro::Poller<crate::model::Spoke, crate::model::OperationMetadata> {
6253            type Operation =
6254                lro::internal::Operation<crate::model::Spoke, crate::model::OperationMetadata>;
6255            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6256            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6257
6258            let stub = self.0.stub.clone();
6259            let mut options = self.0.options.clone();
6260            options.set_retry_policy(gax::retry_policy::NeverRetry);
6261            let query = move |name| {
6262                let stub = stub.clone();
6263                let options = options.clone();
6264                async {
6265                    let op = GetOperation::new(stub)
6266                        .set_name(name)
6267                        .with_options(options)
6268                        .send()
6269                        .await?;
6270                    Ok(Operation::new(op))
6271                }
6272            };
6273
6274            let start = move || async {
6275                let op = self.send().await?;
6276                Ok(Operation::new(op))
6277            };
6278
6279            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
6280        }
6281
6282        /// Sets the value of [parent][crate::model::CreateSpokeRequest::parent].
6283        ///
6284        /// This is a **required** field for requests.
6285        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6286            self.0.request.parent = v.into();
6287            self
6288        }
6289
6290        /// Sets the value of [spoke_id][crate::model::CreateSpokeRequest::spoke_id].
6291        ///
6292        /// This is a **required** field for requests.
6293        pub fn set_spoke_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6294            self.0.request.spoke_id = v.into();
6295            self
6296        }
6297
6298        /// Sets the value of [spoke][crate::model::CreateSpokeRequest::spoke].
6299        ///
6300        /// This is a **required** field for requests.
6301        pub fn set_spoke<T>(mut self, v: T) -> Self
6302        where
6303            T: std::convert::Into<crate::model::Spoke>,
6304        {
6305            self.0.request.spoke = std::option::Option::Some(v.into());
6306            self
6307        }
6308
6309        /// Sets or clears the value of [spoke][crate::model::CreateSpokeRequest::spoke].
6310        ///
6311        /// This is a **required** field for requests.
6312        pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
6313        where
6314            T: std::convert::Into<crate::model::Spoke>,
6315        {
6316            self.0.request.spoke = v.map(|x| x.into());
6317            self
6318        }
6319
6320        /// Sets the value of [request_id][crate::model::CreateSpokeRequest::request_id].
6321        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6322            self.0.request.request_id = v.into();
6323            self
6324        }
6325    }
6326
6327    #[doc(hidden)]
6328    impl gax::options::internal::RequestBuilder for CreateSpoke {
6329        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6330            &mut self.0.options
6331        }
6332    }
6333
6334    /// The request builder for [HubService::update_spoke][crate::client::HubService::update_spoke] calls.
6335    ///
6336    /// # Example
6337    /// ```
6338    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::UpdateSpoke;
6339    /// # async fn sample() -> gax::Result<()> {
6340    /// use lro::Poller;
6341    ///
6342    /// let builder = prepare_request_builder();
6343    /// let response = builder.poller().until_done().await?;
6344    /// # Ok(()) }
6345    ///
6346    /// fn prepare_request_builder() -> UpdateSpoke {
6347    ///   # panic!();
6348    ///   // ... details omitted ...
6349    /// }
6350    /// ```
6351    #[derive(Clone, Debug)]
6352    pub struct UpdateSpoke(RequestBuilder<crate::model::UpdateSpokeRequest>);
6353
6354    impl UpdateSpoke {
6355        pub(crate) fn new(
6356            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6357        ) -> Self {
6358            Self(RequestBuilder::new(stub))
6359        }
6360
6361        /// Sets the full request, replacing any prior values.
6362        pub fn with_request<V: Into<crate::model::UpdateSpokeRequest>>(mut self, v: V) -> Self {
6363            self.0.request = v.into();
6364            self
6365        }
6366
6367        /// Sets all the options, replacing any prior values.
6368        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6369            self.0.options = v.into();
6370            self
6371        }
6372
6373        /// Sends the request.
6374        ///
6375        /// # Long running operations
6376        ///
6377        /// This starts, but does not poll, a longrunning operation. More information
6378        /// on [update_spoke][crate::client::HubService::update_spoke].
6379        pub async fn send(self) -> Result<longrunning::model::Operation> {
6380            (*self.0.stub)
6381                .update_spoke(self.0.request, self.0.options)
6382                .await
6383                .map(gax::response::Response::into_body)
6384        }
6385
6386        /// Creates a [Poller][lro::Poller] to work with `update_spoke`.
6387        pub fn poller(
6388            self,
6389        ) -> impl lro::Poller<crate::model::Spoke, crate::model::OperationMetadata> {
6390            type Operation =
6391                lro::internal::Operation<crate::model::Spoke, crate::model::OperationMetadata>;
6392            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6393            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6394
6395            let stub = self.0.stub.clone();
6396            let mut options = self.0.options.clone();
6397            options.set_retry_policy(gax::retry_policy::NeverRetry);
6398            let query = move |name| {
6399                let stub = stub.clone();
6400                let options = options.clone();
6401                async {
6402                    let op = GetOperation::new(stub)
6403                        .set_name(name)
6404                        .with_options(options)
6405                        .send()
6406                        .await?;
6407                    Ok(Operation::new(op))
6408                }
6409            };
6410
6411            let start = move || async {
6412                let op = self.send().await?;
6413                Ok(Operation::new(op))
6414            };
6415
6416            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
6417        }
6418
6419        /// Sets the value of [update_mask][crate::model::UpdateSpokeRequest::update_mask].
6420        pub fn set_update_mask<T>(mut self, v: T) -> Self
6421        where
6422            T: std::convert::Into<wkt::FieldMask>,
6423        {
6424            self.0.request.update_mask = std::option::Option::Some(v.into());
6425            self
6426        }
6427
6428        /// Sets or clears the value of [update_mask][crate::model::UpdateSpokeRequest::update_mask].
6429        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6430        where
6431            T: std::convert::Into<wkt::FieldMask>,
6432        {
6433            self.0.request.update_mask = v.map(|x| x.into());
6434            self
6435        }
6436
6437        /// Sets the value of [spoke][crate::model::UpdateSpokeRequest::spoke].
6438        ///
6439        /// This is a **required** field for requests.
6440        pub fn set_spoke<T>(mut self, v: T) -> Self
6441        where
6442            T: std::convert::Into<crate::model::Spoke>,
6443        {
6444            self.0.request.spoke = std::option::Option::Some(v.into());
6445            self
6446        }
6447
6448        /// Sets or clears the value of [spoke][crate::model::UpdateSpokeRequest::spoke].
6449        ///
6450        /// This is a **required** field for requests.
6451        pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
6452        where
6453            T: std::convert::Into<crate::model::Spoke>,
6454        {
6455            self.0.request.spoke = v.map(|x| x.into());
6456            self
6457        }
6458
6459        /// Sets the value of [request_id][crate::model::UpdateSpokeRequest::request_id].
6460        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6461            self.0.request.request_id = v.into();
6462            self
6463        }
6464    }
6465
6466    #[doc(hidden)]
6467    impl gax::options::internal::RequestBuilder for UpdateSpoke {
6468        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6469            &mut self.0.options
6470        }
6471    }
6472
6473    /// The request builder for [HubService::reject_hub_spoke][crate::client::HubService::reject_hub_spoke] calls.
6474    ///
6475    /// # Example
6476    /// ```
6477    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::RejectHubSpoke;
6478    /// # async fn sample() -> gax::Result<()> {
6479    /// use lro::Poller;
6480    ///
6481    /// let builder = prepare_request_builder();
6482    /// let response = builder.poller().until_done().await?;
6483    /// # Ok(()) }
6484    ///
6485    /// fn prepare_request_builder() -> RejectHubSpoke {
6486    ///   # panic!();
6487    ///   // ... details omitted ...
6488    /// }
6489    /// ```
6490    #[derive(Clone, Debug)]
6491    pub struct RejectHubSpoke(RequestBuilder<crate::model::RejectHubSpokeRequest>);
6492
6493    impl RejectHubSpoke {
6494        pub(crate) fn new(
6495            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6496        ) -> Self {
6497            Self(RequestBuilder::new(stub))
6498        }
6499
6500        /// Sets the full request, replacing any prior values.
6501        pub fn with_request<V: Into<crate::model::RejectHubSpokeRequest>>(mut self, v: V) -> Self {
6502            self.0.request = v.into();
6503            self
6504        }
6505
6506        /// Sets all the options, replacing any prior values.
6507        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6508            self.0.options = v.into();
6509            self
6510        }
6511
6512        /// Sends the request.
6513        ///
6514        /// # Long running operations
6515        ///
6516        /// This starts, but does not poll, a longrunning operation. More information
6517        /// on [reject_hub_spoke][crate::client::HubService::reject_hub_spoke].
6518        pub async fn send(self) -> Result<longrunning::model::Operation> {
6519            (*self.0.stub)
6520                .reject_hub_spoke(self.0.request, self.0.options)
6521                .await
6522                .map(gax::response::Response::into_body)
6523        }
6524
6525        /// Creates a [Poller][lro::Poller] to work with `reject_hub_spoke`.
6526        pub fn poller(
6527            self,
6528        ) -> impl lro::Poller<crate::model::RejectHubSpokeResponse, crate::model::OperationMetadata>
6529        {
6530            type Operation = lro::internal::Operation<
6531                crate::model::RejectHubSpokeResponse,
6532                crate::model::OperationMetadata,
6533            >;
6534            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6535            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6536
6537            let stub = self.0.stub.clone();
6538            let mut options = self.0.options.clone();
6539            options.set_retry_policy(gax::retry_policy::NeverRetry);
6540            let query = move |name| {
6541                let stub = stub.clone();
6542                let options = options.clone();
6543                async {
6544                    let op = GetOperation::new(stub)
6545                        .set_name(name)
6546                        .with_options(options)
6547                        .send()
6548                        .await?;
6549                    Ok(Operation::new(op))
6550                }
6551            };
6552
6553            let start = move || async {
6554                let op = self.send().await?;
6555                Ok(Operation::new(op))
6556            };
6557
6558            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
6559        }
6560
6561        /// Sets the value of [name][crate::model::RejectHubSpokeRequest::name].
6562        ///
6563        /// This is a **required** field for requests.
6564        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6565            self.0.request.name = v.into();
6566            self
6567        }
6568
6569        /// Sets the value of [spoke_uri][crate::model::RejectHubSpokeRequest::spoke_uri].
6570        ///
6571        /// This is a **required** field for requests.
6572        pub fn set_spoke_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
6573            self.0.request.spoke_uri = v.into();
6574            self
6575        }
6576
6577        /// Sets the value of [request_id][crate::model::RejectHubSpokeRequest::request_id].
6578        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6579            self.0.request.request_id = v.into();
6580            self
6581        }
6582
6583        /// Sets the value of [details][crate::model::RejectHubSpokeRequest::details].
6584        pub fn set_details<T: Into<std::string::String>>(mut self, v: T) -> Self {
6585            self.0.request.details = v.into();
6586            self
6587        }
6588    }
6589
6590    #[doc(hidden)]
6591    impl gax::options::internal::RequestBuilder for RejectHubSpoke {
6592        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6593            &mut self.0.options
6594        }
6595    }
6596
6597    /// The request builder for [HubService::accept_hub_spoke][crate::client::HubService::accept_hub_spoke] calls.
6598    ///
6599    /// # Example
6600    /// ```
6601    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::AcceptHubSpoke;
6602    /// # async fn sample() -> gax::Result<()> {
6603    /// use lro::Poller;
6604    ///
6605    /// let builder = prepare_request_builder();
6606    /// let response = builder.poller().until_done().await?;
6607    /// # Ok(()) }
6608    ///
6609    /// fn prepare_request_builder() -> AcceptHubSpoke {
6610    ///   # panic!();
6611    ///   // ... details omitted ...
6612    /// }
6613    /// ```
6614    #[derive(Clone, Debug)]
6615    pub struct AcceptHubSpoke(RequestBuilder<crate::model::AcceptHubSpokeRequest>);
6616
6617    impl AcceptHubSpoke {
6618        pub(crate) fn new(
6619            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6620        ) -> Self {
6621            Self(RequestBuilder::new(stub))
6622        }
6623
6624        /// Sets the full request, replacing any prior values.
6625        pub fn with_request<V: Into<crate::model::AcceptHubSpokeRequest>>(mut self, v: V) -> Self {
6626            self.0.request = v.into();
6627            self
6628        }
6629
6630        /// Sets all the options, replacing any prior values.
6631        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6632            self.0.options = v.into();
6633            self
6634        }
6635
6636        /// Sends the request.
6637        ///
6638        /// # Long running operations
6639        ///
6640        /// This starts, but does not poll, a longrunning operation. More information
6641        /// on [accept_hub_spoke][crate::client::HubService::accept_hub_spoke].
6642        pub async fn send(self) -> Result<longrunning::model::Operation> {
6643            (*self.0.stub)
6644                .accept_hub_spoke(self.0.request, self.0.options)
6645                .await
6646                .map(gax::response::Response::into_body)
6647        }
6648
6649        /// Creates a [Poller][lro::Poller] to work with `accept_hub_spoke`.
6650        pub fn poller(
6651            self,
6652        ) -> impl lro::Poller<crate::model::AcceptHubSpokeResponse, crate::model::OperationMetadata>
6653        {
6654            type Operation = lro::internal::Operation<
6655                crate::model::AcceptHubSpokeResponse,
6656                crate::model::OperationMetadata,
6657            >;
6658            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6659            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6660
6661            let stub = self.0.stub.clone();
6662            let mut options = self.0.options.clone();
6663            options.set_retry_policy(gax::retry_policy::NeverRetry);
6664            let query = move |name| {
6665                let stub = stub.clone();
6666                let options = options.clone();
6667                async {
6668                    let op = GetOperation::new(stub)
6669                        .set_name(name)
6670                        .with_options(options)
6671                        .send()
6672                        .await?;
6673                    Ok(Operation::new(op))
6674                }
6675            };
6676
6677            let start = move || async {
6678                let op = self.send().await?;
6679                Ok(Operation::new(op))
6680            };
6681
6682            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
6683        }
6684
6685        /// Sets the value of [name][crate::model::AcceptHubSpokeRequest::name].
6686        ///
6687        /// This is a **required** field for requests.
6688        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6689            self.0.request.name = v.into();
6690            self
6691        }
6692
6693        /// Sets the value of [spoke_uri][crate::model::AcceptHubSpokeRequest::spoke_uri].
6694        ///
6695        /// This is a **required** field for requests.
6696        pub fn set_spoke_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
6697            self.0.request.spoke_uri = v.into();
6698            self
6699        }
6700
6701        /// Sets the value of [request_id][crate::model::AcceptHubSpokeRequest::request_id].
6702        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6703            self.0.request.request_id = v.into();
6704            self
6705        }
6706    }
6707
6708    #[doc(hidden)]
6709    impl gax::options::internal::RequestBuilder for AcceptHubSpoke {
6710        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6711            &mut self.0.options
6712        }
6713    }
6714
6715    /// The request builder for [HubService::accept_spoke_update][crate::client::HubService::accept_spoke_update] calls.
6716    ///
6717    /// # Example
6718    /// ```
6719    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::AcceptSpokeUpdate;
6720    /// # async fn sample() -> gax::Result<()> {
6721    /// use lro::Poller;
6722    ///
6723    /// let builder = prepare_request_builder();
6724    /// let response = builder.poller().until_done().await?;
6725    /// # Ok(()) }
6726    ///
6727    /// fn prepare_request_builder() -> AcceptSpokeUpdate {
6728    ///   # panic!();
6729    ///   // ... details omitted ...
6730    /// }
6731    /// ```
6732    #[derive(Clone, Debug)]
6733    pub struct AcceptSpokeUpdate(RequestBuilder<crate::model::AcceptSpokeUpdateRequest>);
6734
6735    impl AcceptSpokeUpdate {
6736        pub(crate) fn new(
6737            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6738        ) -> Self {
6739            Self(RequestBuilder::new(stub))
6740        }
6741
6742        /// Sets the full request, replacing any prior values.
6743        pub fn with_request<V: Into<crate::model::AcceptSpokeUpdateRequest>>(
6744            mut self,
6745            v: V,
6746        ) -> Self {
6747            self.0.request = v.into();
6748            self
6749        }
6750
6751        /// Sets all the options, replacing any prior values.
6752        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6753            self.0.options = v.into();
6754            self
6755        }
6756
6757        /// Sends the request.
6758        ///
6759        /// # Long running operations
6760        ///
6761        /// This starts, but does not poll, a longrunning operation. More information
6762        /// on [accept_spoke_update][crate::client::HubService::accept_spoke_update].
6763        pub async fn send(self) -> Result<longrunning::model::Operation> {
6764            (*self.0.stub)
6765                .accept_spoke_update(self.0.request, self.0.options)
6766                .await
6767                .map(gax::response::Response::into_body)
6768        }
6769
6770        /// Creates a [Poller][lro::Poller] to work with `accept_spoke_update`.
6771        pub fn poller(
6772            self,
6773        ) -> impl lro::Poller<crate::model::AcceptSpokeUpdateResponse, crate::model::OperationMetadata>
6774        {
6775            type Operation = lro::internal::Operation<
6776                crate::model::AcceptSpokeUpdateResponse,
6777                crate::model::OperationMetadata,
6778            >;
6779            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6780            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6781
6782            let stub = self.0.stub.clone();
6783            let mut options = self.0.options.clone();
6784            options.set_retry_policy(gax::retry_policy::NeverRetry);
6785            let query = move |name| {
6786                let stub = stub.clone();
6787                let options = options.clone();
6788                async {
6789                    let op = GetOperation::new(stub)
6790                        .set_name(name)
6791                        .with_options(options)
6792                        .send()
6793                        .await?;
6794                    Ok(Operation::new(op))
6795                }
6796            };
6797
6798            let start = move || async {
6799                let op = self.send().await?;
6800                Ok(Operation::new(op))
6801            };
6802
6803            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
6804        }
6805
6806        /// Sets the value of [name][crate::model::AcceptSpokeUpdateRequest::name].
6807        ///
6808        /// This is a **required** field for requests.
6809        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6810            self.0.request.name = v.into();
6811            self
6812        }
6813
6814        /// Sets the value of [spoke_uri][crate::model::AcceptSpokeUpdateRequest::spoke_uri].
6815        ///
6816        /// This is a **required** field for requests.
6817        pub fn set_spoke_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
6818            self.0.request.spoke_uri = v.into();
6819            self
6820        }
6821
6822        /// Sets the value of [spoke_etag][crate::model::AcceptSpokeUpdateRequest::spoke_etag].
6823        ///
6824        /// This is a **required** field for requests.
6825        pub fn set_spoke_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
6826            self.0.request.spoke_etag = v.into();
6827            self
6828        }
6829
6830        /// Sets the value of [request_id][crate::model::AcceptSpokeUpdateRequest::request_id].
6831        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6832            self.0.request.request_id = v.into();
6833            self
6834        }
6835    }
6836
6837    #[doc(hidden)]
6838    impl gax::options::internal::RequestBuilder for AcceptSpokeUpdate {
6839        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6840            &mut self.0.options
6841        }
6842    }
6843
6844    /// The request builder for [HubService::reject_spoke_update][crate::client::HubService::reject_spoke_update] calls.
6845    ///
6846    /// # Example
6847    /// ```
6848    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::RejectSpokeUpdate;
6849    /// # async fn sample() -> gax::Result<()> {
6850    /// use lro::Poller;
6851    ///
6852    /// let builder = prepare_request_builder();
6853    /// let response = builder.poller().until_done().await?;
6854    /// # Ok(()) }
6855    ///
6856    /// fn prepare_request_builder() -> RejectSpokeUpdate {
6857    ///   # panic!();
6858    ///   // ... details omitted ...
6859    /// }
6860    /// ```
6861    #[derive(Clone, Debug)]
6862    pub struct RejectSpokeUpdate(RequestBuilder<crate::model::RejectSpokeUpdateRequest>);
6863
6864    impl RejectSpokeUpdate {
6865        pub(crate) fn new(
6866            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6867        ) -> Self {
6868            Self(RequestBuilder::new(stub))
6869        }
6870
6871        /// Sets the full request, replacing any prior values.
6872        pub fn with_request<V: Into<crate::model::RejectSpokeUpdateRequest>>(
6873            mut self,
6874            v: V,
6875        ) -> Self {
6876            self.0.request = v.into();
6877            self
6878        }
6879
6880        /// Sets all the options, replacing any prior values.
6881        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6882            self.0.options = v.into();
6883            self
6884        }
6885
6886        /// Sends the request.
6887        ///
6888        /// # Long running operations
6889        ///
6890        /// This starts, but does not poll, a longrunning operation. More information
6891        /// on [reject_spoke_update][crate::client::HubService::reject_spoke_update].
6892        pub async fn send(self) -> Result<longrunning::model::Operation> {
6893            (*self.0.stub)
6894                .reject_spoke_update(self.0.request, self.0.options)
6895                .await
6896                .map(gax::response::Response::into_body)
6897        }
6898
6899        /// Creates a [Poller][lro::Poller] to work with `reject_spoke_update`.
6900        pub fn poller(
6901            self,
6902        ) -> impl lro::Poller<crate::model::RejectSpokeUpdateResponse, crate::model::OperationMetadata>
6903        {
6904            type Operation = lro::internal::Operation<
6905                crate::model::RejectSpokeUpdateResponse,
6906                crate::model::OperationMetadata,
6907            >;
6908            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6909            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6910
6911            let stub = self.0.stub.clone();
6912            let mut options = self.0.options.clone();
6913            options.set_retry_policy(gax::retry_policy::NeverRetry);
6914            let query = move |name| {
6915                let stub = stub.clone();
6916                let options = options.clone();
6917                async {
6918                    let op = GetOperation::new(stub)
6919                        .set_name(name)
6920                        .with_options(options)
6921                        .send()
6922                        .await?;
6923                    Ok(Operation::new(op))
6924                }
6925            };
6926
6927            let start = move || async {
6928                let op = self.send().await?;
6929                Ok(Operation::new(op))
6930            };
6931
6932            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
6933        }
6934
6935        /// Sets the value of [name][crate::model::RejectSpokeUpdateRequest::name].
6936        ///
6937        /// This is a **required** field for requests.
6938        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6939            self.0.request.name = v.into();
6940            self
6941        }
6942
6943        /// Sets the value of [spoke_uri][crate::model::RejectSpokeUpdateRequest::spoke_uri].
6944        ///
6945        /// This is a **required** field for requests.
6946        pub fn set_spoke_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
6947            self.0.request.spoke_uri = v.into();
6948            self
6949        }
6950
6951        /// Sets the value of [spoke_etag][crate::model::RejectSpokeUpdateRequest::spoke_etag].
6952        ///
6953        /// This is a **required** field for requests.
6954        pub fn set_spoke_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
6955            self.0.request.spoke_etag = v.into();
6956            self
6957        }
6958
6959        /// Sets the value of [details][crate::model::RejectSpokeUpdateRequest::details].
6960        pub fn set_details<T: Into<std::string::String>>(mut self, v: T) -> Self {
6961            self.0.request.details = v.into();
6962            self
6963        }
6964
6965        /// Sets the value of [request_id][crate::model::RejectSpokeUpdateRequest::request_id].
6966        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6967            self.0.request.request_id = v.into();
6968            self
6969        }
6970    }
6971
6972    #[doc(hidden)]
6973    impl gax::options::internal::RequestBuilder for RejectSpokeUpdate {
6974        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6975            &mut self.0.options
6976        }
6977    }
6978
6979    /// The request builder for [HubService::delete_spoke][crate::client::HubService::delete_spoke] calls.
6980    ///
6981    /// # Example
6982    /// ```
6983    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::DeleteSpoke;
6984    /// # async fn sample() -> gax::Result<()> {
6985    /// use lro::Poller;
6986    ///
6987    /// let builder = prepare_request_builder();
6988    /// let response = builder.poller().until_done().await?;
6989    /// # Ok(()) }
6990    ///
6991    /// fn prepare_request_builder() -> DeleteSpoke {
6992    ///   # panic!();
6993    ///   // ... details omitted ...
6994    /// }
6995    /// ```
6996    #[derive(Clone, Debug)]
6997    pub struct DeleteSpoke(RequestBuilder<crate::model::DeleteSpokeRequest>);
6998
6999    impl DeleteSpoke {
7000        pub(crate) fn new(
7001            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7002        ) -> Self {
7003            Self(RequestBuilder::new(stub))
7004        }
7005
7006        /// Sets the full request, replacing any prior values.
7007        pub fn with_request<V: Into<crate::model::DeleteSpokeRequest>>(mut self, v: V) -> Self {
7008            self.0.request = v.into();
7009            self
7010        }
7011
7012        /// Sets all the options, replacing any prior values.
7013        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7014            self.0.options = v.into();
7015            self
7016        }
7017
7018        /// Sends the request.
7019        ///
7020        /// # Long running operations
7021        ///
7022        /// This starts, but does not poll, a longrunning operation. More information
7023        /// on [delete_spoke][crate::client::HubService::delete_spoke].
7024        pub async fn send(self) -> Result<longrunning::model::Operation> {
7025            (*self.0.stub)
7026                .delete_spoke(self.0.request, self.0.options)
7027                .await
7028                .map(gax::response::Response::into_body)
7029        }
7030
7031        /// Creates a [Poller][lro::Poller] to work with `delete_spoke`.
7032        pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
7033            type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
7034            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7035            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7036
7037            let stub = self.0.stub.clone();
7038            let mut options = self.0.options.clone();
7039            options.set_retry_policy(gax::retry_policy::NeverRetry);
7040            let query = move |name| {
7041                let stub = stub.clone();
7042                let options = options.clone();
7043                async {
7044                    let op = GetOperation::new(stub)
7045                        .set_name(name)
7046                        .with_options(options)
7047                        .send()
7048                        .await?;
7049                    Ok(Operation::new(op))
7050                }
7051            };
7052
7053            let start = move || async {
7054                let op = self.send().await?;
7055                Ok(Operation::new(op))
7056            };
7057
7058            lro::internal::new_unit_response_poller(
7059                polling_error_policy,
7060                polling_backoff_policy,
7061                start,
7062                query,
7063            )
7064        }
7065
7066        /// Sets the value of [name][crate::model::DeleteSpokeRequest::name].
7067        ///
7068        /// This is a **required** field for requests.
7069        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7070            self.0.request.name = v.into();
7071            self
7072        }
7073
7074        /// Sets the value of [request_id][crate::model::DeleteSpokeRequest::request_id].
7075        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
7076            self.0.request.request_id = v.into();
7077            self
7078        }
7079    }
7080
7081    #[doc(hidden)]
7082    impl gax::options::internal::RequestBuilder for DeleteSpoke {
7083        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7084            &mut self.0.options
7085        }
7086    }
7087
7088    /// The request builder for [HubService::get_route_table][crate::client::HubService::get_route_table] calls.
7089    ///
7090    /// # Example
7091    /// ```
7092    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::GetRouteTable;
7093    /// # async fn sample() -> gax::Result<()> {
7094    ///
7095    /// let builder = prepare_request_builder();
7096    /// let response = builder.send().await?;
7097    /// # Ok(()) }
7098    ///
7099    /// fn prepare_request_builder() -> GetRouteTable {
7100    ///   # panic!();
7101    ///   // ... details omitted ...
7102    /// }
7103    /// ```
7104    #[derive(Clone, Debug)]
7105    pub struct GetRouteTable(RequestBuilder<crate::model::GetRouteTableRequest>);
7106
7107    impl GetRouteTable {
7108        pub(crate) fn new(
7109            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7110        ) -> Self {
7111            Self(RequestBuilder::new(stub))
7112        }
7113
7114        /// Sets the full request, replacing any prior values.
7115        pub fn with_request<V: Into<crate::model::GetRouteTableRequest>>(mut self, v: V) -> Self {
7116            self.0.request = v.into();
7117            self
7118        }
7119
7120        /// Sets all the options, replacing any prior values.
7121        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7122            self.0.options = v.into();
7123            self
7124        }
7125
7126        /// Sends the request.
7127        pub async fn send(self) -> Result<crate::model::RouteTable> {
7128            (*self.0.stub)
7129                .get_route_table(self.0.request, self.0.options)
7130                .await
7131                .map(gax::response::Response::into_body)
7132        }
7133
7134        /// Sets the value of [name][crate::model::GetRouteTableRequest::name].
7135        ///
7136        /// This is a **required** field for requests.
7137        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7138            self.0.request.name = v.into();
7139            self
7140        }
7141    }
7142
7143    #[doc(hidden)]
7144    impl gax::options::internal::RequestBuilder for GetRouteTable {
7145        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7146            &mut self.0.options
7147        }
7148    }
7149
7150    /// The request builder for [HubService::get_route][crate::client::HubService::get_route] calls.
7151    ///
7152    /// # Example
7153    /// ```
7154    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::GetRoute;
7155    /// # async fn sample() -> gax::Result<()> {
7156    ///
7157    /// let builder = prepare_request_builder();
7158    /// let response = builder.send().await?;
7159    /// # Ok(()) }
7160    ///
7161    /// fn prepare_request_builder() -> GetRoute {
7162    ///   # panic!();
7163    ///   // ... details omitted ...
7164    /// }
7165    /// ```
7166    #[derive(Clone, Debug)]
7167    pub struct GetRoute(RequestBuilder<crate::model::GetRouteRequest>);
7168
7169    impl GetRoute {
7170        pub(crate) fn new(
7171            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7172        ) -> Self {
7173            Self(RequestBuilder::new(stub))
7174        }
7175
7176        /// Sets the full request, replacing any prior values.
7177        pub fn with_request<V: Into<crate::model::GetRouteRequest>>(mut self, v: V) -> Self {
7178            self.0.request = v.into();
7179            self
7180        }
7181
7182        /// Sets all the options, replacing any prior values.
7183        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7184            self.0.options = v.into();
7185            self
7186        }
7187
7188        /// Sends the request.
7189        pub async fn send(self) -> Result<crate::model::Route> {
7190            (*self.0.stub)
7191                .get_route(self.0.request, self.0.options)
7192                .await
7193                .map(gax::response::Response::into_body)
7194        }
7195
7196        /// Sets the value of [name][crate::model::GetRouteRequest::name].
7197        ///
7198        /// This is a **required** field for requests.
7199        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7200            self.0.request.name = v.into();
7201            self
7202        }
7203    }
7204
7205    #[doc(hidden)]
7206    impl gax::options::internal::RequestBuilder for GetRoute {
7207        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7208            &mut self.0.options
7209        }
7210    }
7211
7212    /// The request builder for [HubService::list_routes][crate::client::HubService::list_routes] calls.
7213    ///
7214    /// # Example
7215    /// ```
7216    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::ListRoutes;
7217    /// # async fn sample() -> gax::Result<()> {
7218    /// use gax::paginator::ItemPaginator;
7219    ///
7220    /// let builder = prepare_request_builder();
7221    /// let mut items = builder.by_item();
7222    /// while let Some(result) = items.next().await {
7223    ///   let item = result?;
7224    /// }
7225    /// # Ok(()) }
7226    ///
7227    /// fn prepare_request_builder() -> ListRoutes {
7228    ///   # panic!();
7229    ///   // ... details omitted ...
7230    /// }
7231    /// ```
7232    #[derive(Clone, Debug)]
7233    pub struct ListRoutes(RequestBuilder<crate::model::ListRoutesRequest>);
7234
7235    impl ListRoutes {
7236        pub(crate) fn new(
7237            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7238        ) -> Self {
7239            Self(RequestBuilder::new(stub))
7240        }
7241
7242        /// Sets the full request, replacing any prior values.
7243        pub fn with_request<V: Into<crate::model::ListRoutesRequest>>(mut self, v: V) -> Self {
7244            self.0.request = v.into();
7245            self
7246        }
7247
7248        /// Sets all the options, replacing any prior values.
7249        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7250            self.0.options = v.into();
7251            self
7252        }
7253
7254        /// Sends the request.
7255        pub async fn send(self) -> Result<crate::model::ListRoutesResponse> {
7256            (*self.0.stub)
7257                .list_routes(self.0.request, self.0.options)
7258                .await
7259                .map(gax::response::Response::into_body)
7260        }
7261
7262        /// Streams each page in the collection.
7263        pub fn by_page(
7264            self,
7265        ) -> impl gax::paginator::Paginator<crate::model::ListRoutesResponse, gax::error::Error>
7266        {
7267            use std::clone::Clone;
7268            let token = self.0.request.page_token.clone();
7269            let execute = move |token: String| {
7270                let mut builder = self.clone();
7271                builder.0.request = builder.0.request.set_page_token(token);
7272                builder.send()
7273            };
7274            gax::paginator::internal::new_paginator(token, execute)
7275        }
7276
7277        /// Streams each item in the collection.
7278        pub fn by_item(
7279            self,
7280        ) -> impl gax::paginator::ItemPaginator<crate::model::ListRoutesResponse, gax::error::Error>
7281        {
7282            use gax::paginator::Paginator;
7283            self.by_page().items()
7284        }
7285
7286        /// Sets the value of [parent][crate::model::ListRoutesRequest::parent].
7287        ///
7288        /// This is a **required** field for requests.
7289        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7290            self.0.request.parent = v.into();
7291            self
7292        }
7293
7294        /// Sets the value of [page_size][crate::model::ListRoutesRequest::page_size].
7295        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7296            self.0.request.page_size = v.into();
7297            self
7298        }
7299
7300        /// Sets the value of [page_token][crate::model::ListRoutesRequest::page_token].
7301        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7302            self.0.request.page_token = v.into();
7303            self
7304        }
7305
7306        /// Sets the value of [filter][crate::model::ListRoutesRequest::filter].
7307        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7308            self.0.request.filter = v.into();
7309            self
7310        }
7311
7312        /// Sets the value of [order_by][crate::model::ListRoutesRequest::order_by].
7313        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
7314            self.0.request.order_by = v.into();
7315            self
7316        }
7317    }
7318
7319    #[doc(hidden)]
7320    impl gax::options::internal::RequestBuilder for ListRoutes {
7321        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7322            &mut self.0.options
7323        }
7324    }
7325
7326    /// The request builder for [HubService::list_route_tables][crate::client::HubService::list_route_tables] calls.
7327    ///
7328    /// # Example
7329    /// ```
7330    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::ListRouteTables;
7331    /// # async fn sample() -> gax::Result<()> {
7332    /// use gax::paginator::ItemPaginator;
7333    ///
7334    /// let builder = prepare_request_builder();
7335    /// let mut items = builder.by_item();
7336    /// while let Some(result) = items.next().await {
7337    ///   let item = result?;
7338    /// }
7339    /// # Ok(()) }
7340    ///
7341    /// fn prepare_request_builder() -> ListRouteTables {
7342    ///   # panic!();
7343    ///   // ... details omitted ...
7344    /// }
7345    /// ```
7346    #[derive(Clone, Debug)]
7347    pub struct ListRouteTables(RequestBuilder<crate::model::ListRouteTablesRequest>);
7348
7349    impl ListRouteTables {
7350        pub(crate) fn new(
7351            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7352        ) -> Self {
7353            Self(RequestBuilder::new(stub))
7354        }
7355
7356        /// Sets the full request, replacing any prior values.
7357        pub fn with_request<V: Into<crate::model::ListRouteTablesRequest>>(mut self, v: V) -> Self {
7358            self.0.request = v.into();
7359            self
7360        }
7361
7362        /// Sets all the options, replacing any prior values.
7363        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7364            self.0.options = v.into();
7365            self
7366        }
7367
7368        /// Sends the request.
7369        pub async fn send(self) -> Result<crate::model::ListRouteTablesResponse> {
7370            (*self.0.stub)
7371                .list_route_tables(self.0.request, self.0.options)
7372                .await
7373                .map(gax::response::Response::into_body)
7374        }
7375
7376        /// Streams each page in the collection.
7377        pub fn by_page(
7378            self,
7379        ) -> impl gax::paginator::Paginator<crate::model::ListRouteTablesResponse, gax::error::Error>
7380        {
7381            use std::clone::Clone;
7382            let token = self.0.request.page_token.clone();
7383            let execute = move |token: String| {
7384                let mut builder = self.clone();
7385                builder.0.request = builder.0.request.set_page_token(token);
7386                builder.send()
7387            };
7388            gax::paginator::internal::new_paginator(token, execute)
7389        }
7390
7391        /// Streams each item in the collection.
7392        pub fn by_item(
7393            self,
7394        ) -> impl gax::paginator::ItemPaginator<crate::model::ListRouteTablesResponse, gax::error::Error>
7395        {
7396            use gax::paginator::Paginator;
7397            self.by_page().items()
7398        }
7399
7400        /// Sets the value of [parent][crate::model::ListRouteTablesRequest::parent].
7401        ///
7402        /// This is a **required** field for requests.
7403        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7404            self.0.request.parent = v.into();
7405            self
7406        }
7407
7408        /// Sets the value of [page_size][crate::model::ListRouteTablesRequest::page_size].
7409        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7410            self.0.request.page_size = v.into();
7411            self
7412        }
7413
7414        /// Sets the value of [page_token][crate::model::ListRouteTablesRequest::page_token].
7415        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7416            self.0.request.page_token = v.into();
7417            self
7418        }
7419
7420        /// Sets the value of [filter][crate::model::ListRouteTablesRequest::filter].
7421        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7422            self.0.request.filter = v.into();
7423            self
7424        }
7425
7426        /// Sets the value of [order_by][crate::model::ListRouteTablesRequest::order_by].
7427        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
7428            self.0.request.order_by = v.into();
7429            self
7430        }
7431    }
7432
7433    #[doc(hidden)]
7434    impl gax::options::internal::RequestBuilder for ListRouteTables {
7435        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7436            &mut self.0.options
7437        }
7438    }
7439
7440    /// The request builder for [HubService::get_group][crate::client::HubService::get_group] calls.
7441    ///
7442    /// # Example
7443    /// ```
7444    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::GetGroup;
7445    /// # async fn sample() -> gax::Result<()> {
7446    ///
7447    /// let builder = prepare_request_builder();
7448    /// let response = builder.send().await?;
7449    /// # Ok(()) }
7450    ///
7451    /// fn prepare_request_builder() -> GetGroup {
7452    ///   # panic!();
7453    ///   // ... details omitted ...
7454    /// }
7455    /// ```
7456    #[derive(Clone, Debug)]
7457    pub struct GetGroup(RequestBuilder<crate::model::GetGroupRequest>);
7458
7459    impl GetGroup {
7460        pub(crate) fn new(
7461            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7462        ) -> Self {
7463            Self(RequestBuilder::new(stub))
7464        }
7465
7466        /// Sets the full request, replacing any prior values.
7467        pub fn with_request<V: Into<crate::model::GetGroupRequest>>(mut self, v: V) -> Self {
7468            self.0.request = v.into();
7469            self
7470        }
7471
7472        /// Sets all the options, replacing any prior values.
7473        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7474            self.0.options = v.into();
7475            self
7476        }
7477
7478        /// Sends the request.
7479        pub async fn send(self) -> Result<crate::model::Group> {
7480            (*self.0.stub)
7481                .get_group(self.0.request, self.0.options)
7482                .await
7483                .map(gax::response::Response::into_body)
7484        }
7485
7486        /// Sets the value of [name][crate::model::GetGroupRequest::name].
7487        ///
7488        /// This is a **required** field for requests.
7489        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7490            self.0.request.name = v.into();
7491            self
7492        }
7493    }
7494
7495    #[doc(hidden)]
7496    impl gax::options::internal::RequestBuilder for GetGroup {
7497        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7498            &mut self.0.options
7499        }
7500    }
7501
7502    /// The request builder for [HubService::list_groups][crate::client::HubService::list_groups] calls.
7503    ///
7504    /// # Example
7505    /// ```
7506    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::ListGroups;
7507    /// # async fn sample() -> gax::Result<()> {
7508    /// use gax::paginator::ItemPaginator;
7509    ///
7510    /// let builder = prepare_request_builder();
7511    /// let mut items = builder.by_item();
7512    /// while let Some(result) = items.next().await {
7513    ///   let item = result?;
7514    /// }
7515    /// # Ok(()) }
7516    ///
7517    /// fn prepare_request_builder() -> ListGroups {
7518    ///   # panic!();
7519    ///   // ... details omitted ...
7520    /// }
7521    /// ```
7522    #[derive(Clone, Debug)]
7523    pub struct ListGroups(RequestBuilder<crate::model::ListGroupsRequest>);
7524
7525    impl ListGroups {
7526        pub(crate) fn new(
7527            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7528        ) -> Self {
7529            Self(RequestBuilder::new(stub))
7530        }
7531
7532        /// Sets the full request, replacing any prior values.
7533        pub fn with_request<V: Into<crate::model::ListGroupsRequest>>(mut self, v: V) -> Self {
7534            self.0.request = v.into();
7535            self
7536        }
7537
7538        /// Sets all the options, replacing any prior values.
7539        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7540            self.0.options = v.into();
7541            self
7542        }
7543
7544        /// Sends the request.
7545        pub async fn send(self) -> Result<crate::model::ListGroupsResponse> {
7546            (*self.0.stub)
7547                .list_groups(self.0.request, self.0.options)
7548                .await
7549                .map(gax::response::Response::into_body)
7550        }
7551
7552        /// Streams each page in the collection.
7553        pub fn by_page(
7554            self,
7555        ) -> impl gax::paginator::Paginator<crate::model::ListGroupsResponse, gax::error::Error>
7556        {
7557            use std::clone::Clone;
7558            let token = self.0.request.page_token.clone();
7559            let execute = move |token: String| {
7560                let mut builder = self.clone();
7561                builder.0.request = builder.0.request.set_page_token(token);
7562                builder.send()
7563            };
7564            gax::paginator::internal::new_paginator(token, execute)
7565        }
7566
7567        /// Streams each item in the collection.
7568        pub fn by_item(
7569            self,
7570        ) -> impl gax::paginator::ItemPaginator<crate::model::ListGroupsResponse, gax::error::Error>
7571        {
7572            use gax::paginator::Paginator;
7573            self.by_page().items()
7574        }
7575
7576        /// Sets the value of [parent][crate::model::ListGroupsRequest::parent].
7577        ///
7578        /// This is a **required** field for requests.
7579        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7580            self.0.request.parent = v.into();
7581            self
7582        }
7583
7584        /// Sets the value of [page_size][crate::model::ListGroupsRequest::page_size].
7585        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7586            self.0.request.page_size = v.into();
7587            self
7588        }
7589
7590        /// Sets the value of [page_token][crate::model::ListGroupsRequest::page_token].
7591        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7592            self.0.request.page_token = v.into();
7593            self
7594        }
7595
7596        /// Sets the value of [filter][crate::model::ListGroupsRequest::filter].
7597        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7598            self.0.request.filter = v.into();
7599            self
7600        }
7601
7602        /// Sets the value of [order_by][crate::model::ListGroupsRequest::order_by].
7603        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
7604            self.0.request.order_by = v.into();
7605            self
7606        }
7607    }
7608
7609    #[doc(hidden)]
7610    impl gax::options::internal::RequestBuilder for ListGroups {
7611        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7612            &mut self.0.options
7613        }
7614    }
7615
7616    /// The request builder for [HubService::update_group][crate::client::HubService::update_group] calls.
7617    ///
7618    /// # Example
7619    /// ```
7620    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::UpdateGroup;
7621    /// # async fn sample() -> gax::Result<()> {
7622    /// use lro::Poller;
7623    ///
7624    /// let builder = prepare_request_builder();
7625    /// let response = builder.poller().until_done().await?;
7626    /// # Ok(()) }
7627    ///
7628    /// fn prepare_request_builder() -> UpdateGroup {
7629    ///   # panic!();
7630    ///   // ... details omitted ...
7631    /// }
7632    /// ```
7633    #[derive(Clone, Debug)]
7634    pub struct UpdateGroup(RequestBuilder<crate::model::UpdateGroupRequest>);
7635
7636    impl UpdateGroup {
7637        pub(crate) fn new(
7638            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7639        ) -> Self {
7640            Self(RequestBuilder::new(stub))
7641        }
7642
7643        /// Sets the full request, replacing any prior values.
7644        pub fn with_request<V: Into<crate::model::UpdateGroupRequest>>(mut self, v: V) -> Self {
7645            self.0.request = v.into();
7646            self
7647        }
7648
7649        /// Sets all the options, replacing any prior values.
7650        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7651            self.0.options = v.into();
7652            self
7653        }
7654
7655        /// Sends the request.
7656        ///
7657        /// # Long running operations
7658        ///
7659        /// This starts, but does not poll, a longrunning operation. More information
7660        /// on [update_group][crate::client::HubService::update_group].
7661        pub async fn send(self) -> Result<longrunning::model::Operation> {
7662            (*self.0.stub)
7663                .update_group(self.0.request, self.0.options)
7664                .await
7665                .map(gax::response::Response::into_body)
7666        }
7667
7668        /// Creates a [Poller][lro::Poller] to work with `update_group`.
7669        pub fn poller(
7670            self,
7671        ) -> impl lro::Poller<crate::model::Group, crate::model::OperationMetadata> {
7672            type Operation =
7673                lro::internal::Operation<crate::model::Group, crate::model::OperationMetadata>;
7674            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7675            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7676
7677            let stub = self.0.stub.clone();
7678            let mut options = self.0.options.clone();
7679            options.set_retry_policy(gax::retry_policy::NeverRetry);
7680            let query = move |name| {
7681                let stub = stub.clone();
7682                let options = options.clone();
7683                async {
7684                    let op = GetOperation::new(stub)
7685                        .set_name(name)
7686                        .with_options(options)
7687                        .send()
7688                        .await?;
7689                    Ok(Operation::new(op))
7690                }
7691            };
7692
7693            let start = move || async {
7694                let op = self.send().await?;
7695                Ok(Operation::new(op))
7696            };
7697
7698            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
7699        }
7700
7701        /// Sets the value of [update_mask][crate::model::UpdateGroupRequest::update_mask].
7702        pub fn set_update_mask<T>(mut self, v: T) -> Self
7703        where
7704            T: std::convert::Into<wkt::FieldMask>,
7705        {
7706            self.0.request.update_mask = std::option::Option::Some(v.into());
7707            self
7708        }
7709
7710        /// Sets or clears the value of [update_mask][crate::model::UpdateGroupRequest::update_mask].
7711        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7712        where
7713            T: std::convert::Into<wkt::FieldMask>,
7714        {
7715            self.0.request.update_mask = v.map(|x| x.into());
7716            self
7717        }
7718
7719        /// Sets the value of [group][crate::model::UpdateGroupRequest::group].
7720        ///
7721        /// This is a **required** field for requests.
7722        pub fn set_group<T>(mut self, v: T) -> Self
7723        where
7724            T: std::convert::Into<crate::model::Group>,
7725        {
7726            self.0.request.group = std::option::Option::Some(v.into());
7727            self
7728        }
7729
7730        /// Sets or clears the value of [group][crate::model::UpdateGroupRequest::group].
7731        ///
7732        /// This is a **required** field for requests.
7733        pub fn set_or_clear_group<T>(mut self, v: std::option::Option<T>) -> Self
7734        where
7735            T: std::convert::Into<crate::model::Group>,
7736        {
7737            self.0.request.group = v.map(|x| x.into());
7738            self
7739        }
7740
7741        /// Sets the value of [request_id][crate::model::UpdateGroupRequest::request_id].
7742        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
7743            self.0.request.request_id = v.into();
7744            self
7745        }
7746    }
7747
7748    #[doc(hidden)]
7749    impl gax::options::internal::RequestBuilder for UpdateGroup {
7750        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7751            &mut self.0.options
7752        }
7753    }
7754
7755    /// The request builder for [HubService::list_locations][crate::client::HubService::list_locations] calls.
7756    ///
7757    /// # Example
7758    /// ```
7759    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::ListLocations;
7760    /// # async fn sample() -> gax::Result<()> {
7761    /// use gax::paginator::ItemPaginator;
7762    ///
7763    /// let builder = prepare_request_builder();
7764    /// let mut items = builder.by_item();
7765    /// while let Some(result) = items.next().await {
7766    ///   let item = result?;
7767    /// }
7768    /// # Ok(()) }
7769    ///
7770    /// fn prepare_request_builder() -> ListLocations {
7771    ///   # panic!();
7772    ///   // ... details omitted ...
7773    /// }
7774    /// ```
7775    #[derive(Clone, Debug)]
7776    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
7777
7778    impl ListLocations {
7779        pub(crate) fn new(
7780            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7781        ) -> Self {
7782            Self(RequestBuilder::new(stub))
7783        }
7784
7785        /// Sets the full request, replacing any prior values.
7786        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
7787            mut self,
7788            v: V,
7789        ) -> Self {
7790            self.0.request = v.into();
7791            self
7792        }
7793
7794        /// Sets all the options, replacing any prior values.
7795        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7796            self.0.options = v.into();
7797            self
7798        }
7799
7800        /// Sends the request.
7801        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
7802            (*self.0.stub)
7803                .list_locations(self.0.request, self.0.options)
7804                .await
7805                .map(gax::response::Response::into_body)
7806        }
7807
7808        /// Streams each page in the collection.
7809        pub fn by_page(
7810            self,
7811        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
7812        {
7813            use std::clone::Clone;
7814            let token = self.0.request.page_token.clone();
7815            let execute = move |token: String| {
7816                let mut builder = self.clone();
7817                builder.0.request = builder.0.request.set_page_token(token);
7818                builder.send()
7819            };
7820            gax::paginator::internal::new_paginator(token, execute)
7821        }
7822
7823        /// Streams each item in the collection.
7824        pub fn by_item(
7825            self,
7826        ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
7827        {
7828            use gax::paginator::Paginator;
7829            self.by_page().items()
7830        }
7831
7832        /// Sets the value of [name][location::model::ListLocationsRequest::name].
7833        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7834            self.0.request.name = v.into();
7835            self
7836        }
7837
7838        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
7839        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7840            self.0.request.filter = v.into();
7841            self
7842        }
7843
7844        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
7845        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7846            self.0.request.page_size = v.into();
7847            self
7848        }
7849
7850        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
7851        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7852            self.0.request.page_token = v.into();
7853            self
7854        }
7855    }
7856
7857    #[doc(hidden)]
7858    impl gax::options::internal::RequestBuilder for ListLocations {
7859        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7860            &mut self.0.options
7861        }
7862    }
7863
7864    /// The request builder for [HubService::get_location][crate::client::HubService::get_location] calls.
7865    ///
7866    /// # Example
7867    /// ```
7868    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::GetLocation;
7869    /// # async fn sample() -> gax::Result<()> {
7870    ///
7871    /// let builder = prepare_request_builder();
7872    /// let response = builder.send().await?;
7873    /// # Ok(()) }
7874    ///
7875    /// fn prepare_request_builder() -> GetLocation {
7876    ///   # panic!();
7877    ///   // ... details omitted ...
7878    /// }
7879    /// ```
7880    #[derive(Clone, Debug)]
7881    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
7882
7883    impl GetLocation {
7884        pub(crate) fn new(
7885            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7886        ) -> Self {
7887            Self(RequestBuilder::new(stub))
7888        }
7889
7890        /// Sets the full request, replacing any prior values.
7891        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
7892            self.0.request = v.into();
7893            self
7894        }
7895
7896        /// Sets all the options, replacing any prior values.
7897        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7898            self.0.options = v.into();
7899            self
7900        }
7901
7902        /// Sends the request.
7903        pub async fn send(self) -> Result<location::model::Location> {
7904            (*self.0.stub)
7905                .get_location(self.0.request, self.0.options)
7906                .await
7907                .map(gax::response::Response::into_body)
7908        }
7909
7910        /// Sets the value of [name][location::model::GetLocationRequest::name].
7911        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7912            self.0.request.name = v.into();
7913            self
7914        }
7915    }
7916
7917    #[doc(hidden)]
7918    impl gax::options::internal::RequestBuilder for GetLocation {
7919        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7920            &mut self.0.options
7921        }
7922    }
7923
7924    /// The request builder for [HubService::set_iam_policy][crate::client::HubService::set_iam_policy] calls.
7925    ///
7926    /// # Example
7927    /// ```
7928    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::SetIamPolicy;
7929    /// # async fn sample() -> gax::Result<()> {
7930    ///
7931    /// let builder = prepare_request_builder();
7932    /// let response = builder.send().await?;
7933    /// # Ok(()) }
7934    ///
7935    /// fn prepare_request_builder() -> SetIamPolicy {
7936    ///   # panic!();
7937    ///   // ... details omitted ...
7938    /// }
7939    /// ```
7940    #[derive(Clone, Debug)]
7941    pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
7942
7943    impl SetIamPolicy {
7944        pub(crate) fn new(
7945            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7946        ) -> Self {
7947            Self(RequestBuilder::new(stub))
7948        }
7949
7950        /// Sets the full request, replacing any prior values.
7951        pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
7952            self.0.request = v.into();
7953            self
7954        }
7955
7956        /// Sets all the options, replacing any prior values.
7957        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7958            self.0.options = v.into();
7959            self
7960        }
7961
7962        /// Sends the request.
7963        pub async fn send(self) -> Result<iam_v1::model::Policy> {
7964            (*self.0.stub)
7965                .set_iam_policy(self.0.request, self.0.options)
7966                .await
7967                .map(gax::response::Response::into_body)
7968        }
7969
7970        /// Sets the value of [resource][iam_v1::model::SetIamPolicyRequest::resource].
7971        ///
7972        /// This is a **required** field for requests.
7973        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
7974            self.0.request.resource = v.into();
7975            self
7976        }
7977
7978        /// Sets the value of [policy][iam_v1::model::SetIamPolicyRequest::policy].
7979        ///
7980        /// This is a **required** field for requests.
7981        pub fn set_policy<T>(mut self, v: T) -> Self
7982        where
7983            T: std::convert::Into<iam_v1::model::Policy>,
7984        {
7985            self.0.request.policy = std::option::Option::Some(v.into());
7986            self
7987        }
7988
7989        /// Sets or clears the value of [policy][iam_v1::model::SetIamPolicyRequest::policy].
7990        ///
7991        /// This is a **required** field for requests.
7992        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
7993        where
7994            T: std::convert::Into<iam_v1::model::Policy>,
7995        {
7996            self.0.request.policy = v.map(|x| x.into());
7997            self
7998        }
7999
8000        /// Sets the value of [update_mask][iam_v1::model::SetIamPolicyRequest::update_mask].
8001        pub fn set_update_mask<T>(mut self, v: T) -> Self
8002        where
8003            T: std::convert::Into<wkt::FieldMask>,
8004        {
8005            self.0.request.update_mask = std::option::Option::Some(v.into());
8006            self
8007        }
8008
8009        /// Sets or clears the value of [update_mask][iam_v1::model::SetIamPolicyRequest::update_mask].
8010        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
8011        where
8012            T: std::convert::Into<wkt::FieldMask>,
8013        {
8014            self.0.request.update_mask = v.map(|x| x.into());
8015            self
8016        }
8017    }
8018
8019    #[doc(hidden)]
8020    impl gax::options::internal::RequestBuilder for SetIamPolicy {
8021        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8022            &mut self.0.options
8023        }
8024    }
8025
8026    /// The request builder for [HubService::get_iam_policy][crate::client::HubService::get_iam_policy] calls.
8027    ///
8028    /// # Example
8029    /// ```
8030    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::GetIamPolicy;
8031    /// # async fn sample() -> gax::Result<()> {
8032    ///
8033    /// let builder = prepare_request_builder();
8034    /// let response = builder.send().await?;
8035    /// # Ok(()) }
8036    ///
8037    /// fn prepare_request_builder() -> GetIamPolicy {
8038    ///   # panic!();
8039    ///   // ... details omitted ...
8040    /// }
8041    /// ```
8042    #[derive(Clone, Debug)]
8043    pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
8044
8045    impl GetIamPolicy {
8046        pub(crate) fn new(
8047            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8048        ) -> Self {
8049            Self(RequestBuilder::new(stub))
8050        }
8051
8052        /// Sets the full request, replacing any prior values.
8053        pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
8054            self.0.request = v.into();
8055            self
8056        }
8057
8058        /// Sets all the options, replacing any prior values.
8059        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8060            self.0.options = v.into();
8061            self
8062        }
8063
8064        /// Sends the request.
8065        pub async fn send(self) -> Result<iam_v1::model::Policy> {
8066            (*self.0.stub)
8067                .get_iam_policy(self.0.request, self.0.options)
8068                .await
8069                .map(gax::response::Response::into_body)
8070        }
8071
8072        /// Sets the value of [resource][iam_v1::model::GetIamPolicyRequest::resource].
8073        ///
8074        /// This is a **required** field for requests.
8075        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
8076            self.0.request.resource = v.into();
8077            self
8078        }
8079
8080        /// Sets the value of [options][iam_v1::model::GetIamPolicyRequest::options].
8081        pub fn set_options<T>(mut self, v: T) -> Self
8082        where
8083            T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
8084        {
8085            self.0.request.options = std::option::Option::Some(v.into());
8086            self
8087        }
8088
8089        /// Sets or clears the value of [options][iam_v1::model::GetIamPolicyRequest::options].
8090        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
8091        where
8092            T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
8093        {
8094            self.0.request.options = v.map(|x| x.into());
8095            self
8096        }
8097    }
8098
8099    #[doc(hidden)]
8100    impl gax::options::internal::RequestBuilder for GetIamPolicy {
8101        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8102            &mut self.0.options
8103        }
8104    }
8105
8106    /// The request builder for [HubService::test_iam_permissions][crate::client::HubService::test_iam_permissions] calls.
8107    ///
8108    /// # Example
8109    /// ```
8110    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::TestIamPermissions;
8111    /// # async fn sample() -> gax::Result<()> {
8112    ///
8113    /// let builder = prepare_request_builder();
8114    /// let response = builder.send().await?;
8115    /// # Ok(()) }
8116    ///
8117    /// fn prepare_request_builder() -> TestIamPermissions {
8118    ///   # panic!();
8119    ///   // ... details omitted ...
8120    /// }
8121    /// ```
8122    #[derive(Clone, Debug)]
8123    pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
8124
8125    impl TestIamPermissions {
8126        pub(crate) fn new(
8127            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8128        ) -> Self {
8129            Self(RequestBuilder::new(stub))
8130        }
8131
8132        /// Sets the full request, replacing any prior values.
8133        pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
8134            mut self,
8135            v: V,
8136        ) -> Self {
8137            self.0.request = v.into();
8138            self
8139        }
8140
8141        /// Sets all the options, replacing any prior values.
8142        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8143            self.0.options = v.into();
8144            self
8145        }
8146
8147        /// Sends the request.
8148        pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
8149            (*self.0.stub)
8150                .test_iam_permissions(self.0.request, self.0.options)
8151                .await
8152                .map(gax::response::Response::into_body)
8153        }
8154
8155        /// Sets the value of [resource][iam_v1::model::TestIamPermissionsRequest::resource].
8156        ///
8157        /// This is a **required** field for requests.
8158        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
8159            self.0.request.resource = v.into();
8160            self
8161        }
8162
8163        /// Sets the value of [permissions][iam_v1::model::TestIamPermissionsRequest::permissions].
8164        ///
8165        /// This is a **required** field for requests.
8166        pub fn set_permissions<T, V>(mut self, v: T) -> Self
8167        where
8168            T: std::iter::IntoIterator<Item = V>,
8169            V: std::convert::Into<std::string::String>,
8170        {
8171            use std::iter::Iterator;
8172            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
8173            self
8174        }
8175    }
8176
8177    #[doc(hidden)]
8178    impl gax::options::internal::RequestBuilder for TestIamPermissions {
8179        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8180            &mut self.0.options
8181        }
8182    }
8183
8184    /// The request builder for [HubService::list_operations][crate::client::HubService::list_operations] calls.
8185    ///
8186    /// # Example
8187    /// ```
8188    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::ListOperations;
8189    /// # async fn sample() -> gax::Result<()> {
8190    /// use gax::paginator::ItemPaginator;
8191    ///
8192    /// let builder = prepare_request_builder();
8193    /// let mut items = builder.by_item();
8194    /// while let Some(result) = items.next().await {
8195    ///   let item = result?;
8196    /// }
8197    /// # Ok(()) }
8198    ///
8199    /// fn prepare_request_builder() -> ListOperations {
8200    ///   # panic!();
8201    ///   // ... details omitted ...
8202    /// }
8203    /// ```
8204    #[derive(Clone, Debug)]
8205    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
8206
8207    impl ListOperations {
8208        pub(crate) fn new(
8209            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8210        ) -> Self {
8211            Self(RequestBuilder::new(stub))
8212        }
8213
8214        /// Sets the full request, replacing any prior values.
8215        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
8216            mut self,
8217            v: V,
8218        ) -> Self {
8219            self.0.request = v.into();
8220            self
8221        }
8222
8223        /// Sets all the options, replacing any prior values.
8224        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8225            self.0.options = v.into();
8226            self
8227        }
8228
8229        /// Sends the request.
8230        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
8231            (*self.0.stub)
8232                .list_operations(self.0.request, self.0.options)
8233                .await
8234                .map(gax::response::Response::into_body)
8235        }
8236
8237        /// Streams each page in the collection.
8238        pub fn by_page(
8239            self,
8240        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
8241        {
8242            use std::clone::Clone;
8243            let token = self.0.request.page_token.clone();
8244            let execute = move |token: String| {
8245                let mut builder = self.clone();
8246                builder.0.request = builder.0.request.set_page_token(token);
8247                builder.send()
8248            };
8249            gax::paginator::internal::new_paginator(token, execute)
8250        }
8251
8252        /// Streams each item in the collection.
8253        pub fn by_item(
8254            self,
8255        ) -> impl gax::paginator::ItemPaginator<
8256            longrunning::model::ListOperationsResponse,
8257            gax::error::Error,
8258        > {
8259            use gax::paginator::Paginator;
8260            self.by_page().items()
8261        }
8262
8263        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
8264        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8265            self.0.request.name = v.into();
8266            self
8267        }
8268
8269        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
8270        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8271            self.0.request.filter = v.into();
8272            self
8273        }
8274
8275        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
8276        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8277            self.0.request.page_size = v.into();
8278            self
8279        }
8280
8281        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
8282        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8283            self.0.request.page_token = v.into();
8284            self
8285        }
8286
8287        /// Sets the value of [return_partial_success][longrunning::model::ListOperationsRequest::return_partial_success].
8288        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
8289            self.0.request.return_partial_success = v.into();
8290            self
8291        }
8292    }
8293
8294    #[doc(hidden)]
8295    impl gax::options::internal::RequestBuilder for ListOperations {
8296        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8297            &mut self.0.options
8298        }
8299    }
8300
8301    /// The request builder for [HubService::get_operation][crate::client::HubService::get_operation] calls.
8302    ///
8303    /// # Example
8304    /// ```
8305    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::GetOperation;
8306    /// # async fn sample() -> gax::Result<()> {
8307    ///
8308    /// let builder = prepare_request_builder();
8309    /// let response = builder.send().await?;
8310    /// # Ok(()) }
8311    ///
8312    /// fn prepare_request_builder() -> GetOperation {
8313    ///   # panic!();
8314    ///   // ... details omitted ...
8315    /// }
8316    /// ```
8317    #[derive(Clone, Debug)]
8318    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
8319
8320    impl GetOperation {
8321        pub(crate) fn new(
8322            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8323        ) -> Self {
8324            Self(RequestBuilder::new(stub))
8325        }
8326
8327        /// Sets the full request, replacing any prior values.
8328        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
8329            mut self,
8330            v: V,
8331        ) -> Self {
8332            self.0.request = v.into();
8333            self
8334        }
8335
8336        /// Sets all the options, replacing any prior values.
8337        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8338            self.0.options = v.into();
8339            self
8340        }
8341
8342        /// Sends the request.
8343        pub async fn send(self) -> Result<longrunning::model::Operation> {
8344            (*self.0.stub)
8345                .get_operation(self.0.request, self.0.options)
8346                .await
8347                .map(gax::response::Response::into_body)
8348        }
8349
8350        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
8351        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8352            self.0.request.name = v.into();
8353            self
8354        }
8355    }
8356
8357    #[doc(hidden)]
8358    impl gax::options::internal::RequestBuilder for GetOperation {
8359        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8360            &mut self.0.options
8361        }
8362    }
8363
8364    /// The request builder for [HubService::delete_operation][crate::client::HubService::delete_operation] calls.
8365    ///
8366    /// # Example
8367    /// ```
8368    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::DeleteOperation;
8369    /// # async fn sample() -> gax::Result<()> {
8370    ///
8371    /// let builder = prepare_request_builder();
8372    /// let response = builder.send().await?;
8373    /// # Ok(()) }
8374    ///
8375    /// fn prepare_request_builder() -> DeleteOperation {
8376    ///   # panic!();
8377    ///   // ... details omitted ...
8378    /// }
8379    /// ```
8380    #[derive(Clone, Debug)]
8381    pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
8382
8383    impl DeleteOperation {
8384        pub(crate) fn new(
8385            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8386        ) -> Self {
8387            Self(RequestBuilder::new(stub))
8388        }
8389
8390        /// Sets the full request, replacing any prior values.
8391        pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
8392            mut self,
8393            v: V,
8394        ) -> Self {
8395            self.0.request = v.into();
8396            self
8397        }
8398
8399        /// Sets all the options, replacing any prior values.
8400        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8401            self.0.options = v.into();
8402            self
8403        }
8404
8405        /// Sends the request.
8406        pub async fn send(self) -> Result<()> {
8407            (*self.0.stub)
8408                .delete_operation(self.0.request, self.0.options)
8409                .await
8410                .map(gax::response::Response::into_body)
8411        }
8412
8413        /// Sets the value of [name][longrunning::model::DeleteOperationRequest::name].
8414        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8415            self.0.request.name = v.into();
8416            self
8417        }
8418    }
8419
8420    #[doc(hidden)]
8421    impl gax::options::internal::RequestBuilder for DeleteOperation {
8422        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8423            &mut self.0.options
8424        }
8425    }
8426
8427    /// The request builder for [HubService::cancel_operation][crate::client::HubService::cancel_operation] calls.
8428    ///
8429    /// # Example
8430    /// ```
8431    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::CancelOperation;
8432    /// # async fn sample() -> gax::Result<()> {
8433    ///
8434    /// let builder = prepare_request_builder();
8435    /// let response = builder.send().await?;
8436    /// # Ok(()) }
8437    ///
8438    /// fn prepare_request_builder() -> CancelOperation {
8439    ///   # panic!();
8440    ///   // ... details omitted ...
8441    /// }
8442    /// ```
8443    #[derive(Clone, Debug)]
8444    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
8445
8446    impl CancelOperation {
8447        pub(crate) fn new(
8448            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8449        ) -> Self {
8450            Self(RequestBuilder::new(stub))
8451        }
8452
8453        /// Sets the full request, replacing any prior values.
8454        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
8455            mut self,
8456            v: V,
8457        ) -> Self {
8458            self.0.request = v.into();
8459            self
8460        }
8461
8462        /// Sets all the options, replacing any prior values.
8463        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8464            self.0.options = v.into();
8465            self
8466        }
8467
8468        /// Sends the request.
8469        pub async fn send(self) -> Result<()> {
8470            (*self.0.stub)
8471                .cancel_operation(self.0.request, self.0.options)
8472                .await
8473                .map(gax::response::Response::into_body)
8474        }
8475
8476        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
8477        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8478            self.0.request.name = v.into();
8479            self
8480        }
8481    }
8482
8483    #[doc(hidden)]
8484    impl gax::options::internal::RequestBuilder for CancelOperation {
8485        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8486            &mut self.0.options
8487        }
8488    }
8489}
8490
8491pub mod internal_range_service {
8492    use crate::Result;
8493
8494    /// A builder for [InternalRangeService][crate::client::InternalRangeService].
8495    ///
8496    /// ```
8497    /// # async fn sample() -> gax::client_builder::Result<()> {
8498    /// # use google_cloud_networkconnectivity_v1::*;
8499    /// # use builder::internal_range_service::ClientBuilder;
8500    /// # use client::InternalRangeService;
8501    /// let builder : ClientBuilder = InternalRangeService::builder();
8502    /// let client = builder
8503    ///     .with_endpoint("https://networkconnectivity.googleapis.com")
8504    ///     .build().await?;
8505    /// # Ok(()) }
8506    /// ```
8507    pub type ClientBuilder =
8508        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
8509
8510    pub(crate) mod client {
8511        use super::super::super::client::InternalRangeService;
8512        pub struct Factory;
8513        impl gax::client_builder::internal::ClientFactory for Factory {
8514            type Client = InternalRangeService;
8515            type Credentials = gaxi::options::Credentials;
8516            async fn build(
8517                self,
8518                config: gaxi::options::ClientConfig,
8519            ) -> gax::client_builder::Result<Self::Client> {
8520                Self::Client::new(config).await
8521            }
8522        }
8523    }
8524
8525    /// Common implementation for [crate::client::InternalRangeService] request builders.
8526    #[derive(Clone, Debug)]
8527    pub(crate) struct RequestBuilder<R: std::default::Default> {
8528        stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
8529        request: R,
8530        options: gax::options::RequestOptions,
8531    }
8532
8533    impl<R> RequestBuilder<R>
8534    where
8535        R: std::default::Default,
8536    {
8537        pub(crate) fn new(
8538            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
8539        ) -> Self {
8540            Self {
8541                stub,
8542                request: R::default(),
8543                options: gax::options::RequestOptions::default(),
8544            }
8545        }
8546    }
8547
8548    /// The request builder for [InternalRangeService::list_internal_ranges][crate::client::InternalRangeService::list_internal_ranges] calls.
8549    ///
8550    /// # Example
8551    /// ```
8552    /// # use google_cloud_networkconnectivity_v1::builder::internal_range_service::ListInternalRanges;
8553    /// # async fn sample() -> gax::Result<()> {
8554    /// use gax::paginator::ItemPaginator;
8555    ///
8556    /// let builder = prepare_request_builder();
8557    /// let mut items = builder.by_item();
8558    /// while let Some(result) = items.next().await {
8559    ///   let item = result?;
8560    /// }
8561    /// # Ok(()) }
8562    ///
8563    /// fn prepare_request_builder() -> ListInternalRanges {
8564    ///   # panic!();
8565    ///   // ... details omitted ...
8566    /// }
8567    /// ```
8568    #[derive(Clone, Debug)]
8569    pub struct ListInternalRanges(RequestBuilder<crate::model::ListInternalRangesRequest>);
8570
8571    impl ListInternalRanges {
8572        pub(crate) fn new(
8573            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
8574        ) -> Self {
8575            Self(RequestBuilder::new(stub))
8576        }
8577
8578        /// Sets the full request, replacing any prior values.
8579        pub fn with_request<V: Into<crate::model::ListInternalRangesRequest>>(
8580            mut self,
8581            v: V,
8582        ) -> Self {
8583            self.0.request = v.into();
8584            self
8585        }
8586
8587        /// Sets all the options, replacing any prior values.
8588        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8589            self.0.options = v.into();
8590            self
8591        }
8592
8593        /// Sends the request.
8594        pub async fn send(self) -> Result<crate::model::ListInternalRangesResponse> {
8595            (*self.0.stub)
8596                .list_internal_ranges(self.0.request, self.0.options)
8597                .await
8598                .map(gax::response::Response::into_body)
8599        }
8600
8601        /// Streams each page in the collection.
8602        pub fn by_page(
8603            self,
8604        ) -> impl gax::paginator::Paginator<crate::model::ListInternalRangesResponse, gax::error::Error>
8605        {
8606            use std::clone::Clone;
8607            let token = self.0.request.page_token.clone();
8608            let execute = move |token: String| {
8609                let mut builder = self.clone();
8610                builder.0.request = builder.0.request.set_page_token(token);
8611                builder.send()
8612            };
8613            gax::paginator::internal::new_paginator(token, execute)
8614        }
8615
8616        /// Streams each item in the collection.
8617        pub fn by_item(
8618            self,
8619        ) -> impl gax::paginator::ItemPaginator<
8620            crate::model::ListInternalRangesResponse,
8621            gax::error::Error,
8622        > {
8623            use gax::paginator::Paginator;
8624            self.by_page().items()
8625        }
8626
8627        /// Sets the value of [parent][crate::model::ListInternalRangesRequest::parent].
8628        ///
8629        /// This is a **required** field for requests.
8630        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
8631            self.0.request.parent = v.into();
8632            self
8633        }
8634
8635        /// Sets the value of [page_size][crate::model::ListInternalRangesRequest::page_size].
8636        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8637            self.0.request.page_size = v.into();
8638            self
8639        }
8640
8641        /// Sets the value of [page_token][crate::model::ListInternalRangesRequest::page_token].
8642        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8643            self.0.request.page_token = v.into();
8644            self
8645        }
8646
8647        /// Sets the value of [filter][crate::model::ListInternalRangesRequest::filter].
8648        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8649            self.0.request.filter = v.into();
8650            self
8651        }
8652
8653        /// Sets the value of [order_by][crate::model::ListInternalRangesRequest::order_by].
8654        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
8655            self.0.request.order_by = v.into();
8656            self
8657        }
8658    }
8659
8660    #[doc(hidden)]
8661    impl gax::options::internal::RequestBuilder for ListInternalRanges {
8662        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8663            &mut self.0.options
8664        }
8665    }
8666
8667    /// The request builder for [InternalRangeService::get_internal_range][crate::client::InternalRangeService::get_internal_range] calls.
8668    ///
8669    /// # Example
8670    /// ```
8671    /// # use google_cloud_networkconnectivity_v1::builder::internal_range_service::GetInternalRange;
8672    /// # async fn sample() -> gax::Result<()> {
8673    ///
8674    /// let builder = prepare_request_builder();
8675    /// let response = builder.send().await?;
8676    /// # Ok(()) }
8677    ///
8678    /// fn prepare_request_builder() -> GetInternalRange {
8679    ///   # panic!();
8680    ///   // ... details omitted ...
8681    /// }
8682    /// ```
8683    #[derive(Clone, Debug)]
8684    pub struct GetInternalRange(RequestBuilder<crate::model::GetInternalRangeRequest>);
8685
8686    impl GetInternalRange {
8687        pub(crate) fn new(
8688            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
8689        ) -> Self {
8690            Self(RequestBuilder::new(stub))
8691        }
8692
8693        /// Sets the full request, replacing any prior values.
8694        pub fn with_request<V: Into<crate::model::GetInternalRangeRequest>>(
8695            mut self,
8696            v: V,
8697        ) -> Self {
8698            self.0.request = v.into();
8699            self
8700        }
8701
8702        /// Sets all the options, replacing any prior values.
8703        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8704            self.0.options = v.into();
8705            self
8706        }
8707
8708        /// Sends the request.
8709        pub async fn send(self) -> Result<crate::model::InternalRange> {
8710            (*self.0.stub)
8711                .get_internal_range(self.0.request, self.0.options)
8712                .await
8713                .map(gax::response::Response::into_body)
8714        }
8715
8716        /// Sets the value of [name][crate::model::GetInternalRangeRequest::name].
8717        ///
8718        /// This is a **required** field for requests.
8719        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8720            self.0.request.name = v.into();
8721            self
8722        }
8723    }
8724
8725    #[doc(hidden)]
8726    impl gax::options::internal::RequestBuilder for GetInternalRange {
8727        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8728            &mut self.0.options
8729        }
8730    }
8731
8732    /// The request builder for [InternalRangeService::create_internal_range][crate::client::InternalRangeService::create_internal_range] calls.
8733    ///
8734    /// # Example
8735    /// ```
8736    /// # use google_cloud_networkconnectivity_v1::builder::internal_range_service::CreateInternalRange;
8737    /// # async fn sample() -> gax::Result<()> {
8738    /// use lro::Poller;
8739    ///
8740    /// let builder = prepare_request_builder();
8741    /// let response = builder.poller().until_done().await?;
8742    /// # Ok(()) }
8743    ///
8744    /// fn prepare_request_builder() -> CreateInternalRange {
8745    ///   # panic!();
8746    ///   // ... details omitted ...
8747    /// }
8748    /// ```
8749    #[derive(Clone, Debug)]
8750    pub struct CreateInternalRange(RequestBuilder<crate::model::CreateInternalRangeRequest>);
8751
8752    impl CreateInternalRange {
8753        pub(crate) fn new(
8754            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
8755        ) -> Self {
8756            Self(RequestBuilder::new(stub))
8757        }
8758
8759        /// Sets the full request, replacing any prior values.
8760        pub fn with_request<V: Into<crate::model::CreateInternalRangeRequest>>(
8761            mut self,
8762            v: V,
8763        ) -> Self {
8764            self.0.request = v.into();
8765            self
8766        }
8767
8768        /// Sets all the options, replacing any prior values.
8769        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8770            self.0.options = v.into();
8771            self
8772        }
8773
8774        /// Sends the request.
8775        ///
8776        /// # Long running operations
8777        ///
8778        /// This starts, but does not poll, a longrunning operation. More information
8779        /// on [create_internal_range][crate::client::InternalRangeService::create_internal_range].
8780        pub async fn send(self) -> Result<longrunning::model::Operation> {
8781            (*self.0.stub)
8782                .create_internal_range(self.0.request, self.0.options)
8783                .await
8784                .map(gax::response::Response::into_body)
8785        }
8786
8787        /// Creates a [Poller][lro::Poller] to work with `create_internal_range`.
8788        pub fn poller(
8789            self,
8790        ) -> impl lro::Poller<crate::model::InternalRange, crate::model::OperationMetadata>
8791        {
8792            type Operation = lro::internal::Operation<
8793                crate::model::InternalRange,
8794                crate::model::OperationMetadata,
8795            >;
8796            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8797            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8798
8799            let stub = self.0.stub.clone();
8800            let mut options = self.0.options.clone();
8801            options.set_retry_policy(gax::retry_policy::NeverRetry);
8802            let query = move |name| {
8803                let stub = stub.clone();
8804                let options = options.clone();
8805                async {
8806                    let op = GetOperation::new(stub)
8807                        .set_name(name)
8808                        .with_options(options)
8809                        .send()
8810                        .await?;
8811                    Ok(Operation::new(op))
8812                }
8813            };
8814
8815            let start = move || async {
8816                let op = self.send().await?;
8817                Ok(Operation::new(op))
8818            };
8819
8820            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
8821        }
8822
8823        /// Sets the value of [parent][crate::model::CreateInternalRangeRequest::parent].
8824        ///
8825        /// This is a **required** field for requests.
8826        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
8827            self.0.request.parent = v.into();
8828            self
8829        }
8830
8831        /// Sets the value of [internal_range_id][crate::model::CreateInternalRangeRequest::internal_range_id].
8832        pub fn set_internal_range_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
8833            self.0.request.internal_range_id = v.into();
8834            self
8835        }
8836
8837        /// Sets the value of [internal_range][crate::model::CreateInternalRangeRequest::internal_range].
8838        ///
8839        /// This is a **required** field for requests.
8840        pub fn set_internal_range<T>(mut self, v: T) -> Self
8841        where
8842            T: std::convert::Into<crate::model::InternalRange>,
8843        {
8844            self.0.request.internal_range = std::option::Option::Some(v.into());
8845            self
8846        }
8847
8848        /// Sets or clears the value of [internal_range][crate::model::CreateInternalRangeRequest::internal_range].
8849        ///
8850        /// This is a **required** field for requests.
8851        pub fn set_or_clear_internal_range<T>(mut self, v: std::option::Option<T>) -> Self
8852        where
8853            T: std::convert::Into<crate::model::InternalRange>,
8854        {
8855            self.0.request.internal_range = v.map(|x| x.into());
8856            self
8857        }
8858
8859        /// Sets the value of [request_id][crate::model::CreateInternalRangeRequest::request_id].
8860        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
8861            self.0.request.request_id = v.into();
8862            self
8863        }
8864    }
8865
8866    #[doc(hidden)]
8867    impl gax::options::internal::RequestBuilder for CreateInternalRange {
8868        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8869            &mut self.0.options
8870        }
8871    }
8872
8873    /// The request builder for [InternalRangeService::update_internal_range][crate::client::InternalRangeService::update_internal_range] calls.
8874    ///
8875    /// # Example
8876    /// ```
8877    /// # use google_cloud_networkconnectivity_v1::builder::internal_range_service::UpdateInternalRange;
8878    /// # async fn sample() -> gax::Result<()> {
8879    /// use lro::Poller;
8880    ///
8881    /// let builder = prepare_request_builder();
8882    /// let response = builder.poller().until_done().await?;
8883    /// # Ok(()) }
8884    ///
8885    /// fn prepare_request_builder() -> UpdateInternalRange {
8886    ///   # panic!();
8887    ///   // ... details omitted ...
8888    /// }
8889    /// ```
8890    #[derive(Clone, Debug)]
8891    pub struct UpdateInternalRange(RequestBuilder<crate::model::UpdateInternalRangeRequest>);
8892
8893    impl UpdateInternalRange {
8894        pub(crate) fn new(
8895            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
8896        ) -> Self {
8897            Self(RequestBuilder::new(stub))
8898        }
8899
8900        /// Sets the full request, replacing any prior values.
8901        pub fn with_request<V: Into<crate::model::UpdateInternalRangeRequest>>(
8902            mut self,
8903            v: V,
8904        ) -> Self {
8905            self.0.request = v.into();
8906            self
8907        }
8908
8909        /// Sets all the options, replacing any prior values.
8910        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8911            self.0.options = v.into();
8912            self
8913        }
8914
8915        /// Sends the request.
8916        ///
8917        /// # Long running operations
8918        ///
8919        /// This starts, but does not poll, a longrunning operation. More information
8920        /// on [update_internal_range][crate::client::InternalRangeService::update_internal_range].
8921        pub async fn send(self) -> Result<longrunning::model::Operation> {
8922            (*self.0.stub)
8923                .update_internal_range(self.0.request, self.0.options)
8924                .await
8925                .map(gax::response::Response::into_body)
8926        }
8927
8928        /// Creates a [Poller][lro::Poller] to work with `update_internal_range`.
8929        pub fn poller(
8930            self,
8931        ) -> impl lro::Poller<crate::model::InternalRange, crate::model::OperationMetadata>
8932        {
8933            type Operation = lro::internal::Operation<
8934                crate::model::InternalRange,
8935                crate::model::OperationMetadata,
8936            >;
8937            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8938            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8939
8940            let stub = self.0.stub.clone();
8941            let mut options = self.0.options.clone();
8942            options.set_retry_policy(gax::retry_policy::NeverRetry);
8943            let query = move |name| {
8944                let stub = stub.clone();
8945                let options = options.clone();
8946                async {
8947                    let op = GetOperation::new(stub)
8948                        .set_name(name)
8949                        .with_options(options)
8950                        .send()
8951                        .await?;
8952                    Ok(Operation::new(op))
8953                }
8954            };
8955
8956            let start = move || async {
8957                let op = self.send().await?;
8958                Ok(Operation::new(op))
8959            };
8960
8961            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
8962        }
8963
8964        /// Sets the value of [update_mask][crate::model::UpdateInternalRangeRequest::update_mask].
8965        pub fn set_update_mask<T>(mut self, v: T) -> Self
8966        where
8967            T: std::convert::Into<wkt::FieldMask>,
8968        {
8969            self.0.request.update_mask = std::option::Option::Some(v.into());
8970            self
8971        }
8972
8973        /// Sets or clears the value of [update_mask][crate::model::UpdateInternalRangeRequest::update_mask].
8974        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
8975        where
8976            T: std::convert::Into<wkt::FieldMask>,
8977        {
8978            self.0.request.update_mask = v.map(|x| x.into());
8979            self
8980        }
8981
8982        /// Sets the value of [internal_range][crate::model::UpdateInternalRangeRequest::internal_range].
8983        ///
8984        /// This is a **required** field for requests.
8985        pub fn set_internal_range<T>(mut self, v: T) -> Self
8986        where
8987            T: std::convert::Into<crate::model::InternalRange>,
8988        {
8989            self.0.request.internal_range = std::option::Option::Some(v.into());
8990            self
8991        }
8992
8993        /// Sets or clears the value of [internal_range][crate::model::UpdateInternalRangeRequest::internal_range].
8994        ///
8995        /// This is a **required** field for requests.
8996        pub fn set_or_clear_internal_range<T>(mut self, v: std::option::Option<T>) -> Self
8997        where
8998            T: std::convert::Into<crate::model::InternalRange>,
8999        {
9000            self.0.request.internal_range = v.map(|x| x.into());
9001            self
9002        }
9003
9004        /// Sets the value of [request_id][crate::model::UpdateInternalRangeRequest::request_id].
9005        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9006            self.0.request.request_id = v.into();
9007            self
9008        }
9009    }
9010
9011    #[doc(hidden)]
9012    impl gax::options::internal::RequestBuilder for UpdateInternalRange {
9013        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9014            &mut self.0.options
9015        }
9016    }
9017
9018    /// The request builder for [InternalRangeService::delete_internal_range][crate::client::InternalRangeService::delete_internal_range] calls.
9019    ///
9020    /// # Example
9021    /// ```
9022    /// # use google_cloud_networkconnectivity_v1::builder::internal_range_service::DeleteInternalRange;
9023    /// # async fn sample() -> gax::Result<()> {
9024    /// use lro::Poller;
9025    ///
9026    /// let builder = prepare_request_builder();
9027    /// let response = builder.poller().until_done().await?;
9028    /// # Ok(()) }
9029    ///
9030    /// fn prepare_request_builder() -> DeleteInternalRange {
9031    ///   # panic!();
9032    ///   // ... details omitted ...
9033    /// }
9034    /// ```
9035    #[derive(Clone, Debug)]
9036    pub struct DeleteInternalRange(RequestBuilder<crate::model::DeleteInternalRangeRequest>);
9037
9038    impl DeleteInternalRange {
9039        pub(crate) fn new(
9040            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9041        ) -> Self {
9042            Self(RequestBuilder::new(stub))
9043        }
9044
9045        /// Sets the full request, replacing any prior values.
9046        pub fn with_request<V: Into<crate::model::DeleteInternalRangeRequest>>(
9047            mut self,
9048            v: V,
9049        ) -> Self {
9050            self.0.request = v.into();
9051            self
9052        }
9053
9054        /// Sets all the options, replacing any prior values.
9055        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9056            self.0.options = v.into();
9057            self
9058        }
9059
9060        /// Sends the request.
9061        ///
9062        /// # Long running operations
9063        ///
9064        /// This starts, but does not poll, a longrunning operation. More information
9065        /// on [delete_internal_range][crate::client::InternalRangeService::delete_internal_range].
9066        pub async fn send(self) -> Result<longrunning::model::Operation> {
9067            (*self.0.stub)
9068                .delete_internal_range(self.0.request, self.0.options)
9069                .await
9070                .map(gax::response::Response::into_body)
9071        }
9072
9073        /// Creates a [Poller][lro::Poller] to work with `delete_internal_range`.
9074        pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
9075            type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
9076            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9077            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9078
9079            let stub = self.0.stub.clone();
9080            let mut options = self.0.options.clone();
9081            options.set_retry_policy(gax::retry_policy::NeverRetry);
9082            let query = move |name| {
9083                let stub = stub.clone();
9084                let options = options.clone();
9085                async {
9086                    let op = GetOperation::new(stub)
9087                        .set_name(name)
9088                        .with_options(options)
9089                        .send()
9090                        .await?;
9091                    Ok(Operation::new(op))
9092                }
9093            };
9094
9095            let start = move || async {
9096                let op = self.send().await?;
9097                Ok(Operation::new(op))
9098            };
9099
9100            lro::internal::new_unit_response_poller(
9101                polling_error_policy,
9102                polling_backoff_policy,
9103                start,
9104                query,
9105            )
9106        }
9107
9108        /// Sets the value of [name][crate::model::DeleteInternalRangeRequest::name].
9109        ///
9110        /// This is a **required** field for requests.
9111        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9112            self.0.request.name = v.into();
9113            self
9114        }
9115
9116        /// Sets the value of [request_id][crate::model::DeleteInternalRangeRequest::request_id].
9117        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9118            self.0.request.request_id = v.into();
9119            self
9120        }
9121    }
9122
9123    #[doc(hidden)]
9124    impl gax::options::internal::RequestBuilder for DeleteInternalRange {
9125        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9126            &mut self.0.options
9127        }
9128    }
9129
9130    /// The request builder for [InternalRangeService::list_locations][crate::client::InternalRangeService::list_locations] calls.
9131    ///
9132    /// # Example
9133    /// ```
9134    /// # use google_cloud_networkconnectivity_v1::builder::internal_range_service::ListLocations;
9135    /// # async fn sample() -> gax::Result<()> {
9136    /// use gax::paginator::ItemPaginator;
9137    ///
9138    /// let builder = prepare_request_builder();
9139    /// let mut items = builder.by_item();
9140    /// while let Some(result) = items.next().await {
9141    ///   let item = result?;
9142    /// }
9143    /// # Ok(()) }
9144    ///
9145    /// fn prepare_request_builder() -> ListLocations {
9146    ///   # panic!();
9147    ///   // ... details omitted ...
9148    /// }
9149    /// ```
9150    #[derive(Clone, Debug)]
9151    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
9152
9153    impl ListLocations {
9154        pub(crate) fn new(
9155            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9156        ) -> Self {
9157            Self(RequestBuilder::new(stub))
9158        }
9159
9160        /// Sets the full request, replacing any prior values.
9161        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
9162            mut self,
9163            v: V,
9164        ) -> Self {
9165            self.0.request = v.into();
9166            self
9167        }
9168
9169        /// Sets all the options, replacing any prior values.
9170        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9171            self.0.options = v.into();
9172            self
9173        }
9174
9175        /// Sends the request.
9176        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
9177            (*self.0.stub)
9178                .list_locations(self.0.request, self.0.options)
9179                .await
9180                .map(gax::response::Response::into_body)
9181        }
9182
9183        /// Streams each page in the collection.
9184        pub fn by_page(
9185            self,
9186        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
9187        {
9188            use std::clone::Clone;
9189            let token = self.0.request.page_token.clone();
9190            let execute = move |token: String| {
9191                let mut builder = self.clone();
9192                builder.0.request = builder.0.request.set_page_token(token);
9193                builder.send()
9194            };
9195            gax::paginator::internal::new_paginator(token, execute)
9196        }
9197
9198        /// Streams each item in the collection.
9199        pub fn by_item(
9200            self,
9201        ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
9202        {
9203            use gax::paginator::Paginator;
9204            self.by_page().items()
9205        }
9206
9207        /// Sets the value of [name][location::model::ListLocationsRequest::name].
9208        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9209            self.0.request.name = v.into();
9210            self
9211        }
9212
9213        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
9214        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
9215            self.0.request.filter = v.into();
9216            self
9217        }
9218
9219        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
9220        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
9221            self.0.request.page_size = v.into();
9222            self
9223        }
9224
9225        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
9226        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
9227            self.0.request.page_token = v.into();
9228            self
9229        }
9230    }
9231
9232    #[doc(hidden)]
9233    impl gax::options::internal::RequestBuilder for ListLocations {
9234        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9235            &mut self.0.options
9236        }
9237    }
9238
9239    /// The request builder for [InternalRangeService::get_location][crate::client::InternalRangeService::get_location] calls.
9240    ///
9241    /// # Example
9242    /// ```
9243    /// # use google_cloud_networkconnectivity_v1::builder::internal_range_service::GetLocation;
9244    /// # async fn sample() -> gax::Result<()> {
9245    ///
9246    /// let builder = prepare_request_builder();
9247    /// let response = builder.send().await?;
9248    /// # Ok(()) }
9249    ///
9250    /// fn prepare_request_builder() -> GetLocation {
9251    ///   # panic!();
9252    ///   // ... details omitted ...
9253    /// }
9254    /// ```
9255    #[derive(Clone, Debug)]
9256    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
9257
9258    impl GetLocation {
9259        pub(crate) fn new(
9260            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9261        ) -> Self {
9262            Self(RequestBuilder::new(stub))
9263        }
9264
9265        /// Sets the full request, replacing any prior values.
9266        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
9267            self.0.request = v.into();
9268            self
9269        }
9270
9271        /// Sets all the options, replacing any prior values.
9272        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9273            self.0.options = v.into();
9274            self
9275        }
9276
9277        /// Sends the request.
9278        pub async fn send(self) -> Result<location::model::Location> {
9279            (*self.0.stub)
9280                .get_location(self.0.request, self.0.options)
9281                .await
9282                .map(gax::response::Response::into_body)
9283        }
9284
9285        /// Sets the value of [name][location::model::GetLocationRequest::name].
9286        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9287            self.0.request.name = v.into();
9288            self
9289        }
9290    }
9291
9292    #[doc(hidden)]
9293    impl gax::options::internal::RequestBuilder for GetLocation {
9294        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9295            &mut self.0.options
9296        }
9297    }
9298
9299    /// The request builder for [InternalRangeService::set_iam_policy][crate::client::InternalRangeService::set_iam_policy] calls.
9300    ///
9301    /// # Example
9302    /// ```
9303    /// # use google_cloud_networkconnectivity_v1::builder::internal_range_service::SetIamPolicy;
9304    /// # async fn sample() -> gax::Result<()> {
9305    ///
9306    /// let builder = prepare_request_builder();
9307    /// let response = builder.send().await?;
9308    /// # Ok(()) }
9309    ///
9310    /// fn prepare_request_builder() -> SetIamPolicy {
9311    ///   # panic!();
9312    ///   // ... details omitted ...
9313    /// }
9314    /// ```
9315    #[derive(Clone, Debug)]
9316    pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
9317
9318    impl SetIamPolicy {
9319        pub(crate) fn new(
9320            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9321        ) -> Self {
9322            Self(RequestBuilder::new(stub))
9323        }
9324
9325        /// Sets the full request, replacing any prior values.
9326        pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
9327            self.0.request = v.into();
9328            self
9329        }
9330
9331        /// Sets all the options, replacing any prior values.
9332        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9333            self.0.options = v.into();
9334            self
9335        }
9336
9337        /// Sends the request.
9338        pub async fn send(self) -> Result<iam_v1::model::Policy> {
9339            (*self.0.stub)
9340                .set_iam_policy(self.0.request, self.0.options)
9341                .await
9342                .map(gax::response::Response::into_body)
9343        }
9344
9345        /// Sets the value of [resource][iam_v1::model::SetIamPolicyRequest::resource].
9346        ///
9347        /// This is a **required** field for requests.
9348        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
9349            self.0.request.resource = v.into();
9350            self
9351        }
9352
9353        /// Sets the value of [policy][iam_v1::model::SetIamPolicyRequest::policy].
9354        ///
9355        /// This is a **required** field for requests.
9356        pub fn set_policy<T>(mut self, v: T) -> Self
9357        where
9358            T: std::convert::Into<iam_v1::model::Policy>,
9359        {
9360            self.0.request.policy = std::option::Option::Some(v.into());
9361            self
9362        }
9363
9364        /// Sets or clears the value of [policy][iam_v1::model::SetIamPolicyRequest::policy].
9365        ///
9366        /// This is a **required** field for requests.
9367        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
9368        where
9369            T: std::convert::Into<iam_v1::model::Policy>,
9370        {
9371            self.0.request.policy = v.map(|x| x.into());
9372            self
9373        }
9374
9375        /// Sets the value of [update_mask][iam_v1::model::SetIamPolicyRequest::update_mask].
9376        pub fn set_update_mask<T>(mut self, v: T) -> Self
9377        where
9378            T: std::convert::Into<wkt::FieldMask>,
9379        {
9380            self.0.request.update_mask = std::option::Option::Some(v.into());
9381            self
9382        }
9383
9384        /// Sets or clears the value of [update_mask][iam_v1::model::SetIamPolicyRequest::update_mask].
9385        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
9386        where
9387            T: std::convert::Into<wkt::FieldMask>,
9388        {
9389            self.0.request.update_mask = v.map(|x| x.into());
9390            self
9391        }
9392    }
9393
9394    #[doc(hidden)]
9395    impl gax::options::internal::RequestBuilder for SetIamPolicy {
9396        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9397            &mut self.0.options
9398        }
9399    }
9400
9401    /// The request builder for [InternalRangeService::get_iam_policy][crate::client::InternalRangeService::get_iam_policy] calls.
9402    ///
9403    /// # Example
9404    /// ```
9405    /// # use google_cloud_networkconnectivity_v1::builder::internal_range_service::GetIamPolicy;
9406    /// # async fn sample() -> gax::Result<()> {
9407    ///
9408    /// let builder = prepare_request_builder();
9409    /// let response = builder.send().await?;
9410    /// # Ok(()) }
9411    ///
9412    /// fn prepare_request_builder() -> GetIamPolicy {
9413    ///   # panic!();
9414    ///   // ... details omitted ...
9415    /// }
9416    /// ```
9417    #[derive(Clone, Debug)]
9418    pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
9419
9420    impl GetIamPolicy {
9421        pub(crate) fn new(
9422            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9423        ) -> Self {
9424            Self(RequestBuilder::new(stub))
9425        }
9426
9427        /// Sets the full request, replacing any prior values.
9428        pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
9429            self.0.request = v.into();
9430            self
9431        }
9432
9433        /// Sets all the options, replacing any prior values.
9434        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9435            self.0.options = v.into();
9436            self
9437        }
9438
9439        /// Sends the request.
9440        pub async fn send(self) -> Result<iam_v1::model::Policy> {
9441            (*self.0.stub)
9442                .get_iam_policy(self.0.request, self.0.options)
9443                .await
9444                .map(gax::response::Response::into_body)
9445        }
9446
9447        /// Sets the value of [resource][iam_v1::model::GetIamPolicyRequest::resource].
9448        ///
9449        /// This is a **required** field for requests.
9450        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
9451            self.0.request.resource = v.into();
9452            self
9453        }
9454
9455        /// Sets the value of [options][iam_v1::model::GetIamPolicyRequest::options].
9456        pub fn set_options<T>(mut self, v: T) -> Self
9457        where
9458            T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
9459        {
9460            self.0.request.options = std::option::Option::Some(v.into());
9461            self
9462        }
9463
9464        /// Sets or clears the value of [options][iam_v1::model::GetIamPolicyRequest::options].
9465        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
9466        where
9467            T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
9468        {
9469            self.0.request.options = v.map(|x| x.into());
9470            self
9471        }
9472    }
9473
9474    #[doc(hidden)]
9475    impl gax::options::internal::RequestBuilder for GetIamPolicy {
9476        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9477            &mut self.0.options
9478        }
9479    }
9480
9481    /// The request builder for [InternalRangeService::test_iam_permissions][crate::client::InternalRangeService::test_iam_permissions] calls.
9482    ///
9483    /// # Example
9484    /// ```
9485    /// # use google_cloud_networkconnectivity_v1::builder::internal_range_service::TestIamPermissions;
9486    /// # async fn sample() -> gax::Result<()> {
9487    ///
9488    /// let builder = prepare_request_builder();
9489    /// let response = builder.send().await?;
9490    /// # Ok(()) }
9491    ///
9492    /// fn prepare_request_builder() -> TestIamPermissions {
9493    ///   # panic!();
9494    ///   // ... details omitted ...
9495    /// }
9496    /// ```
9497    #[derive(Clone, Debug)]
9498    pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
9499
9500    impl TestIamPermissions {
9501        pub(crate) fn new(
9502            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9503        ) -> Self {
9504            Self(RequestBuilder::new(stub))
9505        }
9506
9507        /// Sets the full request, replacing any prior values.
9508        pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
9509            mut self,
9510            v: V,
9511        ) -> Self {
9512            self.0.request = v.into();
9513            self
9514        }
9515
9516        /// Sets all the options, replacing any prior values.
9517        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9518            self.0.options = v.into();
9519            self
9520        }
9521
9522        /// Sends the request.
9523        pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
9524            (*self.0.stub)
9525                .test_iam_permissions(self.0.request, self.0.options)
9526                .await
9527                .map(gax::response::Response::into_body)
9528        }
9529
9530        /// Sets the value of [resource][iam_v1::model::TestIamPermissionsRequest::resource].
9531        ///
9532        /// This is a **required** field for requests.
9533        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
9534            self.0.request.resource = v.into();
9535            self
9536        }
9537
9538        /// Sets the value of [permissions][iam_v1::model::TestIamPermissionsRequest::permissions].
9539        ///
9540        /// This is a **required** field for requests.
9541        pub fn set_permissions<T, V>(mut self, v: T) -> Self
9542        where
9543            T: std::iter::IntoIterator<Item = V>,
9544            V: std::convert::Into<std::string::String>,
9545        {
9546            use std::iter::Iterator;
9547            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
9548            self
9549        }
9550    }
9551
9552    #[doc(hidden)]
9553    impl gax::options::internal::RequestBuilder for TestIamPermissions {
9554        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9555            &mut self.0.options
9556        }
9557    }
9558
9559    /// The request builder for [InternalRangeService::list_operations][crate::client::InternalRangeService::list_operations] calls.
9560    ///
9561    /// # Example
9562    /// ```
9563    /// # use google_cloud_networkconnectivity_v1::builder::internal_range_service::ListOperations;
9564    /// # async fn sample() -> gax::Result<()> {
9565    /// use gax::paginator::ItemPaginator;
9566    ///
9567    /// let builder = prepare_request_builder();
9568    /// let mut items = builder.by_item();
9569    /// while let Some(result) = items.next().await {
9570    ///   let item = result?;
9571    /// }
9572    /// # Ok(()) }
9573    ///
9574    /// fn prepare_request_builder() -> ListOperations {
9575    ///   # panic!();
9576    ///   // ... details omitted ...
9577    /// }
9578    /// ```
9579    #[derive(Clone, Debug)]
9580    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
9581
9582    impl ListOperations {
9583        pub(crate) fn new(
9584            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9585        ) -> Self {
9586            Self(RequestBuilder::new(stub))
9587        }
9588
9589        /// Sets the full request, replacing any prior values.
9590        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
9591            mut self,
9592            v: V,
9593        ) -> Self {
9594            self.0.request = v.into();
9595            self
9596        }
9597
9598        /// Sets all the options, replacing any prior values.
9599        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9600            self.0.options = v.into();
9601            self
9602        }
9603
9604        /// Sends the request.
9605        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
9606            (*self.0.stub)
9607                .list_operations(self.0.request, self.0.options)
9608                .await
9609                .map(gax::response::Response::into_body)
9610        }
9611
9612        /// Streams each page in the collection.
9613        pub fn by_page(
9614            self,
9615        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
9616        {
9617            use std::clone::Clone;
9618            let token = self.0.request.page_token.clone();
9619            let execute = move |token: String| {
9620                let mut builder = self.clone();
9621                builder.0.request = builder.0.request.set_page_token(token);
9622                builder.send()
9623            };
9624            gax::paginator::internal::new_paginator(token, execute)
9625        }
9626
9627        /// Streams each item in the collection.
9628        pub fn by_item(
9629            self,
9630        ) -> impl gax::paginator::ItemPaginator<
9631            longrunning::model::ListOperationsResponse,
9632            gax::error::Error,
9633        > {
9634            use gax::paginator::Paginator;
9635            self.by_page().items()
9636        }
9637
9638        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
9639        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9640            self.0.request.name = v.into();
9641            self
9642        }
9643
9644        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
9645        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
9646            self.0.request.filter = v.into();
9647            self
9648        }
9649
9650        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
9651        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
9652            self.0.request.page_size = v.into();
9653            self
9654        }
9655
9656        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
9657        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
9658            self.0.request.page_token = v.into();
9659            self
9660        }
9661
9662        /// Sets the value of [return_partial_success][longrunning::model::ListOperationsRequest::return_partial_success].
9663        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
9664            self.0.request.return_partial_success = v.into();
9665            self
9666        }
9667    }
9668
9669    #[doc(hidden)]
9670    impl gax::options::internal::RequestBuilder for ListOperations {
9671        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9672            &mut self.0.options
9673        }
9674    }
9675
9676    /// The request builder for [InternalRangeService::get_operation][crate::client::InternalRangeService::get_operation] calls.
9677    ///
9678    /// # Example
9679    /// ```
9680    /// # use google_cloud_networkconnectivity_v1::builder::internal_range_service::GetOperation;
9681    /// # async fn sample() -> gax::Result<()> {
9682    ///
9683    /// let builder = prepare_request_builder();
9684    /// let response = builder.send().await?;
9685    /// # Ok(()) }
9686    ///
9687    /// fn prepare_request_builder() -> GetOperation {
9688    ///   # panic!();
9689    ///   // ... details omitted ...
9690    /// }
9691    /// ```
9692    #[derive(Clone, Debug)]
9693    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
9694
9695    impl GetOperation {
9696        pub(crate) fn new(
9697            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9698        ) -> Self {
9699            Self(RequestBuilder::new(stub))
9700        }
9701
9702        /// Sets the full request, replacing any prior values.
9703        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
9704            mut self,
9705            v: V,
9706        ) -> Self {
9707            self.0.request = v.into();
9708            self
9709        }
9710
9711        /// Sets all the options, replacing any prior values.
9712        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9713            self.0.options = v.into();
9714            self
9715        }
9716
9717        /// Sends the request.
9718        pub async fn send(self) -> Result<longrunning::model::Operation> {
9719            (*self.0.stub)
9720                .get_operation(self.0.request, self.0.options)
9721                .await
9722                .map(gax::response::Response::into_body)
9723        }
9724
9725        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
9726        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9727            self.0.request.name = v.into();
9728            self
9729        }
9730    }
9731
9732    #[doc(hidden)]
9733    impl gax::options::internal::RequestBuilder for GetOperation {
9734        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9735            &mut self.0.options
9736        }
9737    }
9738
9739    /// The request builder for [InternalRangeService::delete_operation][crate::client::InternalRangeService::delete_operation] calls.
9740    ///
9741    /// # Example
9742    /// ```
9743    /// # use google_cloud_networkconnectivity_v1::builder::internal_range_service::DeleteOperation;
9744    /// # async fn sample() -> gax::Result<()> {
9745    ///
9746    /// let builder = prepare_request_builder();
9747    /// let response = builder.send().await?;
9748    /// # Ok(()) }
9749    ///
9750    /// fn prepare_request_builder() -> DeleteOperation {
9751    ///   # panic!();
9752    ///   // ... details omitted ...
9753    /// }
9754    /// ```
9755    #[derive(Clone, Debug)]
9756    pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
9757
9758    impl DeleteOperation {
9759        pub(crate) fn new(
9760            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9761        ) -> Self {
9762            Self(RequestBuilder::new(stub))
9763        }
9764
9765        /// Sets the full request, replacing any prior values.
9766        pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
9767            mut self,
9768            v: V,
9769        ) -> Self {
9770            self.0.request = v.into();
9771            self
9772        }
9773
9774        /// Sets all the options, replacing any prior values.
9775        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9776            self.0.options = v.into();
9777            self
9778        }
9779
9780        /// Sends the request.
9781        pub async fn send(self) -> Result<()> {
9782            (*self.0.stub)
9783                .delete_operation(self.0.request, self.0.options)
9784                .await
9785                .map(gax::response::Response::into_body)
9786        }
9787
9788        /// Sets the value of [name][longrunning::model::DeleteOperationRequest::name].
9789        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9790            self.0.request.name = v.into();
9791            self
9792        }
9793    }
9794
9795    #[doc(hidden)]
9796    impl gax::options::internal::RequestBuilder for DeleteOperation {
9797        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9798            &mut self.0.options
9799        }
9800    }
9801
9802    /// The request builder for [InternalRangeService::cancel_operation][crate::client::InternalRangeService::cancel_operation] calls.
9803    ///
9804    /// # Example
9805    /// ```
9806    /// # use google_cloud_networkconnectivity_v1::builder::internal_range_service::CancelOperation;
9807    /// # async fn sample() -> gax::Result<()> {
9808    ///
9809    /// let builder = prepare_request_builder();
9810    /// let response = builder.send().await?;
9811    /// # Ok(()) }
9812    ///
9813    /// fn prepare_request_builder() -> CancelOperation {
9814    ///   # panic!();
9815    ///   // ... details omitted ...
9816    /// }
9817    /// ```
9818    #[derive(Clone, Debug)]
9819    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
9820
9821    impl CancelOperation {
9822        pub(crate) fn new(
9823            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9824        ) -> Self {
9825            Self(RequestBuilder::new(stub))
9826        }
9827
9828        /// Sets the full request, replacing any prior values.
9829        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
9830            mut self,
9831            v: V,
9832        ) -> Self {
9833            self.0.request = v.into();
9834            self
9835        }
9836
9837        /// Sets all the options, replacing any prior values.
9838        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9839            self.0.options = v.into();
9840            self
9841        }
9842
9843        /// Sends the request.
9844        pub async fn send(self) -> Result<()> {
9845            (*self.0.stub)
9846                .cancel_operation(self.0.request, self.0.options)
9847                .await
9848                .map(gax::response::Response::into_body)
9849        }
9850
9851        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
9852        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9853            self.0.request.name = v.into();
9854            self
9855        }
9856    }
9857
9858    #[doc(hidden)]
9859    impl gax::options::internal::RequestBuilder for CancelOperation {
9860        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
9861            &mut self.0.options
9862        }
9863    }
9864}
9865
9866pub mod policy_based_routing_service {
9867    use crate::Result;
9868
9869    /// A builder for [PolicyBasedRoutingService][crate::client::PolicyBasedRoutingService].
9870    ///
9871    /// ```
9872    /// # async fn sample() -> gax::client_builder::Result<()> {
9873    /// # use google_cloud_networkconnectivity_v1::*;
9874    /// # use builder::policy_based_routing_service::ClientBuilder;
9875    /// # use client::PolicyBasedRoutingService;
9876    /// let builder : ClientBuilder = PolicyBasedRoutingService::builder();
9877    /// let client = builder
9878    ///     .with_endpoint("https://networkconnectivity.googleapis.com")
9879    ///     .build().await?;
9880    /// # Ok(()) }
9881    /// ```
9882    pub type ClientBuilder =
9883        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
9884
9885    pub(crate) mod client {
9886        use super::super::super::client::PolicyBasedRoutingService;
9887        pub struct Factory;
9888        impl gax::client_builder::internal::ClientFactory for Factory {
9889            type Client = PolicyBasedRoutingService;
9890            type Credentials = gaxi::options::Credentials;
9891            async fn build(
9892                self,
9893                config: gaxi::options::ClientConfig,
9894            ) -> gax::client_builder::Result<Self::Client> {
9895                Self::Client::new(config).await
9896            }
9897        }
9898    }
9899
9900    /// Common implementation for [crate::client::PolicyBasedRoutingService] request builders.
9901    #[derive(Clone, Debug)]
9902    pub(crate) struct RequestBuilder<R: std::default::Default> {
9903        stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
9904        request: R,
9905        options: gax::options::RequestOptions,
9906    }
9907
9908    impl<R> RequestBuilder<R>
9909    where
9910        R: std::default::Default,
9911    {
9912        pub(crate) fn new(
9913            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
9914        ) -> Self {
9915            Self {
9916                stub,
9917                request: R::default(),
9918                options: gax::options::RequestOptions::default(),
9919            }
9920        }
9921    }
9922
9923    /// The request builder for [PolicyBasedRoutingService::list_policy_based_routes][crate::client::PolicyBasedRoutingService::list_policy_based_routes] calls.
9924    ///
9925    /// # Example
9926    /// ```
9927    /// # use google_cloud_networkconnectivity_v1::builder::policy_based_routing_service::ListPolicyBasedRoutes;
9928    /// # async fn sample() -> gax::Result<()> {
9929    /// use gax::paginator::ItemPaginator;
9930    ///
9931    /// let builder = prepare_request_builder();
9932    /// let mut items = builder.by_item();
9933    /// while let Some(result) = items.next().await {
9934    ///   let item = result?;
9935    /// }
9936    /// # Ok(()) }
9937    ///
9938    /// fn prepare_request_builder() -> ListPolicyBasedRoutes {
9939    ///   # panic!();
9940    ///   // ... details omitted ...
9941    /// }
9942    /// ```
9943    #[derive(Clone, Debug)]
9944    pub struct ListPolicyBasedRoutes(RequestBuilder<crate::model::ListPolicyBasedRoutesRequest>);
9945
9946    impl ListPolicyBasedRoutes {
9947        pub(crate) fn new(
9948            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
9949        ) -> Self {
9950            Self(RequestBuilder::new(stub))
9951        }
9952
9953        /// Sets the full request, replacing any prior values.
9954        pub fn with_request<V: Into<crate::model::ListPolicyBasedRoutesRequest>>(
9955            mut self,
9956            v: V,
9957        ) -> Self {
9958            self.0.request = v.into();
9959            self
9960        }
9961
9962        /// Sets all the options, replacing any prior values.
9963        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
9964            self.0.options = v.into();
9965            self
9966        }
9967
9968        /// Sends the request.
9969        pub async fn send(self) -> Result<crate::model::ListPolicyBasedRoutesResponse> {
9970            (*self.0.stub)
9971                .list_policy_based_routes(self.0.request, self.0.options)
9972                .await
9973                .map(gax::response::Response::into_body)
9974        }
9975
9976        /// Streams each page in the collection.
9977        pub fn by_page(
9978            self,
9979        ) -> impl gax::paginator::Paginator<crate::model::ListPolicyBasedRoutesResponse, gax::error::Error>
9980        {
9981            use std::clone::Clone;
9982            let token = self.0.request.page_token.clone();
9983            let execute = move |token: String| {
9984                let mut builder = self.clone();
9985                builder.0.request = builder.0.request.set_page_token(token);
9986                builder.send()
9987            };
9988            gax::paginator::internal::new_paginator(token, execute)
9989        }
9990
9991        /// Streams each item in the collection.
9992        pub fn by_item(
9993            self,
9994        ) -> impl gax::paginator::ItemPaginator<
9995            crate::model::ListPolicyBasedRoutesResponse,
9996            gax::error::Error,
9997        > {
9998            use gax::paginator::Paginator;
9999            self.by_page().items()
10000        }
10001
10002        /// Sets the value of [parent][crate::model::ListPolicyBasedRoutesRequest::parent].
10003        ///
10004        /// This is a **required** field for requests.
10005        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
10006            self.0.request.parent = v.into();
10007            self
10008        }
10009
10010        /// Sets the value of [page_size][crate::model::ListPolicyBasedRoutesRequest::page_size].
10011        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
10012            self.0.request.page_size = v.into();
10013            self
10014        }
10015
10016        /// Sets the value of [page_token][crate::model::ListPolicyBasedRoutesRequest::page_token].
10017        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
10018            self.0.request.page_token = v.into();
10019            self
10020        }
10021
10022        /// Sets the value of [filter][crate::model::ListPolicyBasedRoutesRequest::filter].
10023        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
10024            self.0.request.filter = v.into();
10025            self
10026        }
10027
10028        /// Sets the value of [order_by][crate::model::ListPolicyBasedRoutesRequest::order_by].
10029        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
10030            self.0.request.order_by = v.into();
10031            self
10032        }
10033    }
10034
10035    #[doc(hidden)]
10036    impl gax::options::internal::RequestBuilder for ListPolicyBasedRoutes {
10037        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10038            &mut self.0.options
10039        }
10040    }
10041
10042    /// The request builder for [PolicyBasedRoutingService::get_policy_based_route][crate::client::PolicyBasedRoutingService::get_policy_based_route] calls.
10043    ///
10044    /// # Example
10045    /// ```
10046    /// # use google_cloud_networkconnectivity_v1::builder::policy_based_routing_service::GetPolicyBasedRoute;
10047    /// # async fn sample() -> gax::Result<()> {
10048    ///
10049    /// let builder = prepare_request_builder();
10050    /// let response = builder.send().await?;
10051    /// # Ok(()) }
10052    ///
10053    /// fn prepare_request_builder() -> GetPolicyBasedRoute {
10054    ///   # panic!();
10055    ///   // ... details omitted ...
10056    /// }
10057    /// ```
10058    #[derive(Clone, Debug)]
10059    pub struct GetPolicyBasedRoute(RequestBuilder<crate::model::GetPolicyBasedRouteRequest>);
10060
10061    impl GetPolicyBasedRoute {
10062        pub(crate) fn new(
10063            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10064        ) -> Self {
10065            Self(RequestBuilder::new(stub))
10066        }
10067
10068        /// Sets the full request, replacing any prior values.
10069        pub fn with_request<V: Into<crate::model::GetPolicyBasedRouteRequest>>(
10070            mut self,
10071            v: V,
10072        ) -> Self {
10073            self.0.request = v.into();
10074            self
10075        }
10076
10077        /// Sets all the options, replacing any prior values.
10078        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10079            self.0.options = v.into();
10080            self
10081        }
10082
10083        /// Sends the request.
10084        pub async fn send(self) -> Result<crate::model::PolicyBasedRoute> {
10085            (*self.0.stub)
10086                .get_policy_based_route(self.0.request, self.0.options)
10087                .await
10088                .map(gax::response::Response::into_body)
10089        }
10090
10091        /// Sets the value of [name][crate::model::GetPolicyBasedRouteRequest::name].
10092        ///
10093        /// This is a **required** field for requests.
10094        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10095            self.0.request.name = v.into();
10096            self
10097        }
10098    }
10099
10100    #[doc(hidden)]
10101    impl gax::options::internal::RequestBuilder for GetPolicyBasedRoute {
10102        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10103            &mut self.0.options
10104        }
10105    }
10106
10107    /// The request builder for [PolicyBasedRoutingService::create_policy_based_route][crate::client::PolicyBasedRoutingService::create_policy_based_route] calls.
10108    ///
10109    /// # Example
10110    /// ```
10111    /// # use google_cloud_networkconnectivity_v1::builder::policy_based_routing_service::CreatePolicyBasedRoute;
10112    /// # async fn sample() -> gax::Result<()> {
10113    /// use lro::Poller;
10114    ///
10115    /// let builder = prepare_request_builder();
10116    /// let response = builder.poller().until_done().await?;
10117    /// # Ok(()) }
10118    ///
10119    /// fn prepare_request_builder() -> CreatePolicyBasedRoute {
10120    ///   # panic!();
10121    ///   // ... details omitted ...
10122    /// }
10123    /// ```
10124    #[derive(Clone, Debug)]
10125    pub struct CreatePolicyBasedRoute(RequestBuilder<crate::model::CreatePolicyBasedRouteRequest>);
10126
10127    impl CreatePolicyBasedRoute {
10128        pub(crate) fn new(
10129            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10130        ) -> Self {
10131            Self(RequestBuilder::new(stub))
10132        }
10133
10134        /// Sets the full request, replacing any prior values.
10135        pub fn with_request<V: Into<crate::model::CreatePolicyBasedRouteRequest>>(
10136            mut self,
10137            v: V,
10138        ) -> Self {
10139            self.0.request = v.into();
10140            self
10141        }
10142
10143        /// Sets all the options, replacing any prior values.
10144        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10145            self.0.options = v.into();
10146            self
10147        }
10148
10149        /// Sends the request.
10150        ///
10151        /// # Long running operations
10152        ///
10153        /// This starts, but does not poll, a longrunning operation. More information
10154        /// on [create_policy_based_route][crate::client::PolicyBasedRoutingService::create_policy_based_route].
10155        pub async fn send(self) -> Result<longrunning::model::Operation> {
10156            (*self.0.stub)
10157                .create_policy_based_route(self.0.request, self.0.options)
10158                .await
10159                .map(gax::response::Response::into_body)
10160        }
10161
10162        /// Creates a [Poller][lro::Poller] to work with `create_policy_based_route`.
10163        pub fn poller(
10164            self,
10165        ) -> impl lro::Poller<crate::model::PolicyBasedRoute, crate::model::OperationMetadata>
10166        {
10167            type Operation = lro::internal::Operation<
10168                crate::model::PolicyBasedRoute,
10169                crate::model::OperationMetadata,
10170            >;
10171            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
10172            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
10173
10174            let stub = self.0.stub.clone();
10175            let mut options = self.0.options.clone();
10176            options.set_retry_policy(gax::retry_policy::NeverRetry);
10177            let query = move |name| {
10178                let stub = stub.clone();
10179                let options = options.clone();
10180                async {
10181                    let op = GetOperation::new(stub)
10182                        .set_name(name)
10183                        .with_options(options)
10184                        .send()
10185                        .await?;
10186                    Ok(Operation::new(op))
10187                }
10188            };
10189
10190            let start = move || async {
10191                let op = self.send().await?;
10192                Ok(Operation::new(op))
10193            };
10194
10195            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
10196        }
10197
10198        /// Sets the value of [parent][crate::model::CreatePolicyBasedRouteRequest::parent].
10199        ///
10200        /// This is a **required** field for requests.
10201        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
10202            self.0.request.parent = v.into();
10203            self
10204        }
10205
10206        /// Sets the value of [policy_based_route_id][crate::model::CreatePolicyBasedRouteRequest::policy_based_route_id].
10207        ///
10208        /// This is a **required** field for requests.
10209        pub fn set_policy_based_route_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
10210            self.0.request.policy_based_route_id = v.into();
10211            self
10212        }
10213
10214        /// Sets the value of [policy_based_route][crate::model::CreatePolicyBasedRouteRequest::policy_based_route].
10215        ///
10216        /// This is a **required** field for requests.
10217        pub fn set_policy_based_route<T>(mut self, v: T) -> Self
10218        where
10219            T: std::convert::Into<crate::model::PolicyBasedRoute>,
10220        {
10221            self.0.request.policy_based_route = std::option::Option::Some(v.into());
10222            self
10223        }
10224
10225        /// Sets or clears the value of [policy_based_route][crate::model::CreatePolicyBasedRouteRequest::policy_based_route].
10226        ///
10227        /// This is a **required** field for requests.
10228        pub fn set_or_clear_policy_based_route<T>(mut self, v: std::option::Option<T>) -> Self
10229        where
10230            T: std::convert::Into<crate::model::PolicyBasedRoute>,
10231        {
10232            self.0.request.policy_based_route = v.map(|x| x.into());
10233            self
10234        }
10235
10236        /// Sets the value of [request_id][crate::model::CreatePolicyBasedRouteRequest::request_id].
10237        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
10238            self.0.request.request_id = v.into();
10239            self
10240        }
10241    }
10242
10243    #[doc(hidden)]
10244    impl gax::options::internal::RequestBuilder for CreatePolicyBasedRoute {
10245        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10246            &mut self.0.options
10247        }
10248    }
10249
10250    /// The request builder for [PolicyBasedRoutingService::delete_policy_based_route][crate::client::PolicyBasedRoutingService::delete_policy_based_route] calls.
10251    ///
10252    /// # Example
10253    /// ```
10254    /// # use google_cloud_networkconnectivity_v1::builder::policy_based_routing_service::DeletePolicyBasedRoute;
10255    /// # async fn sample() -> gax::Result<()> {
10256    /// use lro::Poller;
10257    ///
10258    /// let builder = prepare_request_builder();
10259    /// let response = builder.poller().until_done().await?;
10260    /// # Ok(()) }
10261    ///
10262    /// fn prepare_request_builder() -> DeletePolicyBasedRoute {
10263    ///   # panic!();
10264    ///   // ... details omitted ...
10265    /// }
10266    /// ```
10267    #[derive(Clone, Debug)]
10268    pub struct DeletePolicyBasedRoute(RequestBuilder<crate::model::DeletePolicyBasedRouteRequest>);
10269
10270    impl DeletePolicyBasedRoute {
10271        pub(crate) fn new(
10272            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10273        ) -> Self {
10274            Self(RequestBuilder::new(stub))
10275        }
10276
10277        /// Sets the full request, replacing any prior values.
10278        pub fn with_request<V: Into<crate::model::DeletePolicyBasedRouteRequest>>(
10279            mut self,
10280            v: V,
10281        ) -> Self {
10282            self.0.request = v.into();
10283            self
10284        }
10285
10286        /// Sets all the options, replacing any prior values.
10287        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10288            self.0.options = v.into();
10289            self
10290        }
10291
10292        /// Sends the request.
10293        ///
10294        /// # Long running operations
10295        ///
10296        /// This starts, but does not poll, a longrunning operation. More information
10297        /// on [delete_policy_based_route][crate::client::PolicyBasedRoutingService::delete_policy_based_route].
10298        pub async fn send(self) -> Result<longrunning::model::Operation> {
10299            (*self.0.stub)
10300                .delete_policy_based_route(self.0.request, self.0.options)
10301                .await
10302                .map(gax::response::Response::into_body)
10303        }
10304
10305        /// Creates a [Poller][lro::Poller] to work with `delete_policy_based_route`.
10306        pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
10307            type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
10308            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
10309            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
10310
10311            let stub = self.0.stub.clone();
10312            let mut options = self.0.options.clone();
10313            options.set_retry_policy(gax::retry_policy::NeverRetry);
10314            let query = move |name| {
10315                let stub = stub.clone();
10316                let options = options.clone();
10317                async {
10318                    let op = GetOperation::new(stub)
10319                        .set_name(name)
10320                        .with_options(options)
10321                        .send()
10322                        .await?;
10323                    Ok(Operation::new(op))
10324                }
10325            };
10326
10327            let start = move || async {
10328                let op = self.send().await?;
10329                Ok(Operation::new(op))
10330            };
10331
10332            lro::internal::new_unit_response_poller(
10333                polling_error_policy,
10334                polling_backoff_policy,
10335                start,
10336                query,
10337            )
10338        }
10339
10340        /// Sets the value of [name][crate::model::DeletePolicyBasedRouteRequest::name].
10341        ///
10342        /// This is a **required** field for requests.
10343        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10344            self.0.request.name = v.into();
10345            self
10346        }
10347
10348        /// Sets the value of [request_id][crate::model::DeletePolicyBasedRouteRequest::request_id].
10349        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
10350            self.0.request.request_id = v.into();
10351            self
10352        }
10353    }
10354
10355    #[doc(hidden)]
10356    impl gax::options::internal::RequestBuilder for DeletePolicyBasedRoute {
10357        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10358            &mut self.0.options
10359        }
10360    }
10361
10362    /// The request builder for [PolicyBasedRoutingService::list_locations][crate::client::PolicyBasedRoutingService::list_locations] calls.
10363    ///
10364    /// # Example
10365    /// ```
10366    /// # use google_cloud_networkconnectivity_v1::builder::policy_based_routing_service::ListLocations;
10367    /// # async fn sample() -> gax::Result<()> {
10368    /// use gax::paginator::ItemPaginator;
10369    ///
10370    /// let builder = prepare_request_builder();
10371    /// let mut items = builder.by_item();
10372    /// while let Some(result) = items.next().await {
10373    ///   let item = result?;
10374    /// }
10375    /// # Ok(()) }
10376    ///
10377    /// fn prepare_request_builder() -> ListLocations {
10378    ///   # panic!();
10379    ///   // ... details omitted ...
10380    /// }
10381    /// ```
10382    #[derive(Clone, Debug)]
10383    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
10384
10385    impl ListLocations {
10386        pub(crate) fn new(
10387            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10388        ) -> Self {
10389            Self(RequestBuilder::new(stub))
10390        }
10391
10392        /// Sets the full request, replacing any prior values.
10393        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
10394            mut self,
10395            v: V,
10396        ) -> Self {
10397            self.0.request = v.into();
10398            self
10399        }
10400
10401        /// Sets all the options, replacing any prior values.
10402        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10403            self.0.options = v.into();
10404            self
10405        }
10406
10407        /// Sends the request.
10408        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
10409            (*self.0.stub)
10410                .list_locations(self.0.request, self.0.options)
10411                .await
10412                .map(gax::response::Response::into_body)
10413        }
10414
10415        /// Streams each page in the collection.
10416        pub fn by_page(
10417            self,
10418        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
10419        {
10420            use std::clone::Clone;
10421            let token = self.0.request.page_token.clone();
10422            let execute = move |token: String| {
10423                let mut builder = self.clone();
10424                builder.0.request = builder.0.request.set_page_token(token);
10425                builder.send()
10426            };
10427            gax::paginator::internal::new_paginator(token, execute)
10428        }
10429
10430        /// Streams each item in the collection.
10431        pub fn by_item(
10432            self,
10433        ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
10434        {
10435            use gax::paginator::Paginator;
10436            self.by_page().items()
10437        }
10438
10439        /// Sets the value of [name][location::model::ListLocationsRequest::name].
10440        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10441            self.0.request.name = v.into();
10442            self
10443        }
10444
10445        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
10446        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
10447            self.0.request.filter = v.into();
10448            self
10449        }
10450
10451        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
10452        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
10453            self.0.request.page_size = v.into();
10454            self
10455        }
10456
10457        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
10458        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
10459            self.0.request.page_token = v.into();
10460            self
10461        }
10462    }
10463
10464    #[doc(hidden)]
10465    impl gax::options::internal::RequestBuilder for ListLocations {
10466        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10467            &mut self.0.options
10468        }
10469    }
10470
10471    /// The request builder for [PolicyBasedRoutingService::get_location][crate::client::PolicyBasedRoutingService::get_location] calls.
10472    ///
10473    /// # Example
10474    /// ```
10475    /// # use google_cloud_networkconnectivity_v1::builder::policy_based_routing_service::GetLocation;
10476    /// # async fn sample() -> gax::Result<()> {
10477    ///
10478    /// let builder = prepare_request_builder();
10479    /// let response = builder.send().await?;
10480    /// # Ok(()) }
10481    ///
10482    /// fn prepare_request_builder() -> GetLocation {
10483    ///   # panic!();
10484    ///   // ... details omitted ...
10485    /// }
10486    /// ```
10487    #[derive(Clone, Debug)]
10488    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
10489
10490    impl GetLocation {
10491        pub(crate) fn new(
10492            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10493        ) -> Self {
10494            Self(RequestBuilder::new(stub))
10495        }
10496
10497        /// Sets the full request, replacing any prior values.
10498        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
10499            self.0.request = v.into();
10500            self
10501        }
10502
10503        /// Sets all the options, replacing any prior values.
10504        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10505            self.0.options = v.into();
10506            self
10507        }
10508
10509        /// Sends the request.
10510        pub async fn send(self) -> Result<location::model::Location> {
10511            (*self.0.stub)
10512                .get_location(self.0.request, self.0.options)
10513                .await
10514                .map(gax::response::Response::into_body)
10515        }
10516
10517        /// Sets the value of [name][location::model::GetLocationRequest::name].
10518        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10519            self.0.request.name = v.into();
10520            self
10521        }
10522    }
10523
10524    #[doc(hidden)]
10525    impl gax::options::internal::RequestBuilder for GetLocation {
10526        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10527            &mut self.0.options
10528        }
10529    }
10530
10531    /// The request builder for [PolicyBasedRoutingService::set_iam_policy][crate::client::PolicyBasedRoutingService::set_iam_policy] calls.
10532    ///
10533    /// # Example
10534    /// ```
10535    /// # use google_cloud_networkconnectivity_v1::builder::policy_based_routing_service::SetIamPolicy;
10536    /// # async fn sample() -> gax::Result<()> {
10537    ///
10538    /// let builder = prepare_request_builder();
10539    /// let response = builder.send().await?;
10540    /// # Ok(()) }
10541    ///
10542    /// fn prepare_request_builder() -> SetIamPolicy {
10543    ///   # panic!();
10544    ///   // ... details omitted ...
10545    /// }
10546    /// ```
10547    #[derive(Clone, Debug)]
10548    pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
10549
10550    impl SetIamPolicy {
10551        pub(crate) fn new(
10552            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10553        ) -> Self {
10554            Self(RequestBuilder::new(stub))
10555        }
10556
10557        /// Sets the full request, replacing any prior values.
10558        pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
10559            self.0.request = v.into();
10560            self
10561        }
10562
10563        /// Sets all the options, replacing any prior values.
10564        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10565            self.0.options = v.into();
10566            self
10567        }
10568
10569        /// Sends the request.
10570        pub async fn send(self) -> Result<iam_v1::model::Policy> {
10571            (*self.0.stub)
10572                .set_iam_policy(self.0.request, self.0.options)
10573                .await
10574                .map(gax::response::Response::into_body)
10575        }
10576
10577        /// Sets the value of [resource][iam_v1::model::SetIamPolicyRequest::resource].
10578        ///
10579        /// This is a **required** field for requests.
10580        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
10581            self.0.request.resource = v.into();
10582            self
10583        }
10584
10585        /// Sets the value of [policy][iam_v1::model::SetIamPolicyRequest::policy].
10586        ///
10587        /// This is a **required** field for requests.
10588        pub fn set_policy<T>(mut self, v: T) -> Self
10589        where
10590            T: std::convert::Into<iam_v1::model::Policy>,
10591        {
10592            self.0.request.policy = std::option::Option::Some(v.into());
10593            self
10594        }
10595
10596        /// Sets or clears the value of [policy][iam_v1::model::SetIamPolicyRequest::policy].
10597        ///
10598        /// This is a **required** field for requests.
10599        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
10600        where
10601            T: std::convert::Into<iam_v1::model::Policy>,
10602        {
10603            self.0.request.policy = v.map(|x| x.into());
10604            self
10605        }
10606
10607        /// Sets the value of [update_mask][iam_v1::model::SetIamPolicyRequest::update_mask].
10608        pub fn set_update_mask<T>(mut self, v: T) -> Self
10609        where
10610            T: std::convert::Into<wkt::FieldMask>,
10611        {
10612            self.0.request.update_mask = std::option::Option::Some(v.into());
10613            self
10614        }
10615
10616        /// Sets or clears the value of [update_mask][iam_v1::model::SetIamPolicyRequest::update_mask].
10617        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
10618        where
10619            T: std::convert::Into<wkt::FieldMask>,
10620        {
10621            self.0.request.update_mask = v.map(|x| x.into());
10622            self
10623        }
10624    }
10625
10626    #[doc(hidden)]
10627    impl gax::options::internal::RequestBuilder for SetIamPolicy {
10628        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10629            &mut self.0.options
10630        }
10631    }
10632
10633    /// The request builder for [PolicyBasedRoutingService::get_iam_policy][crate::client::PolicyBasedRoutingService::get_iam_policy] calls.
10634    ///
10635    /// # Example
10636    /// ```
10637    /// # use google_cloud_networkconnectivity_v1::builder::policy_based_routing_service::GetIamPolicy;
10638    /// # async fn sample() -> gax::Result<()> {
10639    ///
10640    /// let builder = prepare_request_builder();
10641    /// let response = builder.send().await?;
10642    /// # Ok(()) }
10643    ///
10644    /// fn prepare_request_builder() -> GetIamPolicy {
10645    ///   # panic!();
10646    ///   // ... details omitted ...
10647    /// }
10648    /// ```
10649    #[derive(Clone, Debug)]
10650    pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
10651
10652    impl GetIamPolicy {
10653        pub(crate) fn new(
10654            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10655        ) -> Self {
10656            Self(RequestBuilder::new(stub))
10657        }
10658
10659        /// Sets the full request, replacing any prior values.
10660        pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
10661            self.0.request = v.into();
10662            self
10663        }
10664
10665        /// Sets all the options, replacing any prior values.
10666        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10667            self.0.options = v.into();
10668            self
10669        }
10670
10671        /// Sends the request.
10672        pub async fn send(self) -> Result<iam_v1::model::Policy> {
10673            (*self.0.stub)
10674                .get_iam_policy(self.0.request, self.0.options)
10675                .await
10676                .map(gax::response::Response::into_body)
10677        }
10678
10679        /// Sets the value of [resource][iam_v1::model::GetIamPolicyRequest::resource].
10680        ///
10681        /// This is a **required** field for requests.
10682        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
10683            self.0.request.resource = v.into();
10684            self
10685        }
10686
10687        /// Sets the value of [options][iam_v1::model::GetIamPolicyRequest::options].
10688        pub fn set_options<T>(mut self, v: T) -> Self
10689        where
10690            T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
10691        {
10692            self.0.request.options = std::option::Option::Some(v.into());
10693            self
10694        }
10695
10696        /// Sets or clears the value of [options][iam_v1::model::GetIamPolicyRequest::options].
10697        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
10698        where
10699            T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
10700        {
10701            self.0.request.options = v.map(|x| x.into());
10702            self
10703        }
10704    }
10705
10706    #[doc(hidden)]
10707    impl gax::options::internal::RequestBuilder for GetIamPolicy {
10708        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10709            &mut self.0.options
10710        }
10711    }
10712
10713    /// The request builder for [PolicyBasedRoutingService::test_iam_permissions][crate::client::PolicyBasedRoutingService::test_iam_permissions] calls.
10714    ///
10715    /// # Example
10716    /// ```
10717    /// # use google_cloud_networkconnectivity_v1::builder::policy_based_routing_service::TestIamPermissions;
10718    /// # async fn sample() -> gax::Result<()> {
10719    ///
10720    /// let builder = prepare_request_builder();
10721    /// let response = builder.send().await?;
10722    /// # Ok(()) }
10723    ///
10724    /// fn prepare_request_builder() -> TestIamPermissions {
10725    ///   # panic!();
10726    ///   // ... details omitted ...
10727    /// }
10728    /// ```
10729    #[derive(Clone, Debug)]
10730    pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
10731
10732    impl TestIamPermissions {
10733        pub(crate) fn new(
10734            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10735        ) -> Self {
10736            Self(RequestBuilder::new(stub))
10737        }
10738
10739        /// Sets the full request, replacing any prior values.
10740        pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
10741            mut self,
10742            v: V,
10743        ) -> Self {
10744            self.0.request = v.into();
10745            self
10746        }
10747
10748        /// Sets all the options, replacing any prior values.
10749        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10750            self.0.options = v.into();
10751            self
10752        }
10753
10754        /// Sends the request.
10755        pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
10756            (*self.0.stub)
10757                .test_iam_permissions(self.0.request, self.0.options)
10758                .await
10759                .map(gax::response::Response::into_body)
10760        }
10761
10762        /// Sets the value of [resource][iam_v1::model::TestIamPermissionsRequest::resource].
10763        ///
10764        /// This is a **required** field for requests.
10765        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
10766            self.0.request.resource = v.into();
10767            self
10768        }
10769
10770        /// Sets the value of [permissions][iam_v1::model::TestIamPermissionsRequest::permissions].
10771        ///
10772        /// This is a **required** field for requests.
10773        pub fn set_permissions<T, V>(mut self, v: T) -> Self
10774        where
10775            T: std::iter::IntoIterator<Item = V>,
10776            V: std::convert::Into<std::string::String>,
10777        {
10778            use std::iter::Iterator;
10779            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
10780            self
10781        }
10782    }
10783
10784    #[doc(hidden)]
10785    impl gax::options::internal::RequestBuilder for TestIamPermissions {
10786        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10787            &mut self.0.options
10788        }
10789    }
10790
10791    /// The request builder for [PolicyBasedRoutingService::list_operations][crate::client::PolicyBasedRoutingService::list_operations] calls.
10792    ///
10793    /// # Example
10794    /// ```
10795    /// # use google_cloud_networkconnectivity_v1::builder::policy_based_routing_service::ListOperations;
10796    /// # async fn sample() -> gax::Result<()> {
10797    /// use gax::paginator::ItemPaginator;
10798    ///
10799    /// let builder = prepare_request_builder();
10800    /// let mut items = builder.by_item();
10801    /// while let Some(result) = items.next().await {
10802    ///   let item = result?;
10803    /// }
10804    /// # Ok(()) }
10805    ///
10806    /// fn prepare_request_builder() -> ListOperations {
10807    ///   # panic!();
10808    ///   // ... details omitted ...
10809    /// }
10810    /// ```
10811    #[derive(Clone, Debug)]
10812    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
10813
10814    impl ListOperations {
10815        pub(crate) fn new(
10816            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10817        ) -> Self {
10818            Self(RequestBuilder::new(stub))
10819        }
10820
10821        /// Sets the full request, replacing any prior values.
10822        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
10823            mut self,
10824            v: V,
10825        ) -> Self {
10826            self.0.request = v.into();
10827            self
10828        }
10829
10830        /// Sets all the options, replacing any prior values.
10831        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10832            self.0.options = v.into();
10833            self
10834        }
10835
10836        /// Sends the request.
10837        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
10838            (*self.0.stub)
10839                .list_operations(self.0.request, self.0.options)
10840                .await
10841                .map(gax::response::Response::into_body)
10842        }
10843
10844        /// Streams each page in the collection.
10845        pub fn by_page(
10846            self,
10847        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
10848        {
10849            use std::clone::Clone;
10850            let token = self.0.request.page_token.clone();
10851            let execute = move |token: String| {
10852                let mut builder = self.clone();
10853                builder.0.request = builder.0.request.set_page_token(token);
10854                builder.send()
10855            };
10856            gax::paginator::internal::new_paginator(token, execute)
10857        }
10858
10859        /// Streams each item in the collection.
10860        pub fn by_item(
10861            self,
10862        ) -> impl gax::paginator::ItemPaginator<
10863            longrunning::model::ListOperationsResponse,
10864            gax::error::Error,
10865        > {
10866            use gax::paginator::Paginator;
10867            self.by_page().items()
10868        }
10869
10870        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
10871        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10872            self.0.request.name = v.into();
10873            self
10874        }
10875
10876        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
10877        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
10878            self.0.request.filter = v.into();
10879            self
10880        }
10881
10882        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
10883        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
10884            self.0.request.page_size = v.into();
10885            self
10886        }
10887
10888        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
10889        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
10890            self.0.request.page_token = v.into();
10891            self
10892        }
10893
10894        /// Sets the value of [return_partial_success][longrunning::model::ListOperationsRequest::return_partial_success].
10895        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
10896            self.0.request.return_partial_success = v.into();
10897            self
10898        }
10899    }
10900
10901    #[doc(hidden)]
10902    impl gax::options::internal::RequestBuilder for ListOperations {
10903        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10904            &mut self.0.options
10905        }
10906    }
10907
10908    /// The request builder for [PolicyBasedRoutingService::get_operation][crate::client::PolicyBasedRoutingService::get_operation] calls.
10909    ///
10910    /// # Example
10911    /// ```
10912    /// # use google_cloud_networkconnectivity_v1::builder::policy_based_routing_service::GetOperation;
10913    /// # async fn sample() -> gax::Result<()> {
10914    ///
10915    /// let builder = prepare_request_builder();
10916    /// let response = builder.send().await?;
10917    /// # Ok(()) }
10918    ///
10919    /// fn prepare_request_builder() -> GetOperation {
10920    ///   # panic!();
10921    ///   // ... details omitted ...
10922    /// }
10923    /// ```
10924    #[derive(Clone, Debug)]
10925    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
10926
10927    impl GetOperation {
10928        pub(crate) fn new(
10929            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10930        ) -> Self {
10931            Self(RequestBuilder::new(stub))
10932        }
10933
10934        /// Sets the full request, replacing any prior values.
10935        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
10936            mut self,
10937            v: V,
10938        ) -> Self {
10939            self.0.request = v.into();
10940            self
10941        }
10942
10943        /// Sets all the options, replacing any prior values.
10944        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
10945            self.0.options = v.into();
10946            self
10947        }
10948
10949        /// Sends the request.
10950        pub async fn send(self) -> Result<longrunning::model::Operation> {
10951            (*self.0.stub)
10952                .get_operation(self.0.request, self.0.options)
10953                .await
10954                .map(gax::response::Response::into_body)
10955        }
10956
10957        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
10958        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10959            self.0.request.name = v.into();
10960            self
10961        }
10962    }
10963
10964    #[doc(hidden)]
10965    impl gax::options::internal::RequestBuilder for GetOperation {
10966        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
10967            &mut self.0.options
10968        }
10969    }
10970
10971    /// The request builder for [PolicyBasedRoutingService::delete_operation][crate::client::PolicyBasedRoutingService::delete_operation] calls.
10972    ///
10973    /// # Example
10974    /// ```
10975    /// # use google_cloud_networkconnectivity_v1::builder::policy_based_routing_service::DeleteOperation;
10976    /// # async fn sample() -> gax::Result<()> {
10977    ///
10978    /// let builder = prepare_request_builder();
10979    /// let response = builder.send().await?;
10980    /// # Ok(()) }
10981    ///
10982    /// fn prepare_request_builder() -> DeleteOperation {
10983    ///   # panic!();
10984    ///   // ... details omitted ...
10985    /// }
10986    /// ```
10987    #[derive(Clone, Debug)]
10988    pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
10989
10990    impl DeleteOperation {
10991        pub(crate) fn new(
10992            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10993        ) -> Self {
10994            Self(RequestBuilder::new(stub))
10995        }
10996
10997        /// Sets the full request, replacing any prior values.
10998        pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
10999            mut self,
11000            v: V,
11001        ) -> Self {
11002            self.0.request = v.into();
11003            self
11004        }
11005
11006        /// Sets all the options, replacing any prior values.
11007        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11008            self.0.options = v.into();
11009            self
11010        }
11011
11012        /// Sends the request.
11013        pub async fn send(self) -> Result<()> {
11014            (*self.0.stub)
11015                .delete_operation(self.0.request, self.0.options)
11016                .await
11017                .map(gax::response::Response::into_body)
11018        }
11019
11020        /// Sets the value of [name][longrunning::model::DeleteOperationRequest::name].
11021        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11022            self.0.request.name = v.into();
11023            self
11024        }
11025    }
11026
11027    #[doc(hidden)]
11028    impl gax::options::internal::RequestBuilder for DeleteOperation {
11029        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11030            &mut self.0.options
11031        }
11032    }
11033
11034    /// The request builder for [PolicyBasedRoutingService::cancel_operation][crate::client::PolicyBasedRoutingService::cancel_operation] calls.
11035    ///
11036    /// # Example
11037    /// ```
11038    /// # use google_cloud_networkconnectivity_v1::builder::policy_based_routing_service::CancelOperation;
11039    /// # async fn sample() -> gax::Result<()> {
11040    ///
11041    /// let builder = prepare_request_builder();
11042    /// let response = builder.send().await?;
11043    /// # Ok(()) }
11044    ///
11045    /// fn prepare_request_builder() -> CancelOperation {
11046    ///   # panic!();
11047    ///   // ... details omitted ...
11048    /// }
11049    /// ```
11050    #[derive(Clone, Debug)]
11051    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
11052
11053    impl CancelOperation {
11054        pub(crate) fn new(
11055            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
11056        ) -> Self {
11057            Self(RequestBuilder::new(stub))
11058        }
11059
11060        /// Sets the full request, replacing any prior values.
11061        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
11062            mut self,
11063            v: V,
11064        ) -> Self {
11065            self.0.request = v.into();
11066            self
11067        }
11068
11069        /// Sets all the options, replacing any prior values.
11070        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
11071            self.0.options = v.into();
11072            self
11073        }
11074
11075        /// Sends the request.
11076        pub async fn send(self) -> Result<()> {
11077            (*self.0.stub)
11078                .cancel_operation(self.0.request, self.0.options)
11079                .await
11080                .map(gax::response::Response::into_body)
11081        }
11082
11083        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
11084        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11085            self.0.request.name = v.into();
11086            self
11087        }
11088    }
11089
11090    #[doc(hidden)]
11091    impl gax::options::internal::RequestBuilder for CancelOperation {
11092        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
11093            &mut self.0.options
11094        }
11095    }
11096}