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() -> google_cloud_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 = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
34
35    pub(crate) mod client {
36        use super::super::super::client::CrossNetworkAutomationService;
37        pub struct Factory;
38        impl crate::ClientFactory for Factory {
39            type Client = CrossNetworkAutomationService;
40            type Credentials = gaxi::options::Credentials;
41            async fn build(
42                self,
43                config: gaxi::options::ClientConfig,
44            ) -> crate::ClientBuilderResult<Self::Client> {
45                Self::Client::new(config).await
46            }
47        }
48    }
49
50    /// Common implementation for [crate::client::CrossNetworkAutomationService] request builders.
51    #[derive(Clone, Debug)]
52    pub(crate) struct RequestBuilder<R: std::default::Default> {
53        stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
54        request: R,
55        options: crate::RequestOptions,
56    }
57
58    impl<R> RequestBuilder<R>
59    where
60        R: std::default::Default,
61    {
62        pub(crate) fn new(
63            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
64        ) -> Self {
65            Self {
66                stub,
67                request: R::default(),
68                options: crate::RequestOptions::default(),
69            }
70        }
71    }
72
73    /// The request builder for [CrossNetworkAutomationService::list_service_connection_maps][crate::client::CrossNetworkAutomationService::list_service_connection_maps] calls.
74    ///
75    /// # Example
76    /// ```
77    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::ListServiceConnectionMaps;
78    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
79    /// use google_cloud_gax::paginator::ItemPaginator;
80    ///
81    /// let builder = prepare_request_builder();
82    /// let mut items = builder.by_item();
83    /// while let Some(result) = items.next().await {
84    ///   let item = result?;
85    /// }
86    /// # Ok(()) }
87    ///
88    /// fn prepare_request_builder() -> ListServiceConnectionMaps {
89    ///   # panic!();
90    ///   // ... details omitted ...
91    /// }
92    /// ```
93    #[derive(Clone, Debug)]
94    pub struct ListServiceConnectionMaps(
95        RequestBuilder<crate::model::ListServiceConnectionMapsRequest>,
96    );
97
98    impl ListServiceConnectionMaps {
99        pub(crate) fn new(
100            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
101        ) -> Self {
102            Self(RequestBuilder::new(stub))
103        }
104
105        /// Sets the full request, replacing any prior values.
106        pub fn with_request<V: Into<crate::model::ListServiceConnectionMapsRequest>>(
107            mut self,
108            v: V,
109        ) -> Self {
110            self.0.request = v.into();
111            self
112        }
113
114        /// Sets all the options, replacing any prior values.
115        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
116            self.0.options = v.into();
117            self
118        }
119
120        /// Sends the request.
121        pub async fn send(self) -> Result<crate::model::ListServiceConnectionMapsResponse> {
122            (*self.0.stub)
123                .list_service_connection_maps(self.0.request, self.0.options)
124                .await
125                .map(crate::Response::into_body)
126        }
127
128        /// Streams each page in the collection.
129        pub fn by_page(
130            self,
131        ) -> impl google_cloud_gax::paginator::Paginator<
132            crate::model::ListServiceConnectionMapsResponse,
133            crate::Error,
134        > {
135            use std::clone::Clone;
136            let token = self.0.request.page_token.clone();
137            let execute = move |token: String| {
138                let mut builder = self.clone();
139                builder.0.request = builder.0.request.set_page_token(token);
140                builder.send()
141            };
142            google_cloud_gax::paginator::internal::new_paginator(token, execute)
143        }
144
145        /// Streams each item in the collection.
146        pub fn by_item(
147            self,
148        ) -> impl google_cloud_gax::paginator::ItemPaginator<
149            crate::model::ListServiceConnectionMapsResponse,
150            crate::Error,
151        > {
152            use google_cloud_gax::paginator::Paginator;
153            self.by_page().items()
154        }
155
156        /// Sets the value of [parent][crate::model::ListServiceConnectionMapsRequest::parent].
157        ///
158        /// This is a **required** field for requests.
159        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
160            self.0.request.parent = v.into();
161            self
162        }
163
164        /// Sets the value of [page_size][crate::model::ListServiceConnectionMapsRequest::page_size].
165        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
166            self.0.request.page_size = v.into();
167            self
168        }
169
170        /// Sets the value of [page_token][crate::model::ListServiceConnectionMapsRequest::page_token].
171        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
172            self.0.request.page_token = v.into();
173            self
174        }
175
176        /// Sets the value of [filter][crate::model::ListServiceConnectionMapsRequest::filter].
177        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
178            self.0.request.filter = v.into();
179            self
180        }
181
182        /// Sets the value of [order_by][crate::model::ListServiceConnectionMapsRequest::order_by].
183        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
184            self.0.request.order_by = v.into();
185            self
186        }
187    }
188
189    #[doc(hidden)]
190    impl crate::RequestBuilder for ListServiceConnectionMaps {
191        fn request_options(&mut self) -> &mut crate::RequestOptions {
192            &mut self.0.options
193        }
194    }
195
196    /// The request builder for [CrossNetworkAutomationService::get_service_connection_map][crate::client::CrossNetworkAutomationService::get_service_connection_map] calls.
197    ///
198    /// # Example
199    /// ```
200    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::GetServiceConnectionMap;
201    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
202    ///
203    /// let builder = prepare_request_builder();
204    /// let response = builder.send().await?;
205    /// # Ok(()) }
206    ///
207    /// fn prepare_request_builder() -> GetServiceConnectionMap {
208    ///   # panic!();
209    ///   // ... details omitted ...
210    /// }
211    /// ```
212    #[derive(Clone, Debug)]
213    pub struct GetServiceConnectionMap(
214        RequestBuilder<crate::model::GetServiceConnectionMapRequest>,
215    );
216
217    impl GetServiceConnectionMap {
218        pub(crate) fn new(
219            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
220        ) -> Self {
221            Self(RequestBuilder::new(stub))
222        }
223
224        /// Sets the full request, replacing any prior values.
225        pub fn with_request<V: Into<crate::model::GetServiceConnectionMapRequest>>(
226            mut self,
227            v: V,
228        ) -> Self {
229            self.0.request = v.into();
230            self
231        }
232
233        /// Sets all the options, replacing any prior values.
234        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
235            self.0.options = v.into();
236            self
237        }
238
239        /// Sends the request.
240        pub async fn send(self) -> Result<crate::model::ServiceConnectionMap> {
241            (*self.0.stub)
242                .get_service_connection_map(self.0.request, self.0.options)
243                .await
244                .map(crate::Response::into_body)
245        }
246
247        /// Sets the value of [name][crate::model::GetServiceConnectionMapRequest::name].
248        ///
249        /// This is a **required** field for requests.
250        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
251            self.0.request.name = v.into();
252            self
253        }
254    }
255
256    #[doc(hidden)]
257    impl crate::RequestBuilder for GetServiceConnectionMap {
258        fn request_options(&mut self) -> &mut crate::RequestOptions {
259            &mut self.0.options
260        }
261    }
262
263    /// The request builder for [CrossNetworkAutomationService::create_service_connection_map][crate::client::CrossNetworkAutomationService::create_service_connection_map] calls.
264    ///
265    /// # Example
266    /// ```
267    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::CreateServiceConnectionMap;
268    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
269    /// use google_cloud_lro::Poller;
270    ///
271    /// let builder = prepare_request_builder();
272    /// let response = builder.poller().until_done().await?;
273    /// # Ok(()) }
274    ///
275    /// fn prepare_request_builder() -> CreateServiceConnectionMap {
276    ///   # panic!();
277    ///   // ... details omitted ...
278    /// }
279    /// ```
280    #[derive(Clone, Debug)]
281    pub struct CreateServiceConnectionMap(
282        RequestBuilder<crate::model::CreateServiceConnectionMapRequest>,
283    );
284
285    impl CreateServiceConnectionMap {
286        pub(crate) fn new(
287            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
288        ) -> Self {
289            Self(RequestBuilder::new(stub))
290        }
291
292        /// Sets the full request, replacing any prior values.
293        pub fn with_request<V: Into<crate::model::CreateServiceConnectionMapRequest>>(
294            mut self,
295            v: V,
296        ) -> Self {
297            self.0.request = v.into();
298            self
299        }
300
301        /// Sets all the options, replacing any prior values.
302        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
303            self.0.options = v.into();
304            self
305        }
306
307        /// Sends the request.
308        ///
309        /// # Long running operations
310        ///
311        /// This starts, but does not poll, a longrunning operation. More information
312        /// on [create_service_connection_map][crate::client::CrossNetworkAutomationService::create_service_connection_map].
313        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
314            (*self.0.stub)
315                .create_service_connection_map(self.0.request, self.0.options)
316                .await
317                .map(crate::Response::into_body)
318        }
319
320        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_service_connection_map`.
321        pub fn poller(
322            self,
323        ) -> impl google_cloud_lro::Poller<
324            crate::model::ServiceConnectionMap,
325            crate::model::OperationMetadata,
326        > {
327            type Operation = google_cloud_lro::internal::Operation<
328                crate::model::ServiceConnectionMap,
329                crate::model::OperationMetadata,
330            >;
331            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
332            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
333
334            let stub = self.0.stub.clone();
335            let mut options = self.0.options.clone();
336            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
337            let query = move |name| {
338                let stub = stub.clone();
339                let options = options.clone();
340                async {
341                    let op = GetOperation::new(stub)
342                        .set_name(name)
343                        .with_options(options)
344                        .send()
345                        .await?;
346                    Ok(Operation::new(op))
347                }
348            };
349
350            let start = move || async {
351                let op = self.send().await?;
352                Ok(Operation::new(op))
353            };
354
355            google_cloud_lro::internal::new_poller(
356                polling_error_policy,
357                polling_backoff_policy,
358                start,
359                query,
360            )
361        }
362
363        /// Sets the value of [parent][crate::model::CreateServiceConnectionMapRequest::parent].
364        ///
365        /// This is a **required** field for requests.
366        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
367            self.0.request.parent = v.into();
368            self
369        }
370
371        /// Sets the value of [service_connection_map_id][crate::model::CreateServiceConnectionMapRequest::service_connection_map_id].
372        pub fn set_service_connection_map_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
373            self.0.request.service_connection_map_id = v.into();
374            self
375        }
376
377        /// Sets the value of [service_connection_map][crate::model::CreateServiceConnectionMapRequest::service_connection_map].
378        ///
379        /// This is a **required** field for requests.
380        pub fn set_service_connection_map<T>(mut self, v: T) -> Self
381        where
382            T: std::convert::Into<crate::model::ServiceConnectionMap>,
383        {
384            self.0.request.service_connection_map = std::option::Option::Some(v.into());
385            self
386        }
387
388        /// Sets or clears the value of [service_connection_map][crate::model::CreateServiceConnectionMapRequest::service_connection_map].
389        ///
390        /// This is a **required** field for requests.
391        pub fn set_or_clear_service_connection_map<T>(mut self, v: std::option::Option<T>) -> Self
392        where
393            T: std::convert::Into<crate::model::ServiceConnectionMap>,
394        {
395            self.0.request.service_connection_map = v.map(|x| x.into());
396            self
397        }
398
399        /// Sets the value of [request_id][crate::model::CreateServiceConnectionMapRequest::request_id].
400        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
401            self.0.request.request_id = v.into();
402            self
403        }
404    }
405
406    #[doc(hidden)]
407    impl crate::RequestBuilder for CreateServiceConnectionMap {
408        fn request_options(&mut self) -> &mut crate::RequestOptions {
409            &mut self.0.options
410        }
411    }
412
413    /// The request builder for [CrossNetworkAutomationService::update_service_connection_map][crate::client::CrossNetworkAutomationService::update_service_connection_map] calls.
414    ///
415    /// # Example
416    /// ```
417    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::UpdateServiceConnectionMap;
418    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
419    /// use google_cloud_lro::Poller;
420    ///
421    /// let builder = prepare_request_builder();
422    /// let response = builder.poller().until_done().await?;
423    /// # Ok(()) }
424    ///
425    /// fn prepare_request_builder() -> UpdateServiceConnectionMap {
426    ///   # panic!();
427    ///   // ... details omitted ...
428    /// }
429    /// ```
430    #[derive(Clone, Debug)]
431    pub struct UpdateServiceConnectionMap(
432        RequestBuilder<crate::model::UpdateServiceConnectionMapRequest>,
433    );
434
435    impl UpdateServiceConnectionMap {
436        pub(crate) fn new(
437            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
438        ) -> Self {
439            Self(RequestBuilder::new(stub))
440        }
441
442        /// Sets the full request, replacing any prior values.
443        pub fn with_request<V: Into<crate::model::UpdateServiceConnectionMapRequest>>(
444            mut self,
445            v: V,
446        ) -> Self {
447            self.0.request = v.into();
448            self
449        }
450
451        /// Sets all the options, replacing any prior values.
452        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
453            self.0.options = v.into();
454            self
455        }
456
457        /// Sends the request.
458        ///
459        /// # Long running operations
460        ///
461        /// This starts, but does not poll, a longrunning operation. More information
462        /// on [update_service_connection_map][crate::client::CrossNetworkAutomationService::update_service_connection_map].
463        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
464            (*self.0.stub)
465                .update_service_connection_map(self.0.request, self.0.options)
466                .await
467                .map(crate::Response::into_body)
468        }
469
470        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_service_connection_map`.
471        pub fn poller(
472            self,
473        ) -> impl google_cloud_lro::Poller<
474            crate::model::ServiceConnectionMap,
475            crate::model::OperationMetadata,
476        > {
477            type Operation = google_cloud_lro::internal::Operation<
478                crate::model::ServiceConnectionMap,
479                crate::model::OperationMetadata,
480            >;
481            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
482            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
483
484            let stub = self.0.stub.clone();
485            let mut options = self.0.options.clone();
486            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
487            let query = move |name| {
488                let stub = stub.clone();
489                let options = options.clone();
490                async {
491                    let op = GetOperation::new(stub)
492                        .set_name(name)
493                        .with_options(options)
494                        .send()
495                        .await?;
496                    Ok(Operation::new(op))
497                }
498            };
499
500            let start = move || async {
501                let op = self.send().await?;
502                Ok(Operation::new(op))
503            };
504
505            google_cloud_lro::internal::new_poller(
506                polling_error_policy,
507                polling_backoff_policy,
508                start,
509                query,
510            )
511        }
512
513        /// Sets the value of [update_mask][crate::model::UpdateServiceConnectionMapRequest::update_mask].
514        pub fn set_update_mask<T>(mut self, v: T) -> Self
515        where
516            T: std::convert::Into<wkt::FieldMask>,
517        {
518            self.0.request.update_mask = std::option::Option::Some(v.into());
519            self
520        }
521
522        /// Sets or clears the value of [update_mask][crate::model::UpdateServiceConnectionMapRequest::update_mask].
523        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
524        where
525            T: std::convert::Into<wkt::FieldMask>,
526        {
527            self.0.request.update_mask = v.map(|x| x.into());
528            self
529        }
530
531        /// Sets the value of [service_connection_map][crate::model::UpdateServiceConnectionMapRequest::service_connection_map].
532        ///
533        /// This is a **required** field for requests.
534        pub fn set_service_connection_map<T>(mut self, v: T) -> Self
535        where
536            T: std::convert::Into<crate::model::ServiceConnectionMap>,
537        {
538            self.0.request.service_connection_map = std::option::Option::Some(v.into());
539            self
540        }
541
542        /// Sets or clears the value of [service_connection_map][crate::model::UpdateServiceConnectionMapRequest::service_connection_map].
543        ///
544        /// This is a **required** field for requests.
545        pub fn set_or_clear_service_connection_map<T>(mut self, v: std::option::Option<T>) -> Self
546        where
547            T: std::convert::Into<crate::model::ServiceConnectionMap>,
548        {
549            self.0.request.service_connection_map = v.map(|x| x.into());
550            self
551        }
552
553        /// Sets the value of [request_id][crate::model::UpdateServiceConnectionMapRequest::request_id].
554        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
555            self.0.request.request_id = v.into();
556            self
557        }
558    }
559
560    #[doc(hidden)]
561    impl crate::RequestBuilder for UpdateServiceConnectionMap {
562        fn request_options(&mut self) -> &mut crate::RequestOptions {
563            &mut self.0.options
564        }
565    }
566
567    /// The request builder for [CrossNetworkAutomationService::delete_service_connection_map][crate::client::CrossNetworkAutomationService::delete_service_connection_map] calls.
568    ///
569    /// # Example
570    /// ```
571    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::DeleteServiceConnectionMap;
572    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
573    /// use google_cloud_lro::Poller;
574    ///
575    /// let builder = prepare_request_builder();
576    /// let response = builder.poller().until_done().await?;
577    /// # Ok(()) }
578    ///
579    /// fn prepare_request_builder() -> DeleteServiceConnectionMap {
580    ///   # panic!();
581    ///   // ... details omitted ...
582    /// }
583    /// ```
584    #[derive(Clone, Debug)]
585    pub struct DeleteServiceConnectionMap(
586        RequestBuilder<crate::model::DeleteServiceConnectionMapRequest>,
587    );
588
589    impl DeleteServiceConnectionMap {
590        pub(crate) fn new(
591            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
592        ) -> Self {
593            Self(RequestBuilder::new(stub))
594        }
595
596        /// Sets the full request, replacing any prior values.
597        pub fn with_request<V: Into<crate::model::DeleteServiceConnectionMapRequest>>(
598            mut self,
599            v: V,
600        ) -> Self {
601            self.0.request = v.into();
602            self
603        }
604
605        /// Sets all the options, replacing any prior values.
606        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
607            self.0.options = v.into();
608            self
609        }
610
611        /// Sends the request.
612        ///
613        /// # Long running operations
614        ///
615        /// This starts, but does not poll, a longrunning operation. More information
616        /// on [delete_service_connection_map][crate::client::CrossNetworkAutomationService::delete_service_connection_map].
617        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
618            (*self.0.stub)
619                .delete_service_connection_map(self.0.request, self.0.options)
620                .await
621                .map(crate::Response::into_body)
622        }
623
624        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_service_connection_map`.
625        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
626            type Operation =
627                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
628            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
629            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
630
631            let stub = self.0.stub.clone();
632            let mut options = self.0.options.clone();
633            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
634            let query = move |name| {
635                let stub = stub.clone();
636                let options = options.clone();
637                async {
638                    let op = GetOperation::new(stub)
639                        .set_name(name)
640                        .with_options(options)
641                        .send()
642                        .await?;
643                    Ok(Operation::new(op))
644                }
645            };
646
647            let start = move || async {
648                let op = self.send().await?;
649                Ok(Operation::new(op))
650            };
651
652            google_cloud_lro::internal::new_unit_response_poller(
653                polling_error_policy,
654                polling_backoff_policy,
655                start,
656                query,
657            )
658        }
659
660        /// Sets the value of [name][crate::model::DeleteServiceConnectionMapRequest::name].
661        ///
662        /// This is a **required** field for requests.
663        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
664            self.0.request.name = v.into();
665            self
666        }
667
668        /// Sets the value of [request_id][crate::model::DeleteServiceConnectionMapRequest::request_id].
669        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
670            self.0.request.request_id = v.into();
671            self
672        }
673
674        /// Sets the value of [etag][crate::model::DeleteServiceConnectionMapRequest::etag].
675        pub fn set_etag<T>(mut self, v: T) -> Self
676        where
677            T: std::convert::Into<std::string::String>,
678        {
679            self.0.request.etag = std::option::Option::Some(v.into());
680            self
681        }
682
683        /// Sets or clears the value of [etag][crate::model::DeleteServiceConnectionMapRequest::etag].
684        pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
685        where
686            T: std::convert::Into<std::string::String>,
687        {
688            self.0.request.etag = v.map(|x| x.into());
689            self
690        }
691    }
692
693    #[doc(hidden)]
694    impl crate::RequestBuilder for DeleteServiceConnectionMap {
695        fn request_options(&mut self) -> &mut crate::RequestOptions {
696            &mut self.0.options
697        }
698    }
699
700    /// The request builder for [CrossNetworkAutomationService::list_service_connection_policies][crate::client::CrossNetworkAutomationService::list_service_connection_policies] calls.
701    ///
702    /// # Example
703    /// ```
704    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::ListServiceConnectionPolicies;
705    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
706    /// use google_cloud_gax::paginator::ItemPaginator;
707    ///
708    /// let builder = prepare_request_builder();
709    /// let mut items = builder.by_item();
710    /// while let Some(result) = items.next().await {
711    ///   let item = result?;
712    /// }
713    /// # Ok(()) }
714    ///
715    /// fn prepare_request_builder() -> ListServiceConnectionPolicies {
716    ///   # panic!();
717    ///   // ... details omitted ...
718    /// }
719    /// ```
720    #[derive(Clone, Debug)]
721    pub struct ListServiceConnectionPolicies(
722        RequestBuilder<crate::model::ListServiceConnectionPoliciesRequest>,
723    );
724
725    impl ListServiceConnectionPolicies {
726        pub(crate) fn new(
727            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
728        ) -> Self {
729            Self(RequestBuilder::new(stub))
730        }
731
732        /// Sets the full request, replacing any prior values.
733        pub fn with_request<V: Into<crate::model::ListServiceConnectionPoliciesRequest>>(
734            mut self,
735            v: V,
736        ) -> Self {
737            self.0.request = v.into();
738            self
739        }
740
741        /// Sets all the options, replacing any prior values.
742        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
743            self.0.options = v.into();
744            self
745        }
746
747        /// Sends the request.
748        pub async fn send(self) -> Result<crate::model::ListServiceConnectionPoliciesResponse> {
749            (*self.0.stub)
750                .list_service_connection_policies(self.0.request, self.0.options)
751                .await
752                .map(crate::Response::into_body)
753        }
754
755        /// Streams each page in the collection.
756        pub fn by_page(
757            self,
758        ) -> impl google_cloud_gax::paginator::Paginator<
759            crate::model::ListServiceConnectionPoliciesResponse,
760            crate::Error,
761        > {
762            use std::clone::Clone;
763            let token = self.0.request.page_token.clone();
764            let execute = move |token: String| {
765                let mut builder = self.clone();
766                builder.0.request = builder.0.request.set_page_token(token);
767                builder.send()
768            };
769            google_cloud_gax::paginator::internal::new_paginator(token, execute)
770        }
771
772        /// Streams each item in the collection.
773        pub fn by_item(
774            self,
775        ) -> impl google_cloud_gax::paginator::ItemPaginator<
776            crate::model::ListServiceConnectionPoliciesResponse,
777            crate::Error,
778        > {
779            use google_cloud_gax::paginator::Paginator;
780            self.by_page().items()
781        }
782
783        /// Sets the value of [parent][crate::model::ListServiceConnectionPoliciesRequest::parent].
784        ///
785        /// This is a **required** field for requests.
786        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
787            self.0.request.parent = v.into();
788            self
789        }
790
791        /// Sets the value of [page_size][crate::model::ListServiceConnectionPoliciesRequest::page_size].
792        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
793            self.0.request.page_size = v.into();
794            self
795        }
796
797        /// Sets the value of [page_token][crate::model::ListServiceConnectionPoliciesRequest::page_token].
798        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
799            self.0.request.page_token = v.into();
800            self
801        }
802
803        /// Sets the value of [filter][crate::model::ListServiceConnectionPoliciesRequest::filter].
804        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
805            self.0.request.filter = v.into();
806            self
807        }
808
809        /// Sets the value of [order_by][crate::model::ListServiceConnectionPoliciesRequest::order_by].
810        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
811            self.0.request.order_by = v.into();
812            self
813        }
814    }
815
816    #[doc(hidden)]
817    impl crate::RequestBuilder for ListServiceConnectionPolicies {
818        fn request_options(&mut self) -> &mut crate::RequestOptions {
819            &mut self.0.options
820        }
821    }
822
823    /// The request builder for [CrossNetworkAutomationService::get_service_connection_policy][crate::client::CrossNetworkAutomationService::get_service_connection_policy] calls.
824    ///
825    /// # Example
826    /// ```
827    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::GetServiceConnectionPolicy;
828    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
829    ///
830    /// let builder = prepare_request_builder();
831    /// let response = builder.send().await?;
832    /// # Ok(()) }
833    ///
834    /// fn prepare_request_builder() -> GetServiceConnectionPolicy {
835    ///   # panic!();
836    ///   // ... details omitted ...
837    /// }
838    /// ```
839    #[derive(Clone, Debug)]
840    pub struct GetServiceConnectionPolicy(
841        RequestBuilder<crate::model::GetServiceConnectionPolicyRequest>,
842    );
843
844    impl GetServiceConnectionPolicy {
845        pub(crate) fn new(
846            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
847        ) -> Self {
848            Self(RequestBuilder::new(stub))
849        }
850
851        /// Sets the full request, replacing any prior values.
852        pub fn with_request<V: Into<crate::model::GetServiceConnectionPolicyRequest>>(
853            mut self,
854            v: V,
855        ) -> Self {
856            self.0.request = v.into();
857            self
858        }
859
860        /// Sets all the options, replacing any prior values.
861        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
862            self.0.options = v.into();
863            self
864        }
865
866        /// Sends the request.
867        pub async fn send(self) -> Result<crate::model::ServiceConnectionPolicy> {
868            (*self.0.stub)
869                .get_service_connection_policy(self.0.request, self.0.options)
870                .await
871                .map(crate::Response::into_body)
872        }
873
874        /// Sets the value of [name][crate::model::GetServiceConnectionPolicyRequest::name].
875        ///
876        /// This is a **required** field for requests.
877        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
878            self.0.request.name = v.into();
879            self
880        }
881    }
882
883    #[doc(hidden)]
884    impl crate::RequestBuilder for GetServiceConnectionPolicy {
885        fn request_options(&mut self) -> &mut crate::RequestOptions {
886            &mut self.0.options
887        }
888    }
889
890    /// The request builder for [CrossNetworkAutomationService::create_service_connection_policy][crate::client::CrossNetworkAutomationService::create_service_connection_policy] calls.
891    ///
892    /// # Example
893    /// ```
894    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::CreateServiceConnectionPolicy;
895    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
896    /// use google_cloud_lro::Poller;
897    ///
898    /// let builder = prepare_request_builder();
899    /// let response = builder.poller().until_done().await?;
900    /// # Ok(()) }
901    ///
902    /// fn prepare_request_builder() -> CreateServiceConnectionPolicy {
903    ///   # panic!();
904    ///   // ... details omitted ...
905    /// }
906    /// ```
907    #[derive(Clone, Debug)]
908    pub struct CreateServiceConnectionPolicy(
909        RequestBuilder<crate::model::CreateServiceConnectionPolicyRequest>,
910    );
911
912    impl CreateServiceConnectionPolicy {
913        pub(crate) fn new(
914            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
915        ) -> Self {
916            Self(RequestBuilder::new(stub))
917        }
918
919        /// Sets the full request, replacing any prior values.
920        pub fn with_request<V: Into<crate::model::CreateServiceConnectionPolicyRequest>>(
921            mut self,
922            v: V,
923        ) -> Self {
924            self.0.request = v.into();
925            self
926        }
927
928        /// Sets all the options, replacing any prior values.
929        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
930            self.0.options = v.into();
931            self
932        }
933
934        /// Sends the request.
935        ///
936        /// # Long running operations
937        ///
938        /// This starts, but does not poll, a longrunning operation. More information
939        /// on [create_service_connection_policy][crate::client::CrossNetworkAutomationService::create_service_connection_policy].
940        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
941            (*self.0.stub)
942                .create_service_connection_policy(self.0.request, self.0.options)
943                .await
944                .map(crate::Response::into_body)
945        }
946
947        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_service_connection_policy`.
948        pub fn poller(
949            self,
950        ) -> impl google_cloud_lro::Poller<
951            crate::model::ServiceConnectionPolicy,
952            crate::model::OperationMetadata,
953        > {
954            type Operation = google_cloud_lro::internal::Operation<
955                crate::model::ServiceConnectionPolicy,
956                crate::model::OperationMetadata,
957            >;
958            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
959            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
960
961            let stub = self.0.stub.clone();
962            let mut options = self.0.options.clone();
963            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
964            let query = move |name| {
965                let stub = stub.clone();
966                let options = options.clone();
967                async {
968                    let op = GetOperation::new(stub)
969                        .set_name(name)
970                        .with_options(options)
971                        .send()
972                        .await?;
973                    Ok(Operation::new(op))
974                }
975            };
976
977            let start = move || async {
978                let op = self.send().await?;
979                Ok(Operation::new(op))
980            };
981
982            google_cloud_lro::internal::new_poller(
983                polling_error_policy,
984                polling_backoff_policy,
985                start,
986                query,
987            )
988        }
989
990        /// Sets the value of [parent][crate::model::CreateServiceConnectionPolicyRequest::parent].
991        ///
992        /// This is a **required** field for requests.
993        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
994            self.0.request.parent = v.into();
995            self
996        }
997
998        /// Sets the value of [service_connection_policy_id][crate::model::CreateServiceConnectionPolicyRequest::service_connection_policy_id].
999        pub fn set_service_connection_policy_id<T: Into<std::string::String>>(
1000            mut self,
1001            v: T,
1002        ) -> Self {
1003            self.0.request.service_connection_policy_id = v.into();
1004            self
1005        }
1006
1007        /// Sets the value of [service_connection_policy][crate::model::CreateServiceConnectionPolicyRequest::service_connection_policy].
1008        ///
1009        /// This is a **required** field for requests.
1010        pub fn set_service_connection_policy<T>(mut self, v: T) -> Self
1011        where
1012            T: std::convert::Into<crate::model::ServiceConnectionPolicy>,
1013        {
1014            self.0.request.service_connection_policy = std::option::Option::Some(v.into());
1015            self
1016        }
1017
1018        /// Sets or clears the value of [service_connection_policy][crate::model::CreateServiceConnectionPolicyRequest::service_connection_policy].
1019        ///
1020        /// This is a **required** field for requests.
1021        pub fn set_or_clear_service_connection_policy<T>(
1022            mut self,
1023            v: std::option::Option<T>,
1024        ) -> Self
1025        where
1026            T: std::convert::Into<crate::model::ServiceConnectionPolicy>,
1027        {
1028            self.0.request.service_connection_policy = v.map(|x| x.into());
1029            self
1030        }
1031
1032        /// Sets the value of [request_id][crate::model::CreateServiceConnectionPolicyRequest::request_id].
1033        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1034            self.0.request.request_id = v.into();
1035            self
1036        }
1037    }
1038
1039    #[doc(hidden)]
1040    impl crate::RequestBuilder for CreateServiceConnectionPolicy {
1041        fn request_options(&mut self) -> &mut crate::RequestOptions {
1042            &mut self.0.options
1043        }
1044    }
1045
1046    /// The request builder for [CrossNetworkAutomationService::update_service_connection_policy][crate::client::CrossNetworkAutomationService::update_service_connection_policy] calls.
1047    ///
1048    /// # Example
1049    /// ```
1050    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::UpdateServiceConnectionPolicy;
1051    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
1052    /// use google_cloud_lro::Poller;
1053    ///
1054    /// let builder = prepare_request_builder();
1055    /// let response = builder.poller().until_done().await?;
1056    /// # Ok(()) }
1057    ///
1058    /// fn prepare_request_builder() -> UpdateServiceConnectionPolicy {
1059    ///   # panic!();
1060    ///   // ... details omitted ...
1061    /// }
1062    /// ```
1063    #[derive(Clone, Debug)]
1064    pub struct UpdateServiceConnectionPolicy(
1065        RequestBuilder<crate::model::UpdateServiceConnectionPolicyRequest>,
1066    );
1067
1068    impl UpdateServiceConnectionPolicy {
1069        pub(crate) fn new(
1070            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1071        ) -> Self {
1072            Self(RequestBuilder::new(stub))
1073        }
1074
1075        /// Sets the full request, replacing any prior values.
1076        pub fn with_request<V: Into<crate::model::UpdateServiceConnectionPolicyRequest>>(
1077            mut self,
1078            v: V,
1079        ) -> Self {
1080            self.0.request = v.into();
1081            self
1082        }
1083
1084        /// Sets all the options, replacing any prior values.
1085        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1086            self.0.options = v.into();
1087            self
1088        }
1089
1090        /// Sends the request.
1091        ///
1092        /// # Long running operations
1093        ///
1094        /// This starts, but does not poll, a longrunning operation. More information
1095        /// on [update_service_connection_policy][crate::client::CrossNetworkAutomationService::update_service_connection_policy].
1096        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1097            (*self.0.stub)
1098                .update_service_connection_policy(self.0.request, self.0.options)
1099                .await
1100                .map(crate::Response::into_body)
1101        }
1102
1103        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_service_connection_policy`.
1104        pub fn poller(
1105            self,
1106        ) -> impl google_cloud_lro::Poller<
1107            crate::model::ServiceConnectionPolicy,
1108            crate::model::OperationMetadata,
1109        > {
1110            type Operation = google_cloud_lro::internal::Operation<
1111                crate::model::ServiceConnectionPolicy,
1112                crate::model::OperationMetadata,
1113            >;
1114            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1115            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1116
1117            let stub = self.0.stub.clone();
1118            let mut options = self.0.options.clone();
1119            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1120            let query = move |name| {
1121                let stub = stub.clone();
1122                let options = options.clone();
1123                async {
1124                    let op = GetOperation::new(stub)
1125                        .set_name(name)
1126                        .with_options(options)
1127                        .send()
1128                        .await?;
1129                    Ok(Operation::new(op))
1130                }
1131            };
1132
1133            let start = move || async {
1134                let op = self.send().await?;
1135                Ok(Operation::new(op))
1136            };
1137
1138            google_cloud_lro::internal::new_poller(
1139                polling_error_policy,
1140                polling_backoff_policy,
1141                start,
1142                query,
1143            )
1144        }
1145
1146        /// Sets the value of [update_mask][crate::model::UpdateServiceConnectionPolicyRequest::update_mask].
1147        pub fn set_update_mask<T>(mut self, v: T) -> Self
1148        where
1149            T: std::convert::Into<wkt::FieldMask>,
1150        {
1151            self.0.request.update_mask = std::option::Option::Some(v.into());
1152            self
1153        }
1154
1155        /// Sets or clears the value of [update_mask][crate::model::UpdateServiceConnectionPolicyRequest::update_mask].
1156        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1157        where
1158            T: std::convert::Into<wkt::FieldMask>,
1159        {
1160            self.0.request.update_mask = v.map(|x| x.into());
1161            self
1162        }
1163
1164        /// Sets the value of [service_connection_policy][crate::model::UpdateServiceConnectionPolicyRequest::service_connection_policy].
1165        ///
1166        /// This is a **required** field for requests.
1167        pub fn set_service_connection_policy<T>(mut self, v: T) -> Self
1168        where
1169            T: std::convert::Into<crate::model::ServiceConnectionPolicy>,
1170        {
1171            self.0.request.service_connection_policy = std::option::Option::Some(v.into());
1172            self
1173        }
1174
1175        /// Sets or clears the value of [service_connection_policy][crate::model::UpdateServiceConnectionPolicyRequest::service_connection_policy].
1176        ///
1177        /// This is a **required** field for requests.
1178        pub fn set_or_clear_service_connection_policy<T>(
1179            mut self,
1180            v: std::option::Option<T>,
1181        ) -> Self
1182        where
1183            T: std::convert::Into<crate::model::ServiceConnectionPolicy>,
1184        {
1185            self.0.request.service_connection_policy = v.map(|x| x.into());
1186            self
1187        }
1188
1189        /// Sets the value of [request_id][crate::model::UpdateServiceConnectionPolicyRequest::request_id].
1190        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1191            self.0.request.request_id = v.into();
1192            self
1193        }
1194    }
1195
1196    #[doc(hidden)]
1197    impl crate::RequestBuilder for UpdateServiceConnectionPolicy {
1198        fn request_options(&mut self) -> &mut crate::RequestOptions {
1199            &mut self.0.options
1200        }
1201    }
1202
1203    /// The request builder for [CrossNetworkAutomationService::delete_service_connection_policy][crate::client::CrossNetworkAutomationService::delete_service_connection_policy] calls.
1204    ///
1205    /// # Example
1206    /// ```
1207    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::DeleteServiceConnectionPolicy;
1208    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
1209    /// use google_cloud_lro::Poller;
1210    ///
1211    /// let builder = prepare_request_builder();
1212    /// let response = builder.poller().until_done().await?;
1213    /// # Ok(()) }
1214    ///
1215    /// fn prepare_request_builder() -> DeleteServiceConnectionPolicy {
1216    ///   # panic!();
1217    ///   // ... details omitted ...
1218    /// }
1219    /// ```
1220    #[derive(Clone, Debug)]
1221    pub struct DeleteServiceConnectionPolicy(
1222        RequestBuilder<crate::model::DeleteServiceConnectionPolicyRequest>,
1223    );
1224
1225    impl DeleteServiceConnectionPolicy {
1226        pub(crate) fn new(
1227            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1228        ) -> Self {
1229            Self(RequestBuilder::new(stub))
1230        }
1231
1232        /// Sets the full request, replacing any prior values.
1233        pub fn with_request<V: Into<crate::model::DeleteServiceConnectionPolicyRequest>>(
1234            mut self,
1235            v: V,
1236        ) -> Self {
1237            self.0.request = v.into();
1238            self
1239        }
1240
1241        /// Sets all the options, replacing any prior values.
1242        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1243            self.0.options = v.into();
1244            self
1245        }
1246
1247        /// Sends the request.
1248        ///
1249        /// # Long running operations
1250        ///
1251        /// This starts, but does not poll, a longrunning operation. More information
1252        /// on [delete_service_connection_policy][crate::client::CrossNetworkAutomationService::delete_service_connection_policy].
1253        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1254            (*self.0.stub)
1255                .delete_service_connection_policy(self.0.request, self.0.options)
1256                .await
1257                .map(crate::Response::into_body)
1258        }
1259
1260        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_service_connection_policy`.
1261        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
1262            type Operation =
1263                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
1264            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1265            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1266
1267            let stub = self.0.stub.clone();
1268            let mut options = self.0.options.clone();
1269            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1270            let query = move |name| {
1271                let stub = stub.clone();
1272                let options = options.clone();
1273                async {
1274                    let op = GetOperation::new(stub)
1275                        .set_name(name)
1276                        .with_options(options)
1277                        .send()
1278                        .await?;
1279                    Ok(Operation::new(op))
1280                }
1281            };
1282
1283            let start = move || async {
1284                let op = self.send().await?;
1285                Ok(Operation::new(op))
1286            };
1287
1288            google_cloud_lro::internal::new_unit_response_poller(
1289                polling_error_policy,
1290                polling_backoff_policy,
1291                start,
1292                query,
1293            )
1294        }
1295
1296        /// Sets the value of [name][crate::model::DeleteServiceConnectionPolicyRequest::name].
1297        ///
1298        /// This is a **required** field for requests.
1299        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1300            self.0.request.name = v.into();
1301            self
1302        }
1303
1304        /// Sets the value of [request_id][crate::model::DeleteServiceConnectionPolicyRequest::request_id].
1305        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1306            self.0.request.request_id = v.into();
1307            self
1308        }
1309
1310        /// Sets the value of [etag][crate::model::DeleteServiceConnectionPolicyRequest::etag].
1311        pub fn set_etag<T>(mut self, v: T) -> Self
1312        where
1313            T: std::convert::Into<std::string::String>,
1314        {
1315            self.0.request.etag = std::option::Option::Some(v.into());
1316            self
1317        }
1318
1319        /// Sets or clears the value of [etag][crate::model::DeleteServiceConnectionPolicyRequest::etag].
1320        pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
1321        where
1322            T: std::convert::Into<std::string::String>,
1323        {
1324            self.0.request.etag = v.map(|x| x.into());
1325            self
1326        }
1327    }
1328
1329    #[doc(hidden)]
1330    impl crate::RequestBuilder for DeleteServiceConnectionPolicy {
1331        fn request_options(&mut self) -> &mut crate::RequestOptions {
1332            &mut self.0.options
1333        }
1334    }
1335
1336    /// The request builder for [CrossNetworkAutomationService::list_service_classes][crate::client::CrossNetworkAutomationService::list_service_classes] calls.
1337    ///
1338    /// # Example
1339    /// ```
1340    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::ListServiceClasses;
1341    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
1342    /// use google_cloud_gax::paginator::ItemPaginator;
1343    ///
1344    /// let builder = prepare_request_builder();
1345    /// let mut items = builder.by_item();
1346    /// while let Some(result) = items.next().await {
1347    ///   let item = result?;
1348    /// }
1349    /// # Ok(()) }
1350    ///
1351    /// fn prepare_request_builder() -> ListServiceClasses {
1352    ///   # panic!();
1353    ///   // ... details omitted ...
1354    /// }
1355    /// ```
1356    #[derive(Clone, Debug)]
1357    pub struct ListServiceClasses(RequestBuilder<crate::model::ListServiceClassesRequest>);
1358
1359    impl ListServiceClasses {
1360        pub(crate) fn new(
1361            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1362        ) -> Self {
1363            Self(RequestBuilder::new(stub))
1364        }
1365
1366        /// Sets the full request, replacing any prior values.
1367        pub fn with_request<V: Into<crate::model::ListServiceClassesRequest>>(
1368            mut self,
1369            v: V,
1370        ) -> Self {
1371            self.0.request = v.into();
1372            self
1373        }
1374
1375        /// Sets all the options, replacing any prior values.
1376        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1377            self.0.options = v.into();
1378            self
1379        }
1380
1381        /// Sends the request.
1382        pub async fn send(self) -> Result<crate::model::ListServiceClassesResponse> {
1383            (*self.0.stub)
1384                .list_service_classes(self.0.request, self.0.options)
1385                .await
1386                .map(crate::Response::into_body)
1387        }
1388
1389        /// Streams each page in the collection.
1390        pub fn by_page(
1391            self,
1392        ) -> impl google_cloud_gax::paginator::Paginator<
1393            crate::model::ListServiceClassesResponse,
1394            crate::Error,
1395        > {
1396            use std::clone::Clone;
1397            let token = self.0.request.page_token.clone();
1398            let execute = move |token: String| {
1399                let mut builder = self.clone();
1400                builder.0.request = builder.0.request.set_page_token(token);
1401                builder.send()
1402            };
1403            google_cloud_gax::paginator::internal::new_paginator(token, execute)
1404        }
1405
1406        /// Streams each item in the collection.
1407        pub fn by_item(
1408            self,
1409        ) -> impl google_cloud_gax::paginator::ItemPaginator<
1410            crate::model::ListServiceClassesResponse,
1411            crate::Error,
1412        > {
1413            use google_cloud_gax::paginator::Paginator;
1414            self.by_page().items()
1415        }
1416
1417        /// Sets the value of [parent][crate::model::ListServiceClassesRequest::parent].
1418        ///
1419        /// This is a **required** field for requests.
1420        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1421            self.0.request.parent = v.into();
1422            self
1423        }
1424
1425        /// Sets the value of [page_size][crate::model::ListServiceClassesRequest::page_size].
1426        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1427            self.0.request.page_size = v.into();
1428            self
1429        }
1430
1431        /// Sets the value of [page_token][crate::model::ListServiceClassesRequest::page_token].
1432        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1433            self.0.request.page_token = v.into();
1434            self
1435        }
1436
1437        /// Sets the value of [filter][crate::model::ListServiceClassesRequest::filter].
1438        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1439            self.0.request.filter = v.into();
1440            self
1441        }
1442
1443        /// Sets the value of [order_by][crate::model::ListServiceClassesRequest::order_by].
1444        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1445            self.0.request.order_by = v.into();
1446            self
1447        }
1448    }
1449
1450    #[doc(hidden)]
1451    impl crate::RequestBuilder for ListServiceClasses {
1452        fn request_options(&mut self) -> &mut crate::RequestOptions {
1453            &mut self.0.options
1454        }
1455    }
1456
1457    /// The request builder for [CrossNetworkAutomationService::get_service_class][crate::client::CrossNetworkAutomationService::get_service_class] calls.
1458    ///
1459    /// # Example
1460    /// ```
1461    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::GetServiceClass;
1462    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
1463    ///
1464    /// let builder = prepare_request_builder();
1465    /// let response = builder.send().await?;
1466    /// # Ok(()) }
1467    ///
1468    /// fn prepare_request_builder() -> GetServiceClass {
1469    ///   # panic!();
1470    ///   // ... details omitted ...
1471    /// }
1472    /// ```
1473    #[derive(Clone, Debug)]
1474    pub struct GetServiceClass(RequestBuilder<crate::model::GetServiceClassRequest>);
1475
1476    impl GetServiceClass {
1477        pub(crate) fn new(
1478            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1479        ) -> Self {
1480            Self(RequestBuilder::new(stub))
1481        }
1482
1483        /// Sets the full request, replacing any prior values.
1484        pub fn with_request<V: Into<crate::model::GetServiceClassRequest>>(mut self, v: V) -> Self {
1485            self.0.request = v.into();
1486            self
1487        }
1488
1489        /// Sets all the options, replacing any prior values.
1490        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1491            self.0.options = v.into();
1492            self
1493        }
1494
1495        /// Sends the request.
1496        pub async fn send(self) -> Result<crate::model::ServiceClass> {
1497            (*self.0.stub)
1498                .get_service_class(self.0.request, self.0.options)
1499                .await
1500                .map(crate::Response::into_body)
1501        }
1502
1503        /// Sets the value of [name][crate::model::GetServiceClassRequest::name].
1504        ///
1505        /// This is a **required** field for requests.
1506        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1507            self.0.request.name = v.into();
1508            self
1509        }
1510    }
1511
1512    #[doc(hidden)]
1513    impl crate::RequestBuilder for GetServiceClass {
1514        fn request_options(&mut self) -> &mut crate::RequestOptions {
1515            &mut self.0.options
1516        }
1517    }
1518
1519    /// The request builder for [CrossNetworkAutomationService::update_service_class][crate::client::CrossNetworkAutomationService::update_service_class] calls.
1520    ///
1521    /// # Example
1522    /// ```
1523    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::UpdateServiceClass;
1524    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
1525    /// use google_cloud_lro::Poller;
1526    ///
1527    /// let builder = prepare_request_builder();
1528    /// let response = builder.poller().until_done().await?;
1529    /// # Ok(()) }
1530    ///
1531    /// fn prepare_request_builder() -> UpdateServiceClass {
1532    ///   # panic!();
1533    ///   // ... details omitted ...
1534    /// }
1535    /// ```
1536    #[derive(Clone, Debug)]
1537    pub struct UpdateServiceClass(RequestBuilder<crate::model::UpdateServiceClassRequest>);
1538
1539    impl UpdateServiceClass {
1540        pub(crate) fn new(
1541            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1542        ) -> Self {
1543            Self(RequestBuilder::new(stub))
1544        }
1545
1546        /// Sets the full request, replacing any prior values.
1547        pub fn with_request<V: Into<crate::model::UpdateServiceClassRequest>>(
1548            mut self,
1549            v: V,
1550        ) -> Self {
1551            self.0.request = v.into();
1552            self
1553        }
1554
1555        /// Sets all the options, replacing any prior values.
1556        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1557            self.0.options = v.into();
1558            self
1559        }
1560
1561        /// Sends the request.
1562        ///
1563        /// # Long running operations
1564        ///
1565        /// This starts, but does not poll, a longrunning operation. More information
1566        /// on [update_service_class][crate::client::CrossNetworkAutomationService::update_service_class].
1567        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1568            (*self.0.stub)
1569                .update_service_class(self.0.request, self.0.options)
1570                .await
1571                .map(crate::Response::into_body)
1572        }
1573
1574        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_service_class`.
1575        pub fn poller(
1576            self,
1577        ) -> impl google_cloud_lro::Poller<crate::model::ServiceClass, crate::model::OperationMetadata>
1578        {
1579            type Operation = google_cloud_lro::internal::Operation<
1580                crate::model::ServiceClass,
1581                crate::model::OperationMetadata,
1582            >;
1583            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1584            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1585
1586            let stub = self.0.stub.clone();
1587            let mut options = self.0.options.clone();
1588            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1589            let query = move |name| {
1590                let stub = stub.clone();
1591                let options = options.clone();
1592                async {
1593                    let op = GetOperation::new(stub)
1594                        .set_name(name)
1595                        .with_options(options)
1596                        .send()
1597                        .await?;
1598                    Ok(Operation::new(op))
1599                }
1600            };
1601
1602            let start = move || async {
1603                let op = self.send().await?;
1604                Ok(Operation::new(op))
1605            };
1606
1607            google_cloud_lro::internal::new_poller(
1608                polling_error_policy,
1609                polling_backoff_policy,
1610                start,
1611                query,
1612            )
1613        }
1614
1615        /// Sets the value of [update_mask][crate::model::UpdateServiceClassRequest::update_mask].
1616        pub fn set_update_mask<T>(mut self, v: T) -> Self
1617        where
1618            T: std::convert::Into<wkt::FieldMask>,
1619        {
1620            self.0.request.update_mask = std::option::Option::Some(v.into());
1621            self
1622        }
1623
1624        /// Sets or clears the value of [update_mask][crate::model::UpdateServiceClassRequest::update_mask].
1625        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1626        where
1627            T: std::convert::Into<wkt::FieldMask>,
1628        {
1629            self.0.request.update_mask = v.map(|x| x.into());
1630            self
1631        }
1632
1633        /// Sets the value of [service_class][crate::model::UpdateServiceClassRequest::service_class].
1634        ///
1635        /// This is a **required** field for requests.
1636        pub fn set_service_class<T>(mut self, v: T) -> Self
1637        where
1638            T: std::convert::Into<crate::model::ServiceClass>,
1639        {
1640            self.0.request.service_class = std::option::Option::Some(v.into());
1641            self
1642        }
1643
1644        /// Sets or clears the value of [service_class][crate::model::UpdateServiceClassRequest::service_class].
1645        ///
1646        /// This is a **required** field for requests.
1647        pub fn set_or_clear_service_class<T>(mut self, v: std::option::Option<T>) -> Self
1648        where
1649            T: std::convert::Into<crate::model::ServiceClass>,
1650        {
1651            self.0.request.service_class = v.map(|x| x.into());
1652            self
1653        }
1654
1655        /// Sets the value of [request_id][crate::model::UpdateServiceClassRequest::request_id].
1656        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1657            self.0.request.request_id = v.into();
1658            self
1659        }
1660    }
1661
1662    #[doc(hidden)]
1663    impl crate::RequestBuilder for UpdateServiceClass {
1664        fn request_options(&mut self) -> &mut crate::RequestOptions {
1665            &mut self.0.options
1666        }
1667    }
1668
1669    /// The request builder for [CrossNetworkAutomationService::delete_service_class][crate::client::CrossNetworkAutomationService::delete_service_class] calls.
1670    ///
1671    /// # Example
1672    /// ```
1673    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::DeleteServiceClass;
1674    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
1675    /// use google_cloud_lro::Poller;
1676    ///
1677    /// let builder = prepare_request_builder();
1678    /// let response = builder.poller().until_done().await?;
1679    /// # Ok(()) }
1680    ///
1681    /// fn prepare_request_builder() -> DeleteServiceClass {
1682    ///   # panic!();
1683    ///   // ... details omitted ...
1684    /// }
1685    /// ```
1686    #[derive(Clone, Debug)]
1687    pub struct DeleteServiceClass(RequestBuilder<crate::model::DeleteServiceClassRequest>);
1688
1689    impl DeleteServiceClass {
1690        pub(crate) fn new(
1691            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1692        ) -> Self {
1693            Self(RequestBuilder::new(stub))
1694        }
1695
1696        /// Sets the full request, replacing any prior values.
1697        pub fn with_request<V: Into<crate::model::DeleteServiceClassRequest>>(
1698            mut self,
1699            v: V,
1700        ) -> Self {
1701            self.0.request = v.into();
1702            self
1703        }
1704
1705        /// Sets all the options, replacing any prior values.
1706        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1707            self.0.options = v.into();
1708            self
1709        }
1710
1711        /// Sends the request.
1712        ///
1713        /// # Long running operations
1714        ///
1715        /// This starts, but does not poll, a longrunning operation. More information
1716        /// on [delete_service_class][crate::client::CrossNetworkAutomationService::delete_service_class].
1717        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1718            (*self.0.stub)
1719                .delete_service_class(self.0.request, self.0.options)
1720                .await
1721                .map(crate::Response::into_body)
1722        }
1723
1724        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_service_class`.
1725        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
1726            type Operation =
1727                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
1728            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1729            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1730
1731            let stub = self.0.stub.clone();
1732            let mut options = self.0.options.clone();
1733            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1734            let query = move |name| {
1735                let stub = stub.clone();
1736                let options = options.clone();
1737                async {
1738                    let op = GetOperation::new(stub)
1739                        .set_name(name)
1740                        .with_options(options)
1741                        .send()
1742                        .await?;
1743                    Ok(Operation::new(op))
1744                }
1745            };
1746
1747            let start = move || async {
1748                let op = self.send().await?;
1749                Ok(Operation::new(op))
1750            };
1751
1752            google_cloud_lro::internal::new_unit_response_poller(
1753                polling_error_policy,
1754                polling_backoff_policy,
1755                start,
1756                query,
1757            )
1758        }
1759
1760        /// Sets the value of [name][crate::model::DeleteServiceClassRequest::name].
1761        ///
1762        /// This is a **required** field for requests.
1763        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1764            self.0.request.name = v.into();
1765            self
1766        }
1767
1768        /// Sets the value of [request_id][crate::model::DeleteServiceClassRequest::request_id].
1769        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1770            self.0.request.request_id = v.into();
1771            self
1772        }
1773
1774        /// Sets the value of [etag][crate::model::DeleteServiceClassRequest::etag].
1775        pub fn set_etag<T>(mut self, v: T) -> Self
1776        where
1777            T: std::convert::Into<std::string::String>,
1778        {
1779            self.0.request.etag = std::option::Option::Some(v.into());
1780            self
1781        }
1782
1783        /// Sets or clears the value of [etag][crate::model::DeleteServiceClassRequest::etag].
1784        pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
1785        where
1786            T: std::convert::Into<std::string::String>,
1787        {
1788            self.0.request.etag = v.map(|x| x.into());
1789            self
1790        }
1791    }
1792
1793    #[doc(hidden)]
1794    impl crate::RequestBuilder for DeleteServiceClass {
1795        fn request_options(&mut self) -> &mut crate::RequestOptions {
1796            &mut self.0.options
1797        }
1798    }
1799
1800    /// The request builder for [CrossNetworkAutomationService::get_service_connection_token][crate::client::CrossNetworkAutomationService::get_service_connection_token] calls.
1801    ///
1802    /// # Example
1803    /// ```
1804    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::GetServiceConnectionToken;
1805    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
1806    ///
1807    /// let builder = prepare_request_builder();
1808    /// let response = builder.send().await?;
1809    /// # Ok(()) }
1810    ///
1811    /// fn prepare_request_builder() -> GetServiceConnectionToken {
1812    ///   # panic!();
1813    ///   // ... details omitted ...
1814    /// }
1815    /// ```
1816    #[derive(Clone, Debug)]
1817    pub struct GetServiceConnectionToken(
1818        RequestBuilder<crate::model::GetServiceConnectionTokenRequest>,
1819    );
1820
1821    impl GetServiceConnectionToken {
1822        pub(crate) fn new(
1823            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1824        ) -> Self {
1825            Self(RequestBuilder::new(stub))
1826        }
1827
1828        /// Sets the full request, replacing any prior values.
1829        pub fn with_request<V: Into<crate::model::GetServiceConnectionTokenRequest>>(
1830            mut self,
1831            v: V,
1832        ) -> Self {
1833            self.0.request = v.into();
1834            self
1835        }
1836
1837        /// Sets all the options, replacing any prior values.
1838        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1839            self.0.options = v.into();
1840            self
1841        }
1842
1843        /// Sends the request.
1844        pub async fn send(self) -> Result<crate::model::ServiceConnectionToken> {
1845            (*self.0.stub)
1846                .get_service_connection_token(self.0.request, self.0.options)
1847                .await
1848                .map(crate::Response::into_body)
1849        }
1850
1851        /// Sets the value of [name][crate::model::GetServiceConnectionTokenRequest::name].
1852        ///
1853        /// This is a **required** field for requests.
1854        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1855            self.0.request.name = v.into();
1856            self
1857        }
1858    }
1859
1860    #[doc(hidden)]
1861    impl crate::RequestBuilder for GetServiceConnectionToken {
1862        fn request_options(&mut self) -> &mut crate::RequestOptions {
1863            &mut self.0.options
1864        }
1865    }
1866
1867    /// The request builder for [CrossNetworkAutomationService::list_service_connection_tokens][crate::client::CrossNetworkAutomationService::list_service_connection_tokens] calls.
1868    ///
1869    /// # Example
1870    /// ```
1871    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::ListServiceConnectionTokens;
1872    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
1873    /// use google_cloud_gax::paginator::ItemPaginator;
1874    ///
1875    /// let builder = prepare_request_builder();
1876    /// let mut items = builder.by_item();
1877    /// while let Some(result) = items.next().await {
1878    ///   let item = result?;
1879    /// }
1880    /// # Ok(()) }
1881    ///
1882    /// fn prepare_request_builder() -> ListServiceConnectionTokens {
1883    ///   # panic!();
1884    ///   // ... details omitted ...
1885    /// }
1886    /// ```
1887    #[derive(Clone, Debug)]
1888    pub struct ListServiceConnectionTokens(
1889        RequestBuilder<crate::model::ListServiceConnectionTokensRequest>,
1890    );
1891
1892    impl ListServiceConnectionTokens {
1893        pub(crate) fn new(
1894            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
1895        ) -> Self {
1896            Self(RequestBuilder::new(stub))
1897        }
1898
1899        /// Sets the full request, replacing any prior values.
1900        pub fn with_request<V: Into<crate::model::ListServiceConnectionTokensRequest>>(
1901            mut self,
1902            v: V,
1903        ) -> Self {
1904            self.0.request = v.into();
1905            self
1906        }
1907
1908        /// Sets all the options, replacing any prior values.
1909        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1910            self.0.options = v.into();
1911            self
1912        }
1913
1914        /// Sends the request.
1915        pub async fn send(self) -> Result<crate::model::ListServiceConnectionTokensResponse> {
1916            (*self.0.stub)
1917                .list_service_connection_tokens(self.0.request, self.0.options)
1918                .await
1919                .map(crate::Response::into_body)
1920        }
1921
1922        /// Streams each page in the collection.
1923        pub fn by_page(
1924            self,
1925        ) -> impl google_cloud_gax::paginator::Paginator<
1926            crate::model::ListServiceConnectionTokensResponse,
1927            crate::Error,
1928        > {
1929            use std::clone::Clone;
1930            let token = self.0.request.page_token.clone();
1931            let execute = move |token: String| {
1932                let mut builder = self.clone();
1933                builder.0.request = builder.0.request.set_page_token(token);
1934                builder.send()
1935            };
1936            google_cloud_gax::paginator::internal::new_paginator(token, execute)
1937        }
1938
1939        /// Streams each item in the collection.
1940        pub fn by_item(
1941            self,
1942        ) -> impl google_cloud_gax::paginator::ItemPaginator<
1943            crate::model::ListServiceConnectionTokensResponse,
1944            crate::Error,
1945        > {
1946            use google_cloud_gax::paginator::Paginator;
1947            self.by_page().items()
1948        }
1949
1950        /// Sets the value of [parent][crate::model::ListServiceConnectionTokensRequest::parent].
1951        ///
1952        /// This is a **required** field for requests.
1953        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1954            self.0.request.parent = v.into();
1955            self
1956        }
1957
1958        /// Sets the value of [page_size][crate::model::ListServiceConnectionTokensRequest::page_size].
1959        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1960            self.0.request.page_size = v.into();
1961            self
1962        }
1963
1964        /// Sets the value of [page_token][crate::model::ListServiceConnectionTokensRequest::page_token].
1965        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1966            self.0.request.page_token = v.into();
1967            self
1968        }
1969
1970        /// Sets the value of [filter][crate::model::ListServiceConnectionTokensRequest::filter].
1971        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1972            self.0.request.filter = v.into();
1973            self
1974        }
1975
1976        /// Sets the value of [order_by][crate::model::ListServiceConnectionTokensRequest::order_by].
1977        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1978            self.0.request.order_by = v.into();
1979            self
1980        }
1981    }
1982
1983    #[doc(hidden)]
1984    impl crate::RequestBuilder for ListServiceConnectionTokens {
1985        fn request_options(&mut self) -> &mut crate::RequestOptions {
1986            &mut self.0.options
1987        }
1988    }
1989
1990    /// The request builder for [CrossNetworkAutomationService::create_service_connection_token][crate::client::CrossNetworkAutomationService::create_service_connection_token] calls.
1991    ///
1992    /// # Example
1993    /// ```
1994    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::CreateServiceConnectionToken;
1995    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
1996    /// use google_cloud_lro::Poller;
1997    ///
1998    /// let builder = prepare_request_builder();
1999    /// let response = builder.poller().until_done().await?;
2000    /// # Ok(()) }
2001    ///
2002    /// fn prepare_request_builder() -> CreateServiceConnectionToken {
2003    ///   # panic!();
2004    ///   // ... details omitted ...
2005    /// }
2006    /// ```
2007    #[derive(Clone, Debug)]
2008    pub struct CreateServiceConnectionToken(
2009        RequestBuilder<crate::model::CreateServiceConnectionTokenRequest>,
2010    );
2011
2012    impl CreateServiceConnectionToken {
2013        pub(crate) fn new(
2014            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2015        ) -> Self {
2016            Self(RequestBuilder::new(stub))
2017        }
2018
2019        /// Sets the full request, replacing any prior values.
2020        pub fn with_request<V: Into<crate::model::CreateServiceConnectionTokenRequest>>(
2021            mut self,
2022            v: V,
2023        ) -> Self {
2024            self.0.request = v.into();
2025            self
2026        }
2027
2028        /// Sets all the options, replacing any prior values.
2029        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2030            self.0.options = v.into();
2031            self
2032        }
2033
2034        /// Sends the request.
2035        ///
2036        /// # Long running operations
2037        ///
2038        /// This starts, but does not poll, a longrunning operation. More information
2039        /// on [create_service_connection_token][crate::client::CrossNetworkAutomationService::create_service_connection_token].
2040        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2041            (*self.0.stub)
2042                .create_service_connection_token(self.0.request, self.0.options)
2043                .await
2044                .map(crate::Response::into_body)
2045        }
2046
2047        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_service_connection_token`.
2048        pub fn poller(
2049            self,
2050        ) -> impl google_cloud_lro::Poller<
2051            crate::model::ServiceConnectionToken,
2052            crate::model::OperationMetadata,
2053        > {
2054            type Operation = google_cloud_lro::internal::Operation<
2055                crate::model::ServiceConnectionToken,
2056                crate::model::OperationMetadata,
2057            >;
2058            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2059            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2060
2061            let stub = self.0.stub.clone();
2062            let mut options = self.0.options.clone();
2063            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2064            let query = move |name| {
2065                let stub = stub.clone();
2066                let options = options.clone();
2067                async {
2068                    let op = GetOperation::new(stub)
2069                        .set_name(name)
2070                        .with_options(options)
2071                        .send()
2072                        .await?;
2073                    Ok(Operation::new(op))
2074                }
2075            };
2076
2077            let start = move || async {
2078                let op = self.send().await?;
2079                Ok(Operation::new(op))
2080            };
2081
2082            google_cloud_lro::internal::new_poller(
2083                polling_error_policy,
2084                polling_backoff_policy,
2085                start,
2086                query,
2087            )
2088        }
2089
2090        /// Sets the value of [parent][crate::model::CreateServiceConnectionTokenRequest::parent].
2091        ///
2092        /// This is a **required** field for requests.
2093        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2094            self.0.request.parent = v.into();
2095            self
2096        }
2097
2098        /// Sets the value of [service_connection_token_id][crate::model::CreateServiceConnectionTokenRequest::service_connection_token_id].
2099        pub fn set_service_connection_token_id<T: Into<std::string::String>>(
2100            mut self,
2101            v: T,
2102        ) -> Self {
2103            self.0.request.service_connection_token_id = v.into();
2104            self
2105        }
2106
2107        /// Sets the value of [service_connection_token][crate::model::CreateServiceConnectionTokenRequest::service_connection_token].
2108        ///
2109        /// This is a **required** field for requests.
2110        pub fn set_service_connection_token<T>(mut self, v: T) -> Self
2111        where
2112            T: std::convert::Into<crate::model::ServiceConnectionToken>,
2113        {
2114            self.0.request.service_connection_token = std::option::Option::Some(v.into());
2115            self
2116        }
2117
2118        /// Sets or clears the value of [service_connection_token][crate::model::CreateServiceConnectionTokenRequest::service_connection_token].
2119        ///
2120        /// This is a **required** field for requests.
2121        pub fn set_or_clear_service_connection_token<T>(mut self, v: std::option::Option<T>) -> Self
2122        where
2123            T: std::convert::Into<crate::model::ServiceConnectionToken>,
2124        {
2125            self.0.request.service_connection_token = v.map(|x| x.into());
2126            self
2127        }
2128
2129        /// Sets the value of [request_id][crate::model::CreateServiceConnectionTokenRequest::request_id].
2130        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2131            self.0.request.request_id = v.into();
2132            self
2133        }
2134    }
2135
2136    #[doc(hidden)]
2137    impl crate::RequestBuilder for CreateServiceConnectionToken {
2138        fn request_options(&mut self) -> &mut crate::RequestOptions {
2139            &mut self.0.options
2140        }
2141    }
2142
2143    /// The request builder for [CrossNetworkAutomationService::delete_service_connection_token][crate::client::CrossNetworkAutomationService::delete_service_connection_token] calls.
2144    ///
2145    /// # Example
2146    /// ```
2147    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::DeleteServiceConnectionToken;
2148    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
2149    /// use google_cloud_lro::Poller;
2150    ///
2151    /// let builder = prepare_request_builder();
2152    /// let response = builder.poller().until_done().await?;
2153    /// # Ok(()) }
2154    ///
2155    /// fn prepare_request_builder() -> DeleteServiceConnectionToken {
2156    ///   # panic!();
2157    ///   // ... details omitted ...
2158    /// }
2159    /// ```
2160    #[derive(Clone, Debug)]
2161    pub struct DeleteServiceConnectionToken(
2162        RequestBuilder<crate::model::DeleteServiceConnectionTokenRequest>,
2163    );
2164
2165    impl DeleteServiceConnectionToken {
2166        pub(crate) fn new(
2167            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2168        ) -> Self {
2169            Self(RequestBuilder::new(stub))
2170        }
2171
2172        /// Sets the full request, replacing any prior values.
2173        pub fn with_request<V: Into<crate::model::DeleteServiceConnectionTokenRequest>>(
2174            mut self,
2175            v: V,
2176        ) -> Self {
2177            self.0.request = v.into();
2178            self
2179        }
2180
2181        /// Sets all the options, replacing any prior values.
2182        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2183            self.0.options = v.into();
2184            self
2185        }
2186
2187        /// Sends the request.
2188        ///
2189        /// # Long running operations
2190        ///
2191        /// This starts, but does not poll, a longrunning operation. More information
2192        /// on [delete_service_connection_token][crate::client::CrossNetworkAutomationService::delete_service_connection_token].
2193        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2194            (*self.0.stub)
2195                .delete_service_connection_token(self.0.request, self.0.options)
2196                .await
2197                .map(crate::Response::into_body)
2198        }
2199
2200        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_service_connection_token`.
2201        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
2202            type Operation =
2203                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2204            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2205            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2206
2207            let stub = self.0.stub.clone();
2208            let mut options = self.0.options.clone();
2209            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2210            let query = move |name| {
2211                let stub = stub.clone();
2212                let options = options.clone();
2213                async {
2214                    let op = GetOperation::new(stub)
2215                        .set_name(name)
2216                        .with_options(options)
2217                        .send()
2218                        .await?;
2219                    Ok(Operation::new(op))
2220                }
2221            };
2222
2223            let start = move || async {
2224                let op = self.send().await?;
2225                Ok(Operation::new(op))
2226            };
2227
2228            google_cloud_lro::internal::new_unit_response_poller(
2229                polling_error_policy,
2230                polling_backoff_policy,
2231                start,
2232                query,
2233            )
2234        }
2235
2236        /// Sets the value of [name][crate::model::DeleteServiceConnectionTokenRequest::name].
2237        ///
2238        /// This is a **required** field for requests.
2239        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2240            self.0.request.name = v.into();
2241            self
2242        }
2243
2244        /// Sets the value of [request_id][crate::model::DeleteServiceConnectionTokenRequest::request_id].
2245        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2246            self.0.request.request_id = v.into();
2247            self
2248        }
2249
2250        /// Sets the value of [etag][crate::model::DeleteServiceConnectionTokenRequest::etag].
2251        pub fn set_etag<T>(mut self, v: T) -> Self
2252        where
2253            T: std::convert::Into<std::string::String>,
2254        {
2255            self.0.request.etag = std::option::Option::Some(v.into());
2256            self
2257        }
2258
2259        /// Sets or clears the value of [etag][crate::model::DeleteServiceConnectionTokenRequest::etag].
2260        pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
2261        where
2262            T: std::convert::Into<std::string::String>,
2263        {
2264            self.0.request.etag = v.map(|x| x.into());
2265            self
2266        }
2267    }
2268
2269    #[doc(hidden)]
2270    impl crate::RequestBuilder for DeleteServiceConnectionToken {
2271        fn request_options(&mut self) -> &mut crate::RequestOptions {
2272            &mut self.0.options
2273        }
2274    }
2275
2276    /// The request builder for [CrossNetworkAutomationService::list_locations][crate::client::CrossNetworkAutomationService::list_locations] calls.
2277    ///
2278    /// # Example
2279    /// ```
2280    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::ListLocations;
2281    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
2282    /// use google_cloud_gax::paginator::ItemPaginator;
2283    ///
2284    /// let builder = prepare_request_builder();
2285    /// let mut items = builder.by_item();
2286    /// while let Some(result) = items.next().await {
2287    ///   let item = result?;
2288    /// }
2289    /// # Ok(()) }
2290    ///
2291    /// fn prepare_request_builder() -> ListLocations {
2292    ///   # panic!();
2293    ///   // ... details omitted ...
2294    /// }
2295    /// ```
2296    #[derive(Clone, Debug)]
2297    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
2298
2299    impl ListLocations {
2300        pub(crate) fn new(
2301            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2302        ) -> Self {
2303            Self(RequestBuilder::new(stub))
2304        }
2305
2306        /// Sets the full request, replacing any prior values.
2307        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
2308            mut self,
2309            v: V,
2310        ) -> Self {
2311            self.0.request = v.into();
2312            self
2313        }
2314
2315        /// Sets all the options, replacing any prior values.
2316        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2317            self.0.options = v.into();
2318            self
2319        }
2320
2321        /// Sends the request.
2322        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
2323            (*self.0.stub)
2324                .list_locations(self.0.request, self.0.options)
2325                .await
2326                .map(crate::Response::into_body)
2327        }
2328
2329        /// Streams each page in the collection.
2330        pub fn by_page(
2331            self,
2332        ) -> impl google_cloud_gax::paginator::Paginator<
2333            google_cloud_location::model::ListLocationsResponse,
2334            crate::Error,
2335        > {
2336            use std::clone::Clone;
2337            let token = self.0.request.page_token.clone();
2338            let execute = move |token: String| {
2339                let mut builder = self.clone();
2340                builder.0.request = builder.0.request.set_page_token(token);
2341                builder.send()
2342            };
2343            google_cloud_gax::paginator::internal::new_paginator(token, execute)
2344        }
2345
2346        /// Streams each item in the collection.
2347        pub fn by_item(
2348            self,
2349        ) -> impl google_cloud_gax::paginator::ItemPaginator<
2350            google_cloud_location::model::ListLocationsResponse,
2351            crate::Error,
2352        > {
2353            use google_cloud_gax::paginator::Paginator;
2354            self.by_page().items()
2355        }
2356
2357        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
2358        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2359            self.0.request.name = v.into();
2360            self
2361        }
2362
2363        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
2364        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2365            self.0.request.filter = v.into();
2366            self
2367        }
2368
2369        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
2370        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2371            self.0.request.page_size = v.into();
2372            self
2373        }
2374
2375        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
2376        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2377            self.0.request.page_token = v.into();
2378            self
2379        }
2380    }
2381
2382    #[doc(hidden)]
2383    impl crate::RequestBuilder for ListLocations {
2384        fn request_options(&mut self) -> &mut crate::RequestOptions {
2385            &mut self.0.options
2386        }
2387    }
2388
2389    /// The request builder for [CrossNetworkAutomationService::get_location][crate::client::CrossNetworkAutomationService::get_location] calls.
2390    ///
2391    /// # Example
2392    /// ```
2393    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::GetLocation;
2394    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
2395    ///
2396    /// let builder = prepare_request_builder();
2397    /// let response = builder.send().await?;
2398    /// # Ok(()) }
2399    ///
2400    /// fn prepare_request_builder() -> GetLocation {
2401    ///   # panic!();
2402    ///   // ... details omitted ...
2403    /// }
2404    /// ```
2405    #[derive(Clone, Debug)]
2406    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
2407
2408    impl GetLocation {
2409        pub(crate) fn new(
2410            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2411        ) -> Self {
2412            Self(RequestBuilder::new(stub))
2413        }
2414
2415        /// Sets the full request, replacing any prior values.
2416        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
2417            mut self,
2418            v: V,
2419        ) -> Self {
2420            self.0.request = v.into();
2421            self
2422        }
2423
2424        /// Sets all the options, replacing any prior values.
2425        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2426            self.0.options = v.into();
2427            self
2428        }
2429
2430        /// Sends the request.
2431        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
2432            (*self.0.stub)
2433                .get_location(self.0.request, self.0.options)
2434                .await
2435                .map(crate::Response::into_body)
2436        }
2437
2438        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
2439        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2440            self.0.request.name = v.into();
2441            self
2442        }
2443    }
2444
2445    #[doc(hidden)]
2446    impl crate::RequestBuilder for GetLocation {
2447        fn request_options(&mut self) -> &mut crate::RequestOptions {
2448            &mut self.0.options
2449        }
2450    }
2451
2452    /// The request builder for [CrossNetworkAutomationService::set_iam_policy][crate::client::CrossNetworkAutomationService::set_iam_policy] calls.
2453    ///
2454    /// # Example
2455    /// ```
2456    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::SetIamPolicy;
2457    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
2458    ///
2459    /// let builder = prepare_request_builder();
2460    /// let response = builder.send().await?;
2461    /// # Ok(()) }
2462    ///
2463    /// fn prepare_request_builder() -> SetIamPolicy {
2464    ///   # panic!();
2465    ///   // ... details omitted ...
2466    /// }
2467    /// ```
2468    #[derive(Clone, Debug)]
2469    pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
2470
2471    impl SetIamPolicy {
2472        pub(crate) fn new(
2473            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2474        ) -> Self {
2475            Self(RequestBuilder::new(stub))
2476        }
2477
2478        /// Sets the full request, replacing any prior values.
2479        pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
2480            mut self,
2481            v: V,
2482        ) -> Self {
2483            self.0.request = v.into();
2484            self
2485        }
2486
2487        /// Sets all the options, replacing any prior values.
2488        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2489            self.0.options = v.into();
2490            self
2491        }
2492
2493        /// Sends the request.
2494        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
2495            (*self.0.stub)
2496                .set_iam_policy(self.0.request, self.0.options)
2497                .await
2498                .map(crate::Response::into_body)
2499        }
2500
2501        /// Sets the value of [resource][google_cloud_iam_v1::model::SetIamPolicyRequest::resource].
2502        ///
2503        /// This is a **required** field for requests.
2504        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2505            self.0.request.resource = v.into();
2506            self
2507        }
2508
2509        /// Sets the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
2510        ///
2511        /// This is a **required** field for requests.
2512        pub fn set_policy<T>(mut self, v: T) -> Self
2513        where
2514            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
2515        {
2516            self.0.request.policy = std::option::Option::Some(v.into());
2517            self
2518        }
2519
2520        /// Sets or clears the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
2521        ///
2522        /// This is a **required** field for requests.
2523        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
2524        where
2525            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
2526        {
2527            self.0.request.policy = v.map(|x| x.into());
2528            self
2529        }
2530
2531        /// Sets the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
2532        pub fn set_update_mask<T>(mut self, v: T) -> Self
2533        where
2534            T: std::convert::Into<wkt::FieldMask>,
2535        {
2536            self.0.request.update_mask = std::option::Option::Some(v.into());
2537            self
2538        }
2539
2540        /// Sets or clears the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
2541        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2542        where
2543            T: std::convert::Into<wkt::FieldMask>,
2544        {
2545            self.0.request.update_mask = v.map(|x| x.into());
2546            self
2547        }
2548    }
2549
2550    #[doc(hidden)]
2551    impl crate::RequestBuilder for SetIamPolicy {
2552        fn request_options(&mut self) -> &mut crate::RequestOptions {
2553            &mut self.0.options
2554        }
2555    }
2556
2557    /// The request builder for [CrossNetworkAutomationService::get_iam_policy][crate::client::CrossNetworkAutomationService::get_iam_policy] calls.
2558    ///
2559    /// # Example
2560    /// ```
2561    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::GetIamPolicy;
2562    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
2563    ///
2564    /// let builder = prepare_request_builder();
2565    /// let response = builder.send().await?;
2566    /// # Ok(()) }
2567    ///
2568    /// fn prepare_request_builder() -> GetIamPolicy {
2569    ///   # panic!();
2570    ///   // ... details omitted ...
2571    /// }
2572    /// ```
2573    #[derive(Clone, Debug)]
2574    pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
2575
2576    impl GetIamPolicy {
2577        pub(crate) fn new(
2578            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2579        ) -> Self {
2580            Self(RequestBuilder::new(stub))
2581        }
2582
2583        /// Sets the full request, replacing any prior values.
2584        pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
2585            mut self,
2586            v: V,
2587        ) -> Self {
2588            self.0.request = v.into();
2589            self
2590        }
2591
2592        /// Sets all the options, replacing any prior values.
2593        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2594            self.0.options = v.into();
2595            self
2596        }
2597
2598        /// Sends the request.
2599        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
2600            (*self.0.stub)
2601                .get_iam_policy(self.0.request, self.0.options)
2602                .await
2603                .map(crate::Response::into_body)
2604        }
2605
2606        /// Sets the value of [resource][google_cloud_iam_v1::model::GetIamPolicyRequest::resource].
2607        ///
2608        /// This is a **required** field for requests.
2609        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2610            self.0.request.resource = v.into();
2611            self
2612        }
2613
2614        /// Sets the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
2615        pub fn set_options<T>(mut self, v: T) -> Self
2616        where
2617            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
2618        {
2619            self.0.request.options = std::option::Option::Some(v.into());
2620            self
2621        }
2622
2623        /// Sets or clears the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
2624        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
2625        where
2626            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
2627        {
2628            self.0.request.options = v.map(|x| x.into());
2629            self
2630        }
2631    }
2632
2633    #[doc(hidden)]
2634    impl crate::RequestBuilder for GetIamPolicy {
2635        fn request_options(&mut self) -> &mut crate::RequestOptions {
2636            &mut self.0.options
2637        }
2638    }
2639
2640    /// The request builder for [CrossNetworkAutomationService::test_iam_permissions][crate::client::CrossNetworkAutomationService::test_iam_permissions] calls.
2641    ///
2642    /// # Example
2643    /// ```
2644    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::TestIamPermissions;
2645    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
2646    ///
2647    /// let builder = prepare_request_builder();
2648    /// let response = builder.send().await?;
2649    /// # Ok(()) }
2650    ///
2651    /// fn prepare_request_builder() -> TestIamPermissions {
2652    ///   # panic!();
2653    ///   // ... details omitted ...
2654    /// }
2655    /// ```
2656    #[derive(Clone, Debug)]
2657    pub struct TestIamPermissions(
2658        RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
2659    );
2660
2661    impl TestIamPermissions {
2662        pub(crate) fn new(
2663            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2664        ) -> Self {
2665            Self(RequestBuilder::new(stub))
2666        }
2667
2668        /// Sets the full request, replacing any prior values.
2669        pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
2670            mut self,
2671            v: V,
2672        ) -> Self {
2673            self.0.request = v.into();
2674            self
2675        }
2676
2677        /// Sets all the options, replacing any prior values.
2678        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2679            self.0.options = v.into();
2680            self
2681        }
2682
2683        /// Sends the request.
2684        pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
2685            (*self.0.stub)
2686                .test_iam_permissions(self.0.request, self.0.options)
2687                .await
2688                .map(crate::Response::into_body)
2689        }
2690
2691        /// Sets the value of [resource][google_cloud_iam_v1::model::TestIamPermissionsRequest::resource].
2692        ///
2693        /// This is a **required** field for requests.
2694        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2695            self.0.request.resource = v.into();
2696            self
2697        }
2698
2699        /// Sets the value of [permissions][google_cloud_iam_v1::model::TestIamPermissionsRequest::permissions].
2700        ///
2701        /// This is a **required** field for requests.
2702        pub fn set_permissions<T, V>(mut self, v: T) -> Self
2703        where
2704            T: std::iter::IntoIterator<Item = V>,
2705            V: std::convert::Into<std::string::String>,
2706        {
2707            use std::iter::Iterator;
2708            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
2709            self
2710        }
2711    }
2712
2713    #[doc(hidden)]
2714    impl crate::RequestBuilder for TestIamPermissions {
2715        fn request_options(&mut self) -> &mut crate::RequestOptions {
2716            &mut self.0.options
2717        }
2718    }
2719
2720    /// The request builder for [CrossNetworkAutomationService::list_operations][crate::client::CrossNetworkAutomationService::list_operations] calls.
2721    ///
2722    /// # Example
2723    /// ```
2724    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::ListOperations;
2725    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
2726    /// use google_cloud_gax::paginator::ItemPaginator;
2727    ///
2728    /// let builder = prepare_request_builder();
2729    /// let mut items = builder.by_item();
2730    /// while let Some(result) = items.next().await {
2731    ///   let item = result?;
2732    /// }
2733    /// # Ok(()) }
2734    ///
2735    /// fn prepare_request_builder() -> ListOperations {
2736    ///   # panic!();
2737    ///   // ... details omitted ...
2738    /// }
2739    /// ```
2740    #[derive(Clone, Debug)]
2741    pub struct ListOperations(
2742        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
2743    );
2744
2745    impl ListOperations {
2746        pub(crate) fn new(
2747            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2748        ) -> Self {
2749            Self(RequestBuilder::new(stub))
2750        }
2751
2752        /// Sets the full request, replacing any prior values.
2753        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
2754            mut self,
2755            v: V,
2756        ) -> Self {
2757            self.0.request = v.into();
2758            self
2759        }
2760
2761        /// Sets all the options, replacing any prior values.
2762        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2763            self.0.options = v.into();
2764            self
2765        }
2766
2767        /// Sends the request.
2768        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
2769            (*self.0.stub)
2770                .list_operations(self.0.request, self.0.options)
2771                .await
2772                .map(crate::Response::into_body)
2773        }
2774
2775        /// Streams each page in the collection.
2776        pub fn by_page(
2777            self,
2778        ) -> impl google_cloud_gax::paginator::Paginator<
2779            google_cloud_longrunning::model::ListOperationsResponse,
2780            crate::Error,
2781        > {
2782            use std::clone::Clone;
2783            let token = self.0.request.page_token.clone();
2784            let execute = move |token: String| {
2785                let mut builder = self.clone();
2786                builder.0.request = builder.0.request.set_page_token(token);
2787                builder.send()
2788            };
2789            google_cloud_gax::paginator::internal::new_paginator(token, execute)
2790        }
2791
2792        /// Streams each item in the collection.
2793        pub fn by_item(
2794            self,
2795        ) -> impl google_cloud_gax::paginator::ItemPaginator<
2796            google_cloud_longrunning::model::ListOperationsResponse,
2797            crate::Error,
2798        > {
2799            use google_cloud_gax::paginator::Paginator;
2800            self.by_page().items()
2801        }
2802
2803        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
2804        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2805            self.0.request.name = v.into();
2806            self
2807        }
2808
2809        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
2810        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2811            self.0.request.filter = v.into();
2812            self
2813        }
2814
2815        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
2816        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2817            self.0.request.page_size = v.into();
2818            self
2819        }
2820
2821        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
2822        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2823            self.0.request.page_token = v.into();
2824            self
2825        }
2826
2827        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
2828        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
2829            self.0.request.return_partial_success = v.into();
2830            self
2831        }
2832    }
2833
2834    #[doc(hidden)]
2835    impl crate::RequestBuilder for ListOperations {
2836        fn request_options(&mut self) -> &mut crate::RequestOptions {
2837            &mut self.0.options
2838        }
2839    }
2840
2841    /// The request builder for [CrossNetworkAutomationService::get_operation][crate::client::CrossNetworkAutomationService::get_operation] calls.
2842    ///
2843    /// # Example
2844    /// ```
2845    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::GetOperation;
2846    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
2847    ///
2848    /// let builder = prepare_request_builder();
2849    /// let response = builder.send().await?;
2850    /// # Ok(()) }
2851    ///
2852    /// fn prepare_request_builder() -> GetOperation {
2853    ///   # panic!();
2854    ///   // ... details omitted ...
2855    /// }
2856    /// ```
2857    #[derive(Clone, Debug)]
2858    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
2859
2860    impl GetOperation {
2861        pub(crate) fn new(
2862            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2863        ) -> Self {
2864            Self(RequestBuilder::new(stub))
2865        }
2866
2867        /// Sets the full request, replacing any prior values.
2868        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
2869            mut self,
2870            v: V,
2871        ) -> Self {
2872            self.0.request = v.into();
2873            self
2874        }
2875
2876        /// Sets all the options, replacing any prior values.
2877        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2878            self.0.options = v.into();
2879            self
2880        }
2881
2882        /// Sends the request.
2883        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2884            (*self.0.stub)
2885                .get_operation(self.0.request, self.0.options)
2886                .await
2887                .map(crate::Response::into_body)
2888        }
2889
2890        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
2891        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2892            self.0.request.name = v.into();
2893            self
2894        }
2895    }
2896
2897    #[doc(hidden)]
2898    impl crate::RequestBuilder for GetOperation {
2899        fn request_options(&mut self) -> &mut crate::RequestOptions {
2900            &mut self.0.options
2901        }
2902    }
2903
2904    /// The request builder for [CrossNetworkAutomationService::delete_operation][crate::client::CrossNetworkAutomationService::delete_operation] calls.
2905    ///
2906    /// # Example
2907    /// ```
2908    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::DeleteOperation;
2909    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
2910    ///
2911    /// let builder = prepare_request_builder();
2912    /// let response = builder.send().await?;
2913    /// # Ok(()) }
2914    ///
2915    /// fn prepare_request_builder() -> DeleteOperation {
2916    ///   # panic!();
2917    ///   // ... details omitted ...
2918    /// }
2919    /// ```
2920    #[derive(Clone, Debug)]
2921    pub struct DeleteOperation(
2922        RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
2923    );
2924
2925    impl DeleteOperation {
2926        pub(crate) fn new(
2927            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2928        ) -> Self {
2929            Self(RequestBuilder::new(stub))
2930        }
2931
2932        /// Sets the full request, replacing any prior values.
2933        pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
2934            mut self,
2935            v: V,
2936        ) -> Self {
2937            self.0.request = v.into();
2938            self
2939        }
2940
2941        /// Sets all the options, replacing any prior values.
2942        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2943            self.0.options = v.into();
2944            self
2945        }
2946
2947        /// Sends the request.
2948        pub async fn send(self) -> Result<()> {
2949            (*self.0.stub)
2950                .delete_operation(self.0.request, self.0.options)
2951                .await
2952                .map(crate::Response::into_body)
2953        }
2954
2955        /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
2956        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2957            self.0.request.name = v.into();
2958            self
2959        }
2960    }
2961
2962    #[doc(hidden)]
2963    impl crate::RequestBuilder for DeleteOperation {
2964        fn request_options(&mut self) -> &mut crate::RequestOptions {
2965            &mut self.0.options
2966        }
2967    }
2968
2969    /// The request builder for [CrossNetworkAutomationService::cancel_operation][crate::client::CrossNetworkAutomationService::cancel_operation] calls.
2970    ///
2971    /// # Example
2972    /// ```
2973    /// # use google_cloud_networkconnectivity_v1::builder::cross_network_automation_service::CancelOperation;
2974    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
2975    ///
2976    /// let builder = prepare_request_builder();
2977    /// let response = builder.send().await?;
2978    /// # Ok(()) }
2979    ///
2980    /// fn prepare_request_builder() -> CancelOperation {
2981    ///   # panic!();
2982    ///   // ... details omitted ...
2983    /// }
2984    /// ```
2985    #[derive(Clone, Debug)]
2986    pub struct CancelOperation(
2987        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
2988    );
2989
2990    impl CancelOperation {
2991        pub(crate) fn new(
2992            stub: std::sync::Arc<dyn super::super::stub::dynamic::CrossNetworkAutomationService>,
2993        ) -> Self {
2994            Self(RequestBuilder::new(stub))
2995        }
2996
2997        /// Sets the full request, replacing any prior values.
2998        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
2999            mut self,
3000            v: V,
3001        ) -> Self {
3002            self.0.request = v.into();
3003            self
3004        }
3005
3006        /// Sets all the options, replacing any prior values.
3007        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3008            self.0.options = v.into();
3009            self
3010        }
3011
3012        /// Sends the request.
3013        pub async fn send(self) -> Result<()> {
3014            (*self.0.stub)
3015                .cancel_operation(self.0.request, self.0.options)
3016                .await
3017                .map(crate::Response::into_body)
3018        }
3019
3020        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
3021        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3022            self.0.request.name = v.into();
3023            self
3024        }
3025    }
3026
3027    #[doc(hidden)]
3028    impl crate::RequestBuilder for CancelOperation {
3029        fn request_options(&mut self) -> &mut crate::RequestOptions {
3030            &mut self.0.options
3031        }
3032    }
3033}
3034
3035pub mod data_transfer_service {
3036    use crate::Result;
3037
3038    /// A builder for [DataTransferService][crate::client::DataTransferService].
3039    ///
3040    /// ```
3041    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
3042    /// # use google_cloud_networkconnectivity_v1::*;
3043    /// # use builder::data_transfer_service::ClientBuilder;
3044    /// # use client::DataTransferService;
3045    /// let builder : ClientBuilder = DataTransferService::builder();
3046    /// let client = builder
3047    ///     .with_endpoint("https://networkconnectivity.googleapis.com")
3048    ///     .build().await?;
3049    /// # Ok(()) }
3050    /// ```
3051    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
3052
3053    pub(crate) mod client {
3054        use super::super::super::client::DataTransferService;
3055        pub struct Factory;
3056        impl crate::ClientFactory for Factory {
3057            type Client = DataTransferService;
3058            type Credentials = gaxi::options::Credentials;
3059            async fn build(
3060                self,
3061                config: gaxi::options::ClientConfig,
3062            ) -> crate::ClientBuilderResult<Self::Client> {
3063                Self::Client::new(config).await
3064            }
3065        }
3066    }
3067
3068    /// Common implementation for [crate::client::DataTransferService] request builders.
3069    #[derive(Clone, Debug)]
3070    pub(crate) struct RequestBuilder<R: std::default::Default> {
3071        stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3072        request: R,
3073        options: crate::RequestOptions,
3074    }
3075
3076    impl<R> RequestBuilder<R>
3077    where
3078        R: std::default::Default,
3079    {
3080        pub(crate) fn new(
3081            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3082        ) -> Self {
3083            Self {
3084                stub,
3085                request: R::default(),
3086                options: crate::RequestOptions::default(),
3087            }
3088        }
3089    }
3090
3091    /// The request builder for [DataTransferService::list_multicloud_data_transfer_configs][crate::client::DataTransferService::list_multicloud_data_transfer_configs] calls.
3092    ///
3093    /// # Example
3094    /// ```
3095    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::ListMulticloudDataTransferConfigs;
3096    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
3097    /// use google_cloud_gax::paginator::ItemPaginator;
3098    ///
3099    /// let builder = prepare_request_builder();
3100    /// let mut items = builder.by_item();
3101    /// while let Some(result) = items.next().await {
3102    ///   let item = result?;
3103    /// }
3104    /// # Ok(()) }
3105    ///
3106    /// fn prepare_request_builder() -> ListMulticloudDataTransferConfigs {
3107    ///   # panic!();
3108    ///   // ... details omitted ...
3109    /// }
3110    /// ```
3111    #[derive(Clone, Debug)]
3112    pub struct ListMulticloudDataTransferConfigs(
3113        RequestBuilder<crate::model::ListMulticloudDataTransferConfigsRequest>,
3114    );
3115
3116    impl ListMulticloudDataTransferConfigs {
3117        pub(crate) fn new(
3118            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3119        ) -> Self {
3120            Self(RequestBuilder::new(stub))
3121        }
3122
3123        /// Sets the full request, replacing any prior values.
3124        pub fn with_request<V: Into<crate::model::ListMulticloudDataTransferConfigsRequest>>(
3125            mut self,
3126            v: V,
3127        ) -> Self {
3128            self.0.request = v.into();
3129            self
3130        }
3131
3132        /// Sets all the options, replacing any prior values.
3133        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3134            self.0.options = v.into();
3135            self
3136        }
3137
3138        /// Sends the request.
3139        pub async fn send(self) -> Result<crate::model::ListMulticloudDataTransferConfigsResponse> {
3140            (*self.0.stub)
3141                .list_multicloud_data_transfer_configs(self.0.request, self.0.options)
3142                .await
3143                .map(crate::Response::into_body)
3144        }
3145
3146        /// Streams each page in the collection.
3147        pub fn by_page(
3148            self,
3149        ) -> impl google_cloud_gax::paginator::Paginator<
3150            crate::model::ListMulticloudDataTransferConfigsResponse,
3151            crate::Error,
3152        > {
3153            use std::clone::Clone;
3154            let token = self.0.request.page_token.clone();
3155            let execute = move |token: String| {
3156                let mut builder = self.clone();
3157                builder.0.request = builder.0.request.set_page_token(token);
3158                builder.send()
3159            };
3160            google_cloud_gax::paginator::internal::new_paginator(token, execute)
3161        }
3162
3163        /// Streams each item in the collection.
3164        pub fn by_item(
3165            self,
3166        ) -> impl google_cloud_gax::paginator::ItemPaginator<
3167            crate::model::ListMulticloudDataTransferConfigsResponse,
3168            crate::Error,
3169        > {
3170            use google_cloud_gax::paginator::Paginator;
3171            self.by_page().items()
3172        }
3173
3174        /// Sets the value of [parent][crate::model::ListMulticloudDataTransferConfigsRequest::parent].
3175        ///
3176        /// This is a **required** field for requests.
3177        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3178            self.0.request.parent = v.into();
3179            self
3180        }
3181
3182        /// Sets the value of [page_size][crate::model::ListMulticloudDataTransferConfigsRequest::page_size].
3183        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3184            self.0.request.page_size = v.into();
3185            self
3186        }
3187
3188        /// Sets the value of [page_token][crate::model::ListMulticloudDataTransferConfigsRequest::page_token].
3189        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3190            self.0.request.page_token = v.into();
3191            self
3192        }
3193
3194        /// Sets the value of [filter][crate::model::ListMulticloudDataTransferConfigsRequest::filter].
3195        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3196            self.0.request.filter = v.into();
3197            self
3198        }
3199
3200        /// Sets the value of [order_by][crate::model::ListMulticloudDataTransferConfigsRequest::order_by].
3201        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3202            self.0.request.order_by = v.into();
3203            self
3204        }
3205
3206        /// Sets the value of [return_partial_success][crate::model::ListMulticloudDataTransferConfigsRequest::return_partial_success].
3207        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
3208            self.0.request.return_partial_success = v.into();
3209            self
3210        }
3211    }
3212
3213    #[doc(hidden)]
3214    impl crate::RequestBuilder for ListMulticloudDataTransferConfigs {
3215        fn request_options(&mut self) -> &mut crate::RequestOptions {
3216            &mut self.0.options
3217        }
3218    }
3219
3220    /// The request builder for [DataTransferService::get_multicloud_data_transfer_config][crate::client::DataTransferService::get_multicloud_data_transfer_config] calls.
3221    ///
3222    /// # Example
3223    /// ```
3224    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::GetMulticloudDataTransferConfig;
3225    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
3226    ///
3227    /// let builder = prepare_request_builder();
3228    /// let response = builder.send().await?;
3229    /// # Ok(()) }
3230    ///
3231    /// fn prepare_request_builder() -> GetMulticloudDataTransferConfig {
3232    ///   # panic!();
3233    ///   // ... details omitted ...
3234    /// }
3235    /// ```
3236    #[derive(Clone, Debug)]
3237    pub struct GetMulticloudDataTransferConfig(
3238        RequestBuilder<crate::model::GetMulticloudDataTransferConfigRequest>,
3239    );
3240
3241    impl GetMulticloudDataTransferConfig {
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::GetMulticloudDataTransferConfigRequest>>(
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<crate::RequestOptions>>(mut self, v: V) -> Self {
3259            self.0.options = v.into();
3260            self
3261        }
3262
3263        /// Sends the request.
3264        pub async fn send(self) -> Result<crate::model::MulticloudDataTransferConfig> {
3265            (*self.0.stub)
3266                .get_multicloud_data_transfer_config(self.0.request, self.0.options)
3267                .await
3268                .map(crate::Response::into_body)
3269        }
3270
3271        /// Sets the value of [name][crate::model::GetMulticloudDataTransferConfigRequest::name].
3272        ///
3273        /// This is a **required** field for requests.
3274        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3275            self.0.request.name = v.into();
3276            self
3277        }
3278    }
3279
3280    #[doc(hidden)]
3281    impl crate::RequestBuilder for GetMulticloudDataTransferConfig {
3282        fn request_options(&mut self) -> &mut crate::RequestOptions {
3283            &mut self.0.options
3284        }
3285    }
3286
3287    /// The request builder for [DataTransferService::create_multicloud_data_transfer_config][crate::client::DataTransferService::create_multicloud_data_transfer_config] calls.
3288    ///
3289    /// # Example
3290    /// ```
3291    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::CreateMulticloudDataTransferConfig;
3292    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
3293    /// use google_cloud_lro::Poller;
3294    ///
3295    /// let builder = prepare_request_builder();
3296    /// let response = builder.poller().until_done().await?;
3297    /// # Ok(()) }
3298    ///
3299    /// fn prepare_request_builder() -> CreateMulticloudDataTransferConfig {
3300    ///   # panic!();
3301    ///   // ... details omitted ...
3302    /// }
3303    /// ```
3304    #[derive(Clone, Debug)]
3305    pub struct CreateMulticloudDataTransferConfig(
3306        RequestBuilder<crate::model::CreateMulticloudDataTransferConfigRequest>,
3307    );
3308
3309    impl CreateMulticloudDataTransferConfig {
3310        pub(crate) fn new(
3311            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3312        ) -> Self {
3313            Self(RequestBuilder::new(stub))
3314        }
3315
3316        /// Sets the full request, replacing any prior values.
3317        pub fn with_request<V: Into<crate::model::CreateMulticloudDataTransferConfigRequest>>(
3318            mut self,
3319            v: V,
3320        ) -> Self {
3321            self.0.request = v.into();
3322            self
3323        }
3324
3325        /// Sets all the options, replacing any prior values.
3326        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3327            self.0.options = v.into();
3328            self
3329        }
3330
3331        /// Sends the request.
3332        ///
3333        /// # Long running operations
3334        ///
3335        /// This starts, but does not poll, a longrunning operation. More information
3336        /// on [create_multicloud_data_transfer_config][crate::client::DataTransferService::create_multicloud_data_transfer_config].
3337        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3338            (*self.0.stub)
3339                .create_multicloud_data_transfer_config(self.0.request, self.0.options)
3340                .await
3341                .map(crate::Response::into_body)
3342        }
3343
3344        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_multicloud_data_transfer_config`.
3345        pub fn poller(
3346            self,
3347        ) -> impl google_cloud_lro::Poller<
3348            crate::model::MulticloudDataTransferConfig,
3349            crate::model::OperationMetadata,
3350        > {
3351            type Operation = google_cloud_lro::internal::Operation<
3352                crate::model::MulticloudDataTransferConfig,
3353                crate::model::OperationMetadata,
3354            >;
3355            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3356            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3357
3358            let stub = self.0.stub.clone();
3359            let mut options = self.0.options.clone();
3360            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3361            let query = move |name| {
3362                let stub = stub.clone();
3363                let options = options.clone();
3364                async {
3365                    let op = GetOperation::new(stub)
3366                        .set_name(name)
3367                        .with_options(options)
3368                        .send()
3369                        .await?;
3370                    Ok(Operation::new(op))
3371                }
3372            };
3373
3374            let start = move || async {
3375                let op = self.send().await?;
3376                Ok(Operation::new(op))
3377            };
3378
3379            google_cloud_lro::internal::new_poller(
3380                polling_error_policy,
3381                polling_backoff_policy,
3382                start,
3383                query,
3384            )
3385        }
3386
3387        /// Sets the value of [parent][crate::model::CreateMulticloudDataTransferConfigRequest::parent].
3388        ///
3389        /// This is a **required** field for requests.
3390        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3391            self.0.request.parent = v.into();
3392            self
3393        }
3394
3395        /// Sets the value of [multicloud_data_transfer_config_id][crate::model::CreateMulticloudDataTransferConfigRequest::multicloud_data_transfer_config_id].
3396        ///
3397        /// This is a **required** field for requests.
3398        pub fn set_multicloud_data_transfer_config_id<T: Into<std::string::String>>(
3399            mut self,
3400            v: T,
3401        ) -> Self {
3402            self.0.request.multicloud_data_transfer_config_id = v.into();
3403            self
3404        }
3405
3406        /// Sets the value of [multicloud_data_transfer_config][crate::model::CreateMulticloudDataTransferConfigRequest::multicloud_data_transfer_config].
3407        ///
3408        /// This is a **required** field for requests.
3409        pub fn set_multicloud_data_transfer_config<T>(mut self, v: T) -> Self
3410        where
3411            T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
3412        {
3413            self.0.request.multicloud_data_transfer_config = std::option::Option::Some(v.into());
3414            self
3415        }
3416
3417        /// Sets or clears the value of [multicloud_data_transfer_config][crate::model::CreateMulticloudDataTransferConfigRequest::multicloud_data_transfer_config].
3418        ///
3419        /// This is a **required** field for requests.
3420        pub fn set_or_clear_multicloud_data_transfer_config<T>(
3421            mut self,
3422            v: std::option::Option<T>,
3423        ) -> Self
3424        where
3425            T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
3426        {
3427            self.0.request.multicloud_data_transfer_config = v.map(|x| x.into());
3428            self
3429        }
3430
3431        /// Sets the value of [request_id][crate::model::CreateMulticloudDataTransferConfigRequest::request_id].
3432        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3433            self.0.request.request_id = v.into();
3434            self
3435        }
3436    }
3437
3438    #[doc(hidden)]
3439    impl crate::RequestBuilder for CreateMulticloudDataTransferConfig {
3440        fn request_options(&mut self) -> &mut crate::RequestOptions {
3441            &mut self.0.options
3442        }
3443    }
3444
3445    /// The request builder for [DataTransferService::update_multicloud_data_transfer_config][crate::client::DataTransferService::update_multicloud_data_transfer_config] calls.
3446    ///
3447    /// # Example
3448    /// ```
3449    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::UpdateMulticloudDataTransferConfig;
3450    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
3451    /// use google_cloud_lro::Poller;
3452    ///
3453    /// let builder = prepare_request_builder();
3454    /// let response = builder.poller().until_done().await?;
3455    /// # Ok(()) }
3456    ///
3457    /// fn prepare_request_builder() -> UpdateMulticloudDataTransferConfig {
3458    ///   # panic!();
3459    ///   // ... details omitted ...
3460    /// }
3461    /// ```
3462    #[derive(Clone, Debug)]
3463    pub struct UpdateMulticloudDataTransferConfig(
3464        RequestBuilder<crate::model::UpdateMulticloudDataTransferConfigRequest>,
3465    );
3466
3467    impl UpdateMulticloudDataTransferConfig {
3468        pub(crate) fn new(
3469            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3470        ) -> Self {
3471            Self(RequestBuilder::new(stub))
3472        }
3473
3474        /// Sets the full request, replacing any prior values.
3475        pub fn with_request<V: Into<crate::model::UpdateMulticloudDataTransferConfigRequest>>(
3476            mut self,
3477            v: V,
3478        ) -> Self {
3479            self.0.request = v.into();
3480            self
3481        }
3482
3483        /// Sets all the options, replacing any prior values.
3484        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3485            self.0.options = v.into();
3486            self
3487        }
3488
3489        /// Sends the request.
3490        ///
3491        /// # Long running operations
3492        ///
3493        /// This starts, but does not poll, a longrunning operation. More information
3494        /// on [update_multicloud_data_transfer_config][crate::client::DataTransferService::update_multicloud_data_transfer_config].
3495        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3496            (*self.0.stub)
3497                .update_multicloud_data_transfer_config(self.0.request, self.0.options)
3498                .await
3499                .map(crate::Response::into_body)
3500        }
3501
3502        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_multicloud_data_transfer_config`.
3503        pub fn poller(
3504            self,
3505        ) -> impl google_cloud_lro::Poller<
3506            crate::model::MulticloudDataTransferConfig,
3507            crate::model::OperationMetadata,
3508        > {
3509            type Operation = google_cloud_lro::internal::Operation<
3510                crate::model::MulticloudDataTransferConfig,
3511                crate::model::OperationMetadata,
3512            >;
3513            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3514            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3515
3516            let stub = self.0.stub.clone();
3517            let mut options = self.0.options.clone();
3518            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3519            let query = move |name| {
3520                let stub = stub.clone();
3521                let options = options.clone();
3522                async {
3523                    let op = GetOperation::new(stub)
3524                        .set_name(name)
3525                        .with_options(options)
3526                        .send()
3527                        .await?;
3528                    Ok(Operation::new(op))
3529                }
3530            };
3531
3532            let start = move || async {
3533                let op = self.send().await?;
3534                Ok(Operation::new(op))
3535            };
3536
3537            google_cloud_lro::internal::new_poller(
3538                polling_error_policy,
3539                polling_backoff_policy,
3540                start,
3541                query,
3542            )
3543        }
3544
3545        /// Sets the value of [update_mask][crate::model::UpdateMulticloudDataTransferConfigRequest::update_mask].
3546        pub fn set_update_mask<T>(mut self, v: T) -> Self
3547        where
3548            T: std::convert::Into<wkt::FieldMask>,
3549        {
3550            self.0.request.update_mask = std::option::Option::Some(v.into());
3551            self
3552        }
3553
3554        /// Sets or clears the value of [update_mask][crate::model::UpdateMulticloudDataTransferConfigRequest::update_mask].
3555        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3556        where
3557            T: std::convert::Into<wkt::FieldMask>,
3558        {
3559            self.0.request.update_mask = v.map(|x| x.into());
3560            self
3561        }
3562
3563        /// Sets the value of [multicloud_data_transfer_config][crate::model::UpdateMulticloudDataTransferConfigRequest::multicloud_data_transfer_config].
3564        ///
3565        /// This is a **required** field for requests.
3566        pub fn set_multicloud_data_transfer_config<T>(mut self, v: T) -> Self
3567        where
3568            T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
3569        {
3570            self.0.request.multicloud_data_transfer_config = std::option::Option::Some(v.into());
3571            self
3572        }
3573
3574        /// Sets or clears the value of [multicloud_data_transfer_config][crate::model::UpdateMulticloudDataTransferConfigRequest::multicloud_data_transfer_config].
3575        ///
3576        /// This is a **required** field for requests.
3577        pub fn set_or_clear_multicloud_data_transfer_config<T>(
3578            mut self,
3579            v: std::option::Option<T>,
3580        ) -> Self
3581        where
3582            T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
3583        {
3584            self.0.request.multicloud_data_transfer_config = v.map(|x| x.into());
3585            self
3586        }
3587
3588        /// Sets the value of [request_id][crate::model::UpdateMulticloudDataTransferConfigRequest::request_id].
3589        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3590            self.0.request.request_id = v.into();
3591            self
3592        }
3593    }
3594
3595    #[doc(hidden)]
3596    impl crate::RequestBuilder for UpdateMulticloudDataTransferConfig {
3597        fn request_options(&mut self) -> &mut crate::RequestOptions {
3598            &mut self.0.options
3599        }
3600    }
3601
3602    /// The request builder for [DataTransferService::delete_multicloud_data_transfer_config][crate::client::DataTransferService::delete_multicloud_data_transfer_config] calls.
3603    ///
3604    /// # Example
3605    /// ```
3606    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::DeleteMulticloudDataTransferConfig;
3607    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
3608    /// use google_cloud_lro::Poller;
3609    ///
3610    /// let builder = prepare_request_builder();
3611    /// let response = builder.poller().until_done().await?;
3612    /// # Ok(()) }
3613    ///
3614    /// fn prepare_request_builder() -> DeleteMulticloudDataTransferConfig {
3615    ///   # panic!();
3616    ///   // ... details omitted ...
3617    /// }
3618    /// ```
3619    #[derive(Clone, Debug)]
3620    pub struct DeleteMulticloudDataTransferConfig(
3621        RequestBuilder<crate::model::DeleteMulticloudDataTransferConfigRequest>,
3622    );
3623
3624    impl DeleteMulticloudDataTransferConfig {
3625        pub(crate) fn new(
3626            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3627        ) -> Self {
3628            Self(RequestBuilder::new(stub))
3629        }
3630
3631        /// Sets the full request, replacing any prior values.
3632        pub fn with_request<V: Into<crate::model::DeleteMulticloudDataTransferConfigRequest>>(
3633            mut self,
3634            v: V,
3635        ) -> Self {
3636            self.0.request = v.into();
3637            self
3638        }
3639
3640        /// Sets all the options, replacing any prior values.
3641        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3642            self.0.options = v.into();
3643            self
3644        }
3645
3646        /// Sends the request.
3647        ///
3648        /// # Long running operations
3649        ///
3650        /// This starts, but does not poll, a longrunning operation. More information
3651        /// on [delete_multicloud_data_transfer_config][crate::client::DataTransferService::delete_multicloud_data_transfer_config].
3652        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3653            (*self.0.stub)
3654                .delete_multicloud_data_transfer_config(self.0.request, self.0.options)
3655                .await
3656                .map(crate::Response::into_body)
3657        }
3658
3659        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_multicloud_data_transfer_config`.
3660        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
3661            type Operation =
3662                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
3663            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3664            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3665
3666            let stub = self.0.stub.clone();
3667            let mut options = self.0.options.clone();
3668            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3669            let query = move |name| {
3670                let stub = stub.clone();
3671                let options = options.clone();
3672                async {
3673                    let op = GetOperation::new(stub)
3674                        .set_name(name)
3675                        .with_options(options)
3676                        .send()
3677                        .await?;
3678                    Ok(Operation::new(op))
3679                }
3680            };
3681
3682            let start = move || async {
3683                let op = self.send().await?;
3684                Ok(Operation::new(op))
3685            };
3686
3687            google_cloud_lro::internal::new_unit_response_poller(
3688                polling_error_policy,
3689                polling_backoff_policy,
3690                start,
3691                query,
3692            )
3693        }
3694
3695        /// Sets the value of [name][crate::model::DeleteMulticloudDataTransferConfigRequest::name].
3696        ///
3697        /// This is a **required** field for requests.
3698        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3699            self.0.request.name = v.into();
3700            self
3701        }
3702
3703        /// Sets the value of [request_id][crate::model::DeleteMulticloudDataTransferConfigRequest::request_id].
3704        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3705            self.0.request.request_id = v.into();
3706            self
3707        }
3708
3709        /// Sets the value of [etag][crate::model::DeleteMulticloudDataTransferConfigRequest::etag].
3710        pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
3711            self.0.request.etag = v.into();
3712            self
3713        }
3714    }
3715
3716    #[doc(hidden)]
3717    impl crate::RequestBuilder for DeleteMulticloudDataTransferConfig {
3718        fn request_options(&mut self) -> &mut crate::RequestOptions {
3719            &mut self.0.options
3720        }
3721    }
3722
3723    /// The request builder for [DataTransferService::list_destinations][crate::client::DataTransferService::list_destinations] calls.
3724    ///
3725    /// # Example
3726    /// ```
3727    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::ListDestinations;
3728    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
3729    /// use google_cloud_gax::paginator::ItemPaginator;
3730    ///
3731    /// let builder = prepare_request_builder();
3732    /// let mut items = builder.by_item();
3733    /// while let Some(result) = items.next().await {
3734    ///   let item = result?;
3735    /// }
3736    /// # Ok(()) }
3737    ///
3738    /// fn prepare_request_builder() -> ListDestinations {
3739    ///   # panic!();
3740    ///   // ... details omitted ...
3741    /// }
3742    /// ```
3743    #[derive(Clone, Debug)]
3744    pub struct ListDestinations(RequestBuilder<crate::model::ListDestinationsRequest>);
3745
3746    impl ListDestinations {
3747        pub(crate) fn new(
3748            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3749        ) -> Self {
3750            Self(RequestBuilder::new(stub))
3751        }
3752
3753        /// Sets the full request, replacing any prior values.
3754        pub fn with_request<V: Into<crate::model::ListDestinationsRequest>>(
3755            mut self,
3756            v: V,
3757        ) -> Self {
3758            self.0.request = v.into();
3759            self
3760        }
3761
3762        /// Sets all the options, replacing any prior values.
3763        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3764            self.0.options = v.into();
3765            self
3766        }
3767
3768        /// Sends the request.
3769        pub async fn send(self) -> Result<crate::model::ListDestinationsResponse> {
3770            (*self.0.stub)
3771                .list_destinations(self.0.request, self.0.options)
3772                .await
3773                .map(crate::Response::into_body)
3774        }
3775
3776        /// Streams each page in the collection.
3777        pub fn by_page(
3778            self,
3779        ) -> impl google_cloud_gax::paginator::Paginator<
3780            crate::model::ListDestinationsResponse,
3781            crate::Error,
3782        > {
3783            use std::clone::Clone;
3784            let token = self.0.request.page_token.clone();
3785            let execute = move |token: String| {
3786                let mut builder = self.clone();
3787                builder.0.request = builder.0.request.set_page_token(token);
3788                builder.send()
3789            };
3790            google_cloud_gax::paginator::internal::new_paginator(token, execute)
3791        }
3792
3793        /// Streams each item in the collection.
3794        pub fn by_item(
3795            self,
3796        ) -> impl google_cloud_gax::paginator::ItemPaginator<
3797            crate::model::ListDestinationsResponse,
3798            crate::Error,
3799        > {
3800            use google_cloud_gax::paginator::Paginator;
3801            self.by_page().items()
3802        }
3803
3804        /// Sets the value of [parent][crate::model::ListDestinationsRequest::parent].
3805        ///
3806        /// This is a **required** field for requests.
3807        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3808            self.0.request.parent = v.into();
3809            self
3810        }
3811
3812        /// Sets the value of [page_size][crate::model::ListDestinationsRequest::page_size].
3813        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3814            self.0.request.page_size = v.into();
3815            self
3816        }
3817
3818        /// Sets the value of [page_token][crate::model::ListDestinationsRequest::page_token].
3819        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3820            self.0.request.page_token = v.into();
3821            self
3822        }
3823
3824        /// Sets the value of [filter][crate::model::ListDestinationsRequest::filter].
3825        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3826            self.0.request.filter = v.into();
3827            self
3828        }
3829
3830        /// Sets the value of [order_by][crate::model::ListDestinationsRequest::order_by].
3831        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3832            self.0.request.order_by = v.into();
3833            self
3834        }
3835
3836        /// Sets the value of [return_partial_success][crate::model::ListDestinationsRequest::return_partial_success].
3837        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
3838            self.0.request.return_partial_success = v.into();
3839            self
3840        }
3841    }
3842
3843    #[doc(hidden)]
3844    impl crate::RequestBuilder for ListDestinations {
3845        fn request_options(&mut self) -> &mut crate::RequestOptions {
3846            &mut self.0.options
3847        }
3848    }
3849
3850    /// The request builder for [DataTransferService::get_destination][crate::client::DataTransferService::get_destination] calls.
3851    ///
3852    /// # Example
3853    /// ```
3854    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::GetDestination;
3855    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
3856    ///
3857    /// let builder = prepare_request_builder();
3858    /// let response = builder.send().await?;
3859    /// # Ok(()) }
3860    ///
3861    /// fn prepare_request_builder() -> GetDestination {
3862    ///   # panic!();
3863    ///   // ... details omitted ...
3864    /// }
3865    /// ```
3866    #[derive(Clone, Debug)]
3867    pub struct GetDestination(RequestBuilder<crate::model::GetDestinationRequest>);
3868
3869    impl GetDestination {
3870        pub(crate) fn new(
3871            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3872        ) -> Self {
3873            Self(RequestBuilder::new(stub))
3874        }
3875
3876        /// Sets the full request, replacing any prior values.
3877        pub fn with_request<V: Into<crate::model::GetDestinationRequest>>(mut self, v: V) -> Self {
3878            self.0.request = v.into();
3879            self
3880        }
3881
3882        /// Sets all the options, replacing any prior values.
3883        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3884            self.0.options = v.into();
3885            self
3886        }
3887
3888        /// Sends the request.
3889        pub async fn send(self) -> Result<crate::model::Destination> {
3890            (*self.0.stub)
3891                .get_destination(self.0.request, self.0.options)
3892                .await
3893                .map(crate::Response::into_body)
3894        }
3895
3896        /// Sets the value of [name][crate::model::GetDestinationRequest::name].
3897        ///
3898        /// This is a **required** field for requests.
3899        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3900            self.0.request.name = v.into();
3901            self
3902        }
3903    }
3904
3905    #[doc(hidden)]
3906    impl crate::RequestBuilder for GetDestination {
3907        fn request_options(&mut self) -> &mut crate::RequestOptions {
3908            &mut self.0.options
3909        }
3910    }
3911
3912    /// The request builder for [DataTransferService::create_destination][crate::client::DataTransferService::create_destination] calls.
3913    ///
3914    /// # Example
3915    /// ```
3916    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::CreateDestination;
3917    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
3918    /// use google_cloud_lro::Poller;
3919    ///
3920    /// let builder = prepare_request_builder();
3921    /// let response = builder.poller().until_done().await?;
3922    /// # Ok(()) }
3923    ///
3924    /// fn prepare_request_builder() -> CreateDestination {
3925    ///   # panic!();
3926    ///   // ... details omitted ...
3927    /// }
3928    /// ```
3929    #[derive(Clone, Debug)]
3930    pub struct CreateDestination(RequestBuilder<crate::model::CreateDestinationRequest>);
3931
3932    impl CreateDestination {
3933        pub(crate) fn new(
3934            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
3935        ) -> Self {
3936            Self(RequestBuilder::new(stub))
3937        }
3938
3939        /// Sets the full request, replacing any prior values.
3940        pub fn with_request<V: Into<crate::model::CreateDestinationRequest>>(
3941            mut self,
3942            v: V,
3943        ) -> Self {
3944            self.0.request = v.into();
3945            self
3946        }
3947
3948        /// Sets all the options, replacing any prior values.
3949        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3950            self.0.options = v.into();
3951            self
3952        }
3953
3954        /// Sends the request.
3955        ///
3956        /// # Long running operations
3957        ///
3958        /// This starts, but does not poll, a longrunning operation. More information
3959        /// on [create_destination][crate::client::DataTransferService::create_destination].
3960        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3961            (*self.0.stub)
3962                .create_destination(self.0.request, self.0.options)
3963                .await
3964                .map(crate::Response::into_body)
3965        }
3966
3967        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_destination`.
3968        pub fn poller(
3969            self,
3970        ) -> impl google_cloud_lro::Poller<crate::model::Destination, crate::model::OperationMetadata>
3971        {
3972            type Operation = google_cloud_lro::internal::Operation<
3973                crate::model::Destination,
3974                crate::model::OperationMetadata,
3975            >;
3976            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3977            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3978
3979            let stub = self.0.stub.clone();
3980            let mut options = self.0.options.clone();
3981            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3982            let query = move |name| {
3983                let stub = stub.clone();
3984                let options = options.clone();
3985                async {
3986                    let op = GetOperation::new(stub)
3987                        .set_name(name)
3988                        .with_options(options)
3989                        .send()
3990                        .await?;
3991                    Ok(Operation::new(op))
3992                }
3993            };
3994
3995            let start = move || async {
3996                let op = self.send().await?;
3997                Ok(Operation::new(op))
3998            };
3999
4000            google_cloud_lro::internal::new_poller(
4001                polling_error_policy,
4002                polling_backoff_policy,
4003                start,
4004                query,
4005            )
4006        }
4007
4008        /// Sets the value of [parent][crate::model::CreateDestinationRequest::parent].
4009        ///
4010        /// This is a **required** field for requests.
4011        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4012            self.0.request.parent = v.into();
4013            self
4014        }
4015
4016        /// Sets the value of [destination_id][crate::model::CreateDestinationRequest::destination_id].
4017        ///
4018        /// This is a **required** field for requests.
4019        pub fn set_destination_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4020            self.0.request.destination_id = v.into();
4021            self
4022        }
4023
4024        /// Sets the value of [destination][crate::model::CreateDestinationRequest::destination].
4025        ///
4026        /// This is a **required** field for requests.
4027        pub fn set_destination<T>(mut self, v: T) -> Self
4028        where
4029            T: std::convert::Into<crate::model::Destination>,
4030        {
4031            self.0.request.destination = std::option::Option::Some(v.into());
4032            self
4033        }
4034
4035        /// Sets or clears the value of [destination][crate::model::CreateDestinationRequest::destination].
4036        ///
4037        /// This is a **required** field for requests.
4038        pub fn set_or_clear_destination<T>(mut self, v: std::option::Option<T>) -> Self
4039        where
4040            T: std::convert::Into<crate::model::Destination>,
4041        {
4042            self.0.request.destination = v.map(|x| x.into());
4043            self
4044        }
4045
4046        /// Sets the value of [request_id][crate::model::CreateDestinationRequest::request_id].
4047        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4048            self.0.request.request_id = v.into();
4049            self
4050        }
4051    }
4052
4053    #[doc(hidden)]
4054    impl crate::RequestBuilder for CreateDestination {
4055        fn request_options(&mut self) -> &mut crate::RequestOptions {
4056            &mut self.0.options
4057        }
4058    }
4059
4060    /// The request builder for [DataTransferService::update_destination][crate::client::DataTransferService::update_destination] calls.
4061    ///
4062    /// # Example
4063    /// ```
4064    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::UpdateDestination;
4065    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
4066    /// use google_cloud_lro::Poller;
4067    ///
4068    /// let builder = prepare_request_builder();
4069    /// let response = builder.poller().until_done().await?;
4070    /// # Ok(()) }
4071    ///
4072    /// fn prepare_request_builder() -> UpdateDestination {
4073    ///   # panic!();
4074    ///   // ... details omitted ...
4075    /// }
4076    /// ```
4077    #[derive(Clone, Debug)]
4078    pub struct UpdateDestination(RequestBuilder<crate::model::UpdateDestinationRequest>);
4079
4080    impl UpdateDestination {
4081        pub(crate) fn new(
4082            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4083        ) -> Self {
4084            Self(RequestBuilder::new(stub))
4085        }
4086
4087        /// Sets the full request, replacing any prior values.
4088        pub fn with_request<V: Into<crate::model::UpdateDestinationRequest>>(
4089            mut self,
4090            v: V,
4091        ) -> Self {
4092            self.0.request = v.into();
4093            self
4094        }
4095
4096        /// Sets all the options, replacing any prior values.
4097        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4098            self.0.options = v.into();
4099            self
4100        }
4101
4102        /// Sends the request.
4103        ///
4104        /// # Long running operations
4105        ///
4106        /// This starts, but does not poll, a longrunning operation. More information
4107        /// on [update_destination][crate::client::DataTransferService::update_destination].
4108        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4109            (*self.0.stub)
4110                .update_destination(self.0.request, self.0.options)
4111                .await
4112                .map(crate::Response::into_body)
4113        }
4114
4115        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_destination`.
4116        pub fn poller(
4117            self,
4118        ) -> impl google_cloud_lro::Poller<crate::model::Destination, crate::model::OperationMetadata>
4119        {
4120            type Operation = google_cloud_lro::internal::Operation<
4121                crate::model::Destination,
4122                crate::model::OperationMetadata,
4123            >;
4124            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4125            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4126
4127            let stub = self.0.stub.clone();
4128            let mut options = self.0.options.clone();
4129            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4130            let query = move |name| {
4131                let stub = stub.clone();
4132                let options = options.clone();
4133                async {
4134                    let op = GetOperation::new(stub)
4135                        .set_name(name)
4136                        .with_options(options)
4137                        .send()
4138                        .await?;
4139                    Ok(Operation::new(op))
4140                }
4141            };
4142
4143            let start = move || async {
4144                let op = self.send().await?;
4145                Ok(Operation::new(op))
4146            };
4147
4148            google_cloud_lro::internal::new_poller(
4149                polling_error_policy,
4150                polling_backoff_policy,
4151                start,
4152                query,
4153            )
4154        }
4155
4156        /// Sets the value of [update_mask][crate::model::UpdateDestinationRequest::update_mask].
4157        pub fn set_update_mask<T>(mut self, v: T) -> Self
4158        where
4159            T: std::convert::Into<wkt::FieldMask>,
4160        {
4161            self.0.request.update_mask = std::option::Option::Some(v.into());
4162            self
4163        }
4164
4165        /// Sets or clears the value of [update_mask][crate::model::UpdateDestinationRequest::update_mask].
4166        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4167        where
4168            T: std::convert::Into<wkt::FieldMask>,
4169        {
4170            self.0.request.update_mask = v.map(|x| x.into());
4171            self
4172        }
4173
4174        /// Sets the value of [destination][crate::model::UpdateDestinationRequest::destination].
4175        ///
4176        /// This is a **required** field for requests.
4177        pub fn set_destination<T>(mut self, v: T) -> Self
4178        where
4179            T: std::convert::Into<crate::model::Destination>,
4180        {
4181            self.0.request.destination = std::option::Option::Some(v.into());
4182            self
4183        }
4184
4185        /// Sets or clears the value of [destination][crate::model::UpdateDestinationRequest::destination].
4186        ///
4187        /// This is a **required** field for requests.
4188        pub fn set_or_clear_destination<T>(mut self, v: std::option::Option<T>) -> Self
4189        where
4190            T: std::convert::Into<crate::model::Destination>,
4191        {
4192            self.0.request.destination = v.map(|x| x.into());
4193            self
4194        }
4195
4196        /// Sets the value of [request_id][crate::model::UpdateDestinationRequest::request_id].
4197        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4198            self.0.request.request_id = v.into();
4199            self
4200        }
4201    }
4202
4203    #[doc(hidden)]
4204    impl crate::RequestBuilder for UpdateDestination {
4205        fn request_options(&mut self) -> &mut crate::RequestOptions {
4206            &mut self.0.options
4207        }
4208    }
4209
4210    /// The request builder for [DataTransferService::delete_destination][crate::client::DataTransferService::delete_destination] calls.
4211    ///
4212    /// # Example
4213    /// ```
4214    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::DeleteDestination;
4215    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
4216    /// use google_cloud_lro::Poller;
4217    ///
4218    /// let builder = prepare_request_builder();
4219    /// let response = builder.poller().until_done().await?;
4220    /// # Ok(()) }
4221    ///
4222    /// fn prepare_request_builder() -> DeleteDestination {
4223    ///   # panic!();
4224    ///   // ... details omitted ...
4225    /// }
4226    /// ```
4227    #[derive(Clone, Debug)]
4228    pub struct DeleteDestination(RequestBuilder<crate::model::DeleteDestinationRequest>);
4229
4230    impl DeleteDestination {
4231        pub(crate) fn new(
4232            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4233        ) -> Self {
4234            Self(RequestBuilder::new(stub))
4235        }
4236
4237        /// Sets the full request, replacing any prior values.
4238        pub fn with_request<V: Into<crate::model::DeleteDestinationRequest>>(
4239            mut self,
4240            v: V,
4241        ) -> Self {
4242            self.0.request = v.into();
4243            self
4244        }
4245
4246        /// Sets all the options, replacing any prior values.
4247        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4248            self.0.options = v.into();
4249            self
4250        }
4251
4252        /// Sends the request.
4253        ///
4254        /// # Long running operations
4255        ///
4256        /// This starts, but does not poll, a longrunning operation. More information
4257        /// on [delete_destination][crate::client::DataTransferService::delete_destination].
4258        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4259            (*self.0.stub)
4260                .delete_destination(self.0.request, self.0.options)
4261                .await
4262                .map(crate::Response::into_body)
4263        }
4264
4265        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_destination`.
4266        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
4267            type Operation =
4268                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
4269            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4270            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4271
4272            let stub = self.0.stub.clone();
4273            let mut options = self.0.options.clone();
4274            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4275            let query = move |name| {
4276                let stub = stub.clone();
4277                let options = options.clone();
4278                async {
4279                    let op = GetOperation::new(stub)
4280                        .set_name(name)
4281                        .with_options(options)
4282                        .send()
4283                        .await?;
4284                    Ok(Operation::new(op))
4285                }
4286            };
4287
4288            let start = move || async {
4289                let op = self.send().await?;
4290                Ok(Operation::new(op))
4291            };
4292
4293            google_cloud_lro::internal::new_unit_response_poller(
4294                polling_error_policy,
4295                polling_backoff_policy,
4296                start,
4297                query,
4298            )
4299        }
4300
4301        /// Sets the value of [name][crate::model::DeleteDestinationRequest::name].
4302        ///
4303        /// This is a **required** field for requests.
4304        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4305            self.0.request.name = v.into();
4306            self
4307        }
4308
4309        /// Sets the value of [request_id][crate::model::DeleteDestinationRequest::request_id].
4310        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4311            self.0.request.request_id = v.into();
4312            self
4313        }
4314
4315        /// Sets the value of [etag][crate::model::DeleteDestinationRequest::etag].
4316        pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
4317            self.0.request.etag = v.into();
4318            self
4319        }
4320    }
4321
4322    #[doc(hidden)]
4323    impl crate::RequestBuilder for DeleteDestination {
4324        fn request_options(&mut self) -> &mut crate::RequestOptions {
4325            &mut self.0.options
4326        }
4327    }
4328
4329    /// The request builder for [DataTransferService::get_multicloud_data_transfer_supported_service][crate::client::DataTransferService::get_multicloud_data_transfer_supported_service] calls.
4330    ///
4331    /// # Example
4332    /// ```
4333    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::GetMulticloudDataTransferSupportedService;
4334    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
4335    ///
4336    /// let builder = prepare_request_builder();
4337    /// let response = builder.send().await?;
4338    /// # Ok(()) }
4339    ///
4340    /// fn prepare_request_builder() -> GetMulticloudDataTransferSupportedService {
4341    ///   # panic!();
4342    ///   // ... details omitted ...
4343    /// }
4344    /// ```
4345    #[derive(Clone, Debug)]
4346    pub struct GetMulticloudDataTransferSupportedService(
4347        RequestBuilder<crate::model::GetMulticloudDataTransferSupportedServiceRequest>,
4348    );
4349
4350    impl GetMulticloudDataTransferSupportedService {
4351        pub(crate) fn new(
4352            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4353        ) -> Self {
4354            Self(RequestBuilder::new(stub))
4355        }
4356
4357        /// Sets the full request, replacing any prior values.
4358        pub fn with_request<
4359            V: Into<crate::model::GetMulticloudDataTransferSupportedServiceRequest>,
4360        >(
4361            mut self,
4362            v: V,
4363        ) -> Self {
4364            self.0.request = v.into();
4365            self
4366        }
4367
4368        /// Sets all the options, replacing any prior values.
4369        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4370            self.0.options = v.into();
4371            self
4372        }
4373
4374        /// Sends the request.
4375        pub async fn send(self) -> Result<crate::model::MulticloudDataTransferSupportedService> {
4376            (*self.0.stub)
4377                .get_multicloud_data_transfer_supported_service(self.0.request, self.0.options)
4378                .await
4379                .map(crate::Response::into_body)
4380        }
4381
4382        /// Sets the value of [name][crate::model::GetMulticloudDataTransferSupportedServiceRequest::name].
4383        ///
4384        /// This is a **required** field for requests.
4385        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4386            self.0.request.name = v.into();
4387            self
4388        }
4389    }
4390
4391    #[doc(hidden)]
4392    impl crate::RequestBuilder for GetMulticloudDataTransferSupportedService {
4393        fn request_options(&mut self) -> &mut crate::RequestOptions {
4394            &mut self.0.options
4395        }
4396    }
4397
4398    /// The request builder for [DataTransferService::list_multicloud_data_transfer_supported_services][crate::client::DataTransferService::list_multicloud_data_transfer_supported_services] calls.
4399    ///
4400    /// # Example
4401    /// ```
4402    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::ListMulticloudDataTransferSupportedServices;
4403    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
4404    /// use google_cloud_gax::paginator::ItemPaginator;
4405    ///
4406    /// let builder = prepare_request_builder();
4407    /// let mut items = builder.by_item();
4408    /// while let Some(result) = items.next().await {
4409    ///   let item = result?;
4410    /// }
4411    /// # Ok(()) }
4412    ///
4413    /// fn prepare_request_builder() -> ListMulticloudDataTransferSupportedServices {
4414    ///   # panic!();
4415    ///   // ... details omitted ...
4416    /// }
4417    /// ```
4418    #[derive(Clone, Debug)]
4419    pub struct ListMulticloudDataTransferSupportedServices(
4420        RequestBuilder<crate::model::ListMulticloudDataTransferSupportedServicesRequest>,
4421    );
4422
4423    impl ListMulticloudDataTransferSupportedServices {
4424        pub(crate) fn new(
4425            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4426        ) -> Self {
4427            Self(RequestBuilder::new(stub))
4428        }
4429
4430        /// Sets the full request, replacing any prior values.
4431        pub fn with_request<
4432            V: Into<crate::model::ListMulticloudDataTransferSupportedServicesRequest>,
4433        >(
4434            mut self,
4435            v: V,
4436        ) -> Self {
4437            self.0.request = v.into();
4438            self
4439        }
4440
4441        /// Sets all the options, replacing any prior values.
4442        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4443            self.0.options = v.into();
4444            self
4445        }
4446
4447        /// Sends the request.
4448        pub async fn send(
4449            self,
4450        ) -> Result<crate::model::ListMulticloudDataTransferSupportedServicesResponse> {
4451            (*self.0.stub)
4452                .list_multicloud_data_transfer_supported_services(self.0.request, self.0.options)
4453                .await
4454                .map(crate::Response::into_body)
4455        }
4456
4457        /// Streams each page in the collection.
4458        pub fn by_page(
4459            self,
4460        ) -> impl google_cloud_gax::paginator::Paginator<
4461            crate::model::ListMulticloudDataTransferSupportedServicesResponse,
4462            crate::Error,
4463        > {
4464            use std::clone::Clone;
4465            let token = self.0.request.page_token.clone();
4466            let execute = move |token: String| {
4467                let mut builder = self.clone();
4468                builder.0.request = builder.0.request.set_page_token(token);
4469                builder.send()
4470            };
4471            google_cloud_gax::paginator::internal::new_paginator(token, execute)
4472        }
4473
4474        /// Streams each item in the collection.
4475        pub fn by_item(
4476            self,
4477        ) -> impl google_cloud_gax::paginator::ItemPaginator<
4478            crate::model::ListMulticloudDataTransferSupportedServicesResponse,
4479            crate::Error,
4480        > {
4481            use google_cloud_gax::paginator::Paginator;
4482            self.by_page().items()
4483        }
4484
4485        /// Sets the value of [parent][crate::model::ListMulticloudDataTransferSupportedServicesRequest::parent].
4486        ///
4487        /// This is a **required** field for requests.
4488        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4489            self.0.request.parent = v.into();
4490            self
4491        }
4492
4493        /// Sets the value of [page_size][crate::model::ListMulticloudDataTransferSupportedServicesRequest::page_size].
4494        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4495            self.0.request.page_size = v.into();
4496            self
4497        }
4498
4499        /// Sets the value of [page_token][crate::model::ListMulticloudDataTransferSupportedServicesRequest::page_token].
4500        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4501            self.0.request.page_token = v.into();
4502            self
4503        }
4504    }
4505
4506    #[doc(hidden)]
4507    impl crate::RequestBuilder for ListMulticloudDataTransferSupportedServices {
4508        fn request_options(&mut self) -> &mut crate::RequestOptions {
4509            &mut self.0.options
4510        }
4511    }
4512
4513    /// The request builder for [DataTransferService::list_locations][crate::client::DataTransferService::list_locations] calls.
4514    ///
4515    /// # Example
4516    /// ```
4517    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::ListLocations;
4518    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
4519    /// use google_cloud_gax::paginator::ItemPaginator;
4520    ///
4521    /// let builder = prepare_request_builder();
4522    /// let mut items = builder.by_item();
4523    /// while let Some(result) = items.next().await {
4524    ///   let item = result?;
4525    /// }
4526    /// # Ok(()) }
4527    ///
4528    /// fn prepare_request_builder() -> ListLocations {
4529    ///   # panic!();
4530    ///   // ... details omitted ...
4531    /// }
4532    /// ```
4533    #[derive(Clone, Debug)]
4534    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
4535
4536    impl ListLocations {
4537        pub(crate) fn new(
4538            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4539        ) -> Self {
4540            Self(RequestBuilder::new(stub))
4541        }
4542
4543        /// Sets the full request, replacing any prior values.
4544        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
4545            mut self,
4546            v: V,
4547        ) -> Self {
4548            self.0.request = v.into();
4549            self
4550        }
4551
4552        /// Sets all the options, replacing any prior values.
4553        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4554            self.0.options = v.into();
4555            self
4556        }
4557
4558        /// Sends the request.
4559        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
4560            (*self.0.stub)
4561                .list_locations(self.0.request, self.0.options)
4562                .await
4563                .map(crate::Response::into_body)
4564        }
4565
4566        /// Streams each page in the collection.
4567        pub fn by_page(
4568            self,
4569        ) -> impl google_cloud_gax::paginator::Paginator<
4570            google_cloud_location::model::ListLocationsResponse,
4571            crate::Error,
4572        > {
4573            use std::clone::Clone;
4574            let token = self.0.request.page_token.clone();
4575            let execute = move |token: String| {
4576                let mut builder = self.clone();
4577                builder.0.request = builder.0.request.set_page_token(token);
4578                builder.send()
4579            };
4580            google_cloud_gax::paginator::internal::new_paginator(token, execute)
4581        }
4582
4583        /// Streams each item in the collection.
4584        pub fn by_item(
4585            self,
4586        ) -> impl google_cloud_gax::paginator::ItemPaginator<
4587            google_cloud_location::model::ListLocationsResponse,
4588            crate::Error,
4589        > {
4590            use google_cloud_gax::paginator::Paginator;
4591            self.by_page().items()
4592        }
4593
4594        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
4595        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4596            self.0.request.name = v.into();
4597            self
4598        }
4599
4600        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
4601        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4602            self.0.request.filter = v.into();
4603            self
4604        }
4605
4606        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
4607        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4608            self.0.request.page_size = v.into();
4609            self
4610        }
4611
4612        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
4613        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4614            self.0.request.page_token = v.into();
4615            self
4616        }
4617    }
4618
4619    #[doc(hidden)]
4620    impl crate::RequestBuilder for ListLocations {
4621        fn request_options(&mut self) -> &mut crate::RequestOptions {
4622            &mut self.0.options
4623        }
4624    }
4625
4626    /// The request builder for [DataTransferService::get_location][crate::client::DataTransferService::get_location] calls.
4627    ///
4628    /// # Example
4629    /// ```
4630    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::GetLocation;
4631    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
4632    ///
4633    /// let builder = prepare_request_builder();
4634    /// let response = builder.send().await?;
4635    /// # Ok(()) }
4636    ///
4637    /// fn prepare_request_builder() -> GetLocation {
4638    ///   # panic!();
4639    ///   // ... details omitted ...
4640    /// }
4641    /// ```
4642    #[derive(Clone, Debug)]
4643    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
4644
4645    impl GetLocation {
4646        pub(crate) fn new(
4647            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4648        ) -> Self {
4649            Self(RequestBuilder::new(stub))
4650        }
4651
4652        /// Sets the full request, replacing any prior values.
4653        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
4654            mut self,
4655            v: V,
4656        ) -> Self {
4657            self.0.request = v.into();
4658            self
4659        }
4660
4661        /// Sets all the options, replacing any prior values.
4662        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4663            self.0.options = v.into();
4664            self
4665        }
4666
4667        /// Sends the request.
4668        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
4669            (*self.0.stub)
4670                .get_location(self.0.request, self.0.options)
4671                .await
4672                .map(crate::Response::into_body)
4673        }
4674
4675        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
4676        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4677            self.0.request.name = v.into();
4678            self
4679        }
4680    }
4681
4682    #[doc(hidden)]
4683    impl crate::RequestBuilder for GetLocation {
4684        fn request_options(&mut self) -> &mut crate::RequestOptions {
4685            &mut self.0.options
4686        }
4687    }
4688
4689    /// The request builder for [DataTransferService::set_iam_policy][crate::client::DataTransferService::set_iam_policy] calls.
4690    ///
4691    /// # Example
4692    /// ```
4693    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::SetIamPolicy;
4694    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
4695    ///
4696    /// let builder = prepare_request_builder();
4697    /// let response = builder.send().await?;
4698    /// # Ok(()) }
4699    ///
4700    /// fn prepare_request_builder() -> SetIamPolicy {
4701    ///   # panic!();
4702    ///   // ... details omitted ...
4703    /// }
4704    /// ```
4705    #[derive(Clone, Debug)]
4706    pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
4707
4708    impl SetIamPolicy {
4709        pub(crate) fn new(
4710            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4711        ) -> Self {
4712            Self(RequestBuilder::new(stub))
4713        }
4714
4715        /// Sets the full request, replacing any prior values.
4716        pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
4717            mut self,
4718            v: V,
4719        ) -> Self {
4720            self.0.request = v.into();
4721            self
4722        }
4723
4724        /// Sets all the options, replacing any prior values.
4725        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4726            self.0.options = v.into();
4727            self
4728        }
4729
4730        /// Sends the request.
4731        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
4732            (*self.0.stub)
4733                .set_iam_policy(self.0.request, self.0.options)
4734                .await
4735                .map(crate::Response::into_body)
4736        }
4737
4738        /// Sets the value of [resource][google_cloud_iam_v1::model::SetIamPolicyRequest::resource].
4739        ///
4740        /// This is a **required** field for requests.
4741        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4742            self.0.request.resource = v.into();
4743            self
4744        }
4745
4746        /// Sets the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
4747        ///
4748        /// This is a **required** field for requests.
4749        pub fn set_policy<T>(mut self, v: T) -> Self
4750        where
4751            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
4752        {
4753            self.0.request.policy = std::option::Option::Some(v.into());
4754            self
4755        }
4756
4757        /// Sets or clears the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
4758        ///
4759        /// This is a **required** field for requests.
4760        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
4761        where
4762            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
4763        {
4764            self.0.request.policy = v.map(|x| x.into());
4765            self
4766        }
4767
4768        /// Sets the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
4769        pub fn set_update_mask<T>(mut self, v: T) -> Self
4770        where
4771            T: std::convert::Into<wkt::FieldMask>,
4772        {
4773            self.0.request.update_mask = std::option::Option::Some(v.into());
4774            self
4775        }
4776
4777        /// Sets or clears the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
4778        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4779        where
4780            T: std::convert::Into<wkt::FieldMask>,
4781        {
4782            self.0.request.update_mask = v.map(|x| x.into());
4783            self
4784        }
4785    }
4786
4787    #[doc(hidden)]
4788    impl crate::RequestBuilder for SetIamPolicy {
4789        fn request_options(&mut self) -> &mut crate::RequestOptions {
4790            &mut self.0.options
4791        }
4792    }
4793
4794    /// The request builder for [DataTransferService::get_iam_policy][crate::client::DataTransferService::get_iam_policy] calls.
4795    ///
4796    /// # Example
4797    /// ```
4798    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::GetIamPolicy;
4799    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
4800    ///
4801    /// let builder = prepare_request_builder();
4802    /// let response = builder.send().await?;
4803    /// # Ok(()) }
4804    ///
4805    /// fn prepare_request_builder() -> GetIamPolicy {
4806    ///   # panic!();
4807    ///   // ... details omitted ...
4808    /// }
4809    /// ```
4810    #[derive(Clone, Debug)]
4811    pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
4812
4813    impl GetIamPolicy {
4814        pub(crate) fn new(
4815            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4816        ) -> Self {
4817            Self(RequestBuilder::new(stub))
4818        }
4819
4820        /// Sets the full request, replacing any prior values.
4821        pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
4822            mut self,
4823            v: V,
4824        ) -> Self {
4825            self.0.request = v.into();
4826            self
4827        }
4828
4829        /// Sets all the options, replacing any prior values.
4830        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4831            self.0.options = v.into();
4832            self
4833        }
4834
4835        /// Sends the request.
4836        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
4837            (*self.0.stub)
4838                .get_iam_policy(self.0.request, self.0.options)
4839                .await
4840                .map(crate::Response::into_body)
4841        }
4842
4843        /// Sets the value of [resource][google_cloud_iam_v1::model::GetIamPolicyRequest::resource].
4844        ///
4845        /// This is a **required** field for requests.
4846        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4847            self.0.request.resource = v.into();
4848            self
4849        }
4850
4851        /// Sets the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
4852        pub fn set_options<T>(mut self, v: T) -> Self
4853        where
4854            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
4855        {
4856            self.0.request.options = std::option::Option::Some(v.into());
4857            self
4858        }
4859
4860        /// Sets or clears the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
4861        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
4862        where
4863            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
4864        {
4865            self.0.request.options = v.map(|x| x.into());
4866            self
4867        }
4868    }
4869
4870    #[doc(hidden)]
4871    impl crate::RequestBuilder for GetIamPolicy {
4872        fn request_options(&mut self) -> &mut crate::RequestOptions {
4873            &mut self.0.options
4874        }
4875    }
4876
4877    /// The request builder for [DataTransferService::test_iam_permissions][crate::client::DataTransferService::test_iam_permissions] calls.
4878    ///
4879    /// # Example
4880    /// ```
4881    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::TestIamPermissions;
4882    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
4883    ///
4884    /// let builder = prepare_request_builder();
4885    /// let response = builder.send().await?;
4886    /// # Ok(()) }
4887    ///
4888    /// fn prepare_request_builder() -> TestIamPermissions {
4889    ///   # panic!();
4890    ///   // ... details omitted ...
4891    /// }
4892    /// ```
4893    #[derive(Clone, Debug)]
4894    pub struct TestIamPermissions(
4895        RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
4896    );
4897
4898    impl TestIamPermissions {
4899        pub(crate) fn new(
4900            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4901        ) -> Self {
4902            Self(RequestBuilder::new(stub))
4903        }
4904
4905        /// Sets the full request, replacing any prior values.
4906        pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
4907            mut self,
4908            v: V,
4909        ) -> Self {
4910            self.0.request = v.into();
4911            self
4912        }
4913
4914        /// Sets all the options, replacing any prior values.
4915        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4916            self.0.options = v.into();
4917            self
4918        }
4919
4920        /// Sends the request.
4921        pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
4922            (*self.0.stub)
4923                .test_iam_permissions(self.0.request, self.0.options)
4924                .await
4925                .map(crate::Response::into_body)
4926        }
4927
4928        /// Sets the value of [resource][google_cloud_iam_v1::model::TestIamPermissionsRequest::resource].
4929        ///
4930        /// This is a **required** field for requests.
4931        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4932            self.0.request.resource = v.into();
4933            self
4934        }
4935
4936        /// Sets the value of [permissions][google_cloud_iam_v1::model::TestIamPermissionsRequest::permissions].
4937        ///
4938        /// This is a **required** field for requests.
4939        pub fn set_permissions<T, V>(mut self, v: T) -> Self
4940        where
4941            T: std::iter::IntoIterator<Item = V>,
4942            V: std::convert::Into<std::string::String>,
4943        {
4944            use std::iter::Iterator;
4945            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
4946            self
4947        }
4948    }
4949
4950    #[doc(hidden)]
4951    impl crate::RequestBuilder for TestIamPermissions {
4952        fn request_options(&mut self) -> &mut crate::RequestOptions {
4953            &mut self.0.options
4954        }
4955    }
4956
4957    /// The request builder for [DataTransferService::list_operations][crate::client::DataTransferService::list_operations] calls.
4958    ///
4959    /// # Example
4960    /// ```
4961    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::ListOperations;
4962    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
4963    /// use google_cloud_gax::paginator::ItemPaginator;
4964    ///
4965    /// let builder = prepare_request_builder();
4966    /// let mut items = builder.by_item();
4967    /// while let Some(result) = items.next().await {
4968    ///   let item = result?;
4969    /// }
4970    /// # Ok(()) }
4971    ///
4972    /// fn prepare_request_builder() -> ListOperations {
4973    ///   # panic!();
4974    ///   // ... details omitted ...
4975    /// }
4976    /// ```
4977    #[derive(Clone, Debug)]
4978    pub struct ListOperations(
4979        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
4980    );
4981
4982    impl ListOperations {
4983        pub(crate) fn new(
4984            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
4985        ) -> Self {
4986            Self(RequestBuilder::new(stub))
4987        }
4988
4989        /// Sets the full request, replacing any prior values.
4990        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
4991            mut self,
4992            v: V,
4993        ) -> Self {
4994            self.0.request = v.into();
4995            self
4996        }
4997
4998        /// Sets all the options, replacing any prior values.
4999        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5000            self.0.options = v.into();
5001            self
5002        }
5003
5004        /// Sends the request.
5005        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
5006            (*self.0.stub)
5007                .list_operations(self.0.request, self.0.options)
5008                .await
5009                .map(crate::Response::into_body)
5010        }
5011
5012        /// Streams each page in the collection.
5013        pub fn by_page(
5014            self,
5015        ) -> impl google_cloud_gax::paginator::Paginator<
5016            google_cloud_longrunning::model::ListOperationsResponse,
5017            crate::Error,
5018        > {
5019            use std::clone::Clone;
5020            let token = self.0.request.page_token.clone();
5021            let execute = move |token: String| {
5022                let mut builder = self.clone();
5023                builder.0.request = builder.0.request.set_page_token(token);
5024                builder.send()
5025            };
5026            google_cloud_gax::paginator::internal::new_paginator(token, execute)
5027        }
5028
5029        /// Streams each item in the collection.
5030        pub fn by_item(
5031            self,
5032        ) -> impl google_cloud_gax::paginator::ItemPaginator<
5033            google_cloud_longrunning::model::ListOperationsResponse,
5034            crate::Error,
5035        > {
5036            use google_cloud_gax::paginator::Paginator;
5037            self.by_page().items()
5038        }
5039
5040        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
5041        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5042            self.0.request.name = v.into();
5043            self
5044        }
5045
5046        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
5047        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5048            self.0.request.filter = v.into();
5049            self
5050        }
5051
5052        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
5053        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5054            self.0.request.page_size = v.into();
5055            self
5056        }
5057
5058        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
5059        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5060            self.0.request.page_token = v.into();
5061            self
5062        }
5063
5064        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
5065        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
5066            self.0.request.return_partial_success = v.into();
5067            self
5068        }
5069    }
5070
5071    #[doc(hidden)]
5072    impl crate::RequestBuilder for ListOperations {
5073        fn request_options(&mut self) -> &mut crate::RequestOptions {
5074            &mut self.0.options
5075        }
5076    }
5077
5078    /// The request builder for [DataTransferService::get_operation][crate::client::DataTransferService::get_operation] calls.
5079    ///
5080    /// # Example
5081    /// ```
5082    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::GetOperation;
5083    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
5084    ///
5085    /// let builder = prepare_request_builder();
5086    /// let response = builder.send().await?;
5087    /// # Ok(()) }
5088    ///
5089    /// fn prepare_request_builder() -> GetOperation {
5090    ///   # panic!();
5091    ///   // ... details omitted ...
5092    /// }
5093    /// ```
5094    #[derive(Clone, Debug)]
5095    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
5096
5097    impl GetOperation {
5098        pub(crate) fn new(
5099            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
5100        ) -> Self {
5101            Self(RequestBuilder::new(stub))
5102        }
5103
5104        /// Sets the full request, replacing any prior values.
5105        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
5106            mut self,
5107            v: V,
5108        ) -> Self {
5109            self.0.request = v.into();
5110            self
5111        }
5112
5113        /// Sets all the options, replacing any prior values.
5114        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5115            self.0.options = v.into();
5116            self
5117        }
5118
5119        /// Sends the request.
5120        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5121            (*self.0.stub)
5122                .get_operation(self.0.request, self.0.options)
5123                .await
5124                .map(crate::Response::into_body)
5125        }
5126
5127        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
5128        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5129            self.0.request.name = v.into();
5130            self
5131        }
5132    }
5133
5134    #[doc(hidden)]
5135    impl crate::RequestBuilder for GetOperation {
5136        fn request_options(&mut self) -> &mut crate::RequestOptions {
5137            &mut self.0.options
5138        }
5139    }
5140
5141    /// The request builder for [DataTransferService::delete_operation][crate::client::DataTransferService::delete_operation] calls.
5142    ///
5143    /// # Example
5144    /// ```
5145    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::DeleteOperation;
5146    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
5147    ///
5148    /// let builder = prepare_request_builder();
5149    /// let response = builder.send().await?;
5150    /// # Ok(()) }
5151    ///
5152    /// fn prepare_request_builder() -> DeleteOperation {
5153    ///   # panic!();
5154    ///   // ... details omitted ...
5155    /// }
5156    /// ```
5157    #[derive(Clone, Debug)]
5158    pub struct DeleteOperation(
5159        RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
5160    );
5161
5162    impl DeleteOperation {
5163        pub(crate) fn new(
5164            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
5165        ) -> Self {
5166            Self(RequestBuilder::new(stub))
5167        }
5168
5169        /// Sets the full request, replacing any prior values.
5170        pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
5171            mut self,
5172            v: V,
5173        ) -> Self {
5174            self.0.request = v.into();
5175            self
5176        }
5177
5178        /// Sets all the options, replacing any prior values.
5179        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5180            self.0.options = v.into();
5181            self
5182        }
5183
5184        /// Sends the request.
5185        pub async fn send(self) -> Result<()> {
5186            (*self.0.stub)
5187                .delete_operation(self.0.request, self.0.options)
5188                .await
5189                .map(crate::Response::into_body)
5190        }
5191
5192        /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
5193        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5194            self.0.request.name = v.into();
5195            self
5196        }
5197    }
5198
5199    #[doc(hidden)]
5200    impl crate::RequestBuilder for DeleteOperation {
5201        fn request_options(&mut self) -> &mut crate::RequestOptions {
5202            &mut self.0.options
5203        }
5204    }
5205
5206    /// The request builder for [DataTransferService::cancel_operation][crate::client::DataTransferService::cancel_operation] calls.
5207    ///
5208    /// # Example
5209    /// ```
5210    /// # use google_cloud_networkconnectivity_v1::builder::data_transfer_service::CancelOperation;
5211    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
5212    ///
5213    /// let builder = prepare_request_builder();
5214    /// let response = builder.send().await?;
5215    /// # Ok(()) }
5216    ///
5217    /// fn prepare_request_builder() -> CancelOperation {
5218    ///   # panic!();
5219    ///   // ... details omitted ...
5220    /// }
5221    /// ```
5222    #[derive(Clone, Debug)]
5223    pub struct CancelOperation(
5224        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
5225    );
5226
5227    impl CancelOperation {
5228        pub(crate) fn new(
5229            stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTransferService>,
5230        ) -> Self {
5231            Self(RequestBuilder::new(stub))
5232        }
5233
5234        /// Sets the full request, replacing any prior values.
5235        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
5236            mut self,
5237            v: V,
5238        ) -> Self {
5239            self.0.request = v.into();
5240            self
5241        }
5242
5243        /// Sets all the options, replacing any prior values.
5244        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5245            self.0.options = v.into();
5246            self
5247        }
5248
5249        /// Sends the request.
5250        pub async fn send(self) -> Result<()> {
5251            (*self.0.stub)
5252                .cancel_operation(self.0.request, self.0.options)
5253                .await
5254                .map(crate::Response::into_body)
5255        }
5256
5257        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
5258        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5259            self.0.request.name = v.into();
5260            self
5261        }
5262    }
5263
5264    #[doc(hidden)]
5265    impl crate::RequestBuilder for CancelOperation {
5266        fn request_options(&mut self) -> &mut crate::RequestOptions {
5267            &mut self.0.options
5268        }
5269    }
5270}
5271
5272pub mod hub_service {
5273    use crate::Result;
5274
5275    /// A builder for [HubService][crate::client::HubService].
5276    ///
5277    /// ```
5278    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
5279    /// # use google_cloud_networkconnectivity_v1::*;
5280    /// # use builder::hub_service::ClientBuilder;
5281    /// # use client::HubService;
5282    /// let builder : ClientBuilder = HubService::builder();
5283    /// let client = builder
5284    ///     .with_endpoint("https://networkconnectivity.googleapis.com")
5285    ///     .build().await?;
5286    /// # Ok(()) }
5287    /// ```
5288    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
5289
5290    pub(crate) mod client {
5291        use super::super::super::client::HubService;
5292        pub struct Factory;
5293        impl crate::ClientFactory for Factory {
5294            type Client = HubService;
5295            type Credentials = gaxi::options::Credentials;
5296            async fn build(
5297                self,
5298                config: gaxi::options::ClientConfig,
5299            ) -> crate::ClientBuilderResult<Self::Client> {
5300                Self::Client::new(config).await
5301            }
5302        }
5303    }
5304
5305    /// Common implementation for [crate::client::HubService] request builders.
5306    #[derive(Clone, Debug)]
5307    pub(crate) struct RequestBuilder<R: std::default::Default> {
5308        stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5309        request: R,
5310        options: crate::RequestOptions,
5311    }
5312
5313    impl<R> RequestBuilder<R>
5314    where
5315        R: std::default::Default,
5316    {
5317        pub(crate) fn new(
5318            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5319        ) -> Self {
5320            Self {
5321                stub,
5322                request: R::default(),
5323                options: crate::RequestOptions::default(),
5324            }
5325        }
5326    }
5327
5328    /// The request builder for [HubService::list_hubs][crate::client::HubService::list_hubs] calls.
5329    ///
5330    /// # Example
5331    /// ```
5332    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::ListHubs;
5333    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
5334    /// use google_cloud_gax::paginator::ItemPaginator;
5335    ///
5336    /// let builder = prepare_request_builder();
5337    /// let mut items = builder.by_item();
5338    /// while let Some(result) = items.next().await {
5339    ///   let item = result?;
5340    /// }
5341    /// # Ok(()) }
5342    ///
5343    /// fn prepare_request_builder() -> ListHubs {
5344    ///   # panic!();
5345    ///   // ... details omitted ...
5346    /// }
5347    /// ```
5348    #[derive(Clone, Debug)]
5349    pub struct ListHubs(RequestBuilder<crate::model::ListHubsRequest>);
5350
5351    impl ListHubs {
5352        pub(crate) fn new(
5353            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5354        ) -> Self {
5355            Self(RequestBuilder::new(stub))
5356        }
5357
5358        /// Sets the full request, replacing any prior values.
5359        pub fn with_request<V: Into<crate::model::ListHubsRequest>>(mut self, v: V) -> Self {
5360            self.0.request = v.into();
5361            self
5362        }
5363
5364        /// Sets all the options, replacing any prior values.
5365        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5366            self.0.options = v.into();
5367            self
5368        }
5369
5370        /// Sends the request.
5371        pub async fn send(self) -> Result<crate::model::ListHubsResponse> {
5372            (*self.0.stub)
5373                .list_hubs(self.0.request, self.0.options)
5374                .await
5375                .map(crate::Response::into_body)
5376        }
5377
5378        /// Streams each page in the collection.
5379        pub fn by_page(
5380            self,
5381        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListHubsResponse, crate::Error>
5382        {
5383            use std::clone::Clone;
5384            let token = self.0.request.page_token.clone();
5385            let execute = move |token: String| {
5386                let mut builder = self.clone();
5387                builder.0.request = builder.0.request.set_page_token(token);
5388                builder.send()
5389            };
5390            google_cloud_gax::paginator::internal::new_paginator(token, execute)
5391        }
5392
5393        /// Streams each item in the collection.
5394        pub fn by_item(
5395            self,
5396        ) -> impl google_cloud_gax::paginator::ItemPaginator<crate::model::ListHubsResponse, crate::Error>
5397        {
5398            use google_cloud_gax::paginator::Paginator;
5399            self.by_page().items()
5400        }
5401
5402        /// Sets the value of [parent][crate::model::ListHubsRequest::parent].
5403        ///
5404        /// This is a **required** field for requests.
5405        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5406            self.0.request.parent = v.into();
5407            self
5408        }
5409
5410        /// Sets the value of [page_size][crate::model::ListHubsRequest::page_size].
5411        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5412            self.0.request.page_size = v.into();
5413            self
5414        }
5415
5416        /// Sets the value of [page_token][crate::model::ListHubsRequest::page_token].
5417        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5418            self.0.request.page_token = v.into();
5419            self
5420        }
5421
5422        /// Sets the value of [filter][crate::model::ListHubsRequest::filter].
5423        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5424            self.0.request.filter = v.into();
5425            self
5426        }
5427
5428        /// Sets the value of [order_by][crate::model::ListHubsRequest::order_by].
5429        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
5430            self.0.request.order_by = v.into();
5431            self
5432        }
5433    }
5434
5435    #[doc(hidden)]
5436    impl crate::RequestBuilder for ListHubs {
5437        fn request_options(&mut self) -> &mut crate::RequestOptions {
5438            &mut self.0.options
5439        }
5440    }
5441
5442    /// The request builder for [HubService::get_hub][crate::client::HubService::get_hub] calls.
5443    ///
5444    /// # Example
5445    /// ```
5446    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::GetHub;
5447    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
5448    ///
5449    /// let builder = prepare_request_builder();
5450    /// let response = builder.send().await?;
5451    /// # Ok(()) }
5452    ///
5453    /// fn prepare_request_builder() -> GetHub {
5454    ///   # panic!();
5455    ///   // ... details omitted ...
5456    /// }
5457    /// ```
5458    #[derive(Clone, Debug)]
5459    pub struct GetHub(RequestBuilder<crate::model::GetHubRequest>);
5460
5461    impl GetHub {
5462        pub(crate) fn new(
5463            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5464        ) -> Self {
5465            Self(RequestBuilder::new(stub))
5466        }
5467
5468        /// Sets the full request, replacing any prior values.
5469        pub fn with_request<V: Into<crate::model::GetHubRequest>>(mut self, v: V) -> Self {
5470            self.0.request = v.into();
5471            self
5472        }
5473
5474        /// Sets all the options, replacing any prior values.
5475        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5476            self.0.options = v.into();
5477            self
5478        }
5479
5480        /// Sends the request.
5481        pub async fn send(self) -> Result<crate::model::Hub> {
5482            (*self.0.stub)
5483                .get_hub(self.0.request, self.0.options)
5484                .await
5485                .map(crate::Response::into_body)
5486        }
5487
5488        /// Sets the value of [name][crate::model::GetHubRequest::name].
5489        ///
5490        /// This is a **required** field for requests.
5491        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5492            self.0.request.name = v.into();
5493            self
5494        }
5495    }
5496
5497    #[doc(hidden)]
5498    impl crate::RequestBuilder for GetHub {
5499        fn request_options(&mut self) -> &mut crate::RequestOptions {
5500            &mut self.0.options
5501        }
5502    }
5503
5504    /// The request builder for [HubService::create_hub][crate::client::HubService::create_hub] calls.
5505    ///
5506    /// # Example
5507    /// ```
5508    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::CreateHub;
5509    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
5510    /// use google_cloud_lro::Poller;
5511    ///
5512    /// let builder = prepare_request_builder();
5513    /// let response = builder.poller().until_done().await?;
5514    /// # Ok(()) }
5515    ///
5516    /// fn prepare_request_builder() -> CreateHub {
5517    ///   # panic!();
5518    ///   // ... details omitted ...
5519    /// }
5520    /// ```
5521    #[derive(Clone, Debug)]
5522    pub struct CreateHub(RequestBuilder<crate::model::CreateHubRequest>);
5523
5524    impl CreateHub {
5525        pub(crate) fn new(
5526            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5527        ) -> Self {
5528            Self(RequestBuilder::new(stub))
5529        }
5530
5531        /// Sets the full request, replacing any prior values.
5532        pub fn with_request<V: Into<crate::model::CreateHubRequest>>(mut self, v: V) -> Self {
5533            self.0.request = v.into();
5534            self
5535        }
5536
5537        /// Sets all the options, replacing any prior values.
5538        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5539            self.0.options = v.into();
5540            self
5541        }
5542
5543        /// Sends the request.
5544        ///
5545        /// # Long running operations
5546        ///
5547        /// This starts, but does not poll, a longrunning operation. More information
5548        /// on [create_hub][crate::client::HubService::create_hub].
5549        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5550            (*self.0.stub)
5551                .create_hub(self.0.request, self.0.options)
5552                .await
5553                .map(crate::Response::into_body)
5554        }
5555
5556        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_hub`.
5557        pub fn poller(
5558            self,
5559        ) -> impl google_cloud_lro::Poller<crate::model::Hub, crate::model::OperationMetadata>
5560        {
5561            type Operation = google_cloud_lro::internal::Operation<
5562                crate::model::Hub,
5563                crate::model::OperationMetadata,
5564            >;
5565            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5566            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5567
5568            let stub = self.0.stub.clone();
5569            let mut options = self.0.options.clone();
5570            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5571            let query = move |name| {
5572                let stub = stub.clone();
5573                let options = options.clone();
5574                async {
5575                    let op = GetOperation::new(stub)
5576                        .set_name(name)
5577                        .with_options(options)
5578                        .send()
5579                        .await?;
5580                    Ok(Operation::new(op))
5581                }
5582            };
5583
5584            let start = move || async {
5585                let op = self.send().await?;
5586                Ok(Operation::new(op))
5587            };
5588
5589            google_cloud_lro::internal::new_poller(
5590                polling_error_policy,
5591                polling_backoff_policy,
5592                start,
5593                query,
5594            )
5595        }
5596
5597        /// Sets the value of [parent][crate::model::CreateHubRequest::parent].
5598        ///
5599        /// This is a **required** field for requests.
5600        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5601            self.0.request.parent = v.into();
5602            self
5603        }
5604
5605        /// Sets the value of [hub_id][crate::model::CreateHubRequest::hub_id].
5606        ///
5607        /// This is a **required** field for requests.
5608        pub fn set_hub_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5609            self.0.request.hub_id = v.into();
5610            self
5611        }
5612
5613        /// Sets the value of [hub][crate::model::CreateHubRequest::hub].
5614        ///
5615        /// This is a **required** field for requests.
5616        pub fn set_hub<T>(mut self, v: T) -> Self
5617        where
5618            T: std::convert::Into<crate::model::Hub>,
5619        {
5620            self.0.request.hub = std::option::Option::Some(v.into());
5621            self
5622        }
5623
5624        /// Sets or clears the value of [hub][crate::model::CreateHubRequest::hub].
5625        ///
5626        /// This is a **required** field for requests.
5627        pub fn set_or_clear_hub<T>(mut self, v: std::option::Option<T>) -> Self
5628        where
5629            T: std::convert::Into<crate::model::Hub>,
5630        {
5631            self.0.request.hub = v.map(|x| x.into());
5632            self
5633        }
5634
5635        /// Sets the value of [request_id][crate::model::CreateHubRequest::request_id].
5636        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5637            self.0.request.request_id = v.into();
5638            self
5639        }
5640    }
5641
5642    #[doc(hidden)]
5643    impl crate::RequestBuilder for CreateHub {
5644        fn request_options(&mut self) -> &mut crate::RequestOptions {
5645            &mut self.0.options
5646        }
5647    }
5648
5649    /// The request builder for [HubService::update_hub][crate::client::HubService::update_hub] calls.
5650    ///
5651    /// # Example
5652    /// ```
5653    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::UpdateHub;
5654    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
5655    /// use google_cloud_lro::Poller;
5656    ///
5657    /// let builder = prepare_request_builder();
5658    /// let response = builder.poller().until_done().await?;
5659    /// # Ok(()) }
5660    ///
5661    /// fn prepare_request_builder() -> UpdateHub {
5662    ///   # panic!();
5663    ///   // ... details omitted ...
5664    /// }
5665    /// ```
5666    #[derive(Clone, Debug)]
5667    pub struct UpdateHub(RequestBuilder<crate::model::UpdateHubRequest>);
5668
5669    impl UpdateHub {
5670        pub(crate) fn new(
5671            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5672        ) -> Self {
5673            Self(RequestBuilder::new(stub))
5674        }
5675
5676        /// Sets the full request, replacing any prior values.
5677        pub fn with_request<V: Into<crate::model::UpdateHubRequest>>(mut self, v: V) -> Self {
5678            self.0.request = v.into();
5679            self
5680        }
5681
5682        /// Sets all the options, replacing any prior values.
5683        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5684            self.0.options = v.into();
5685            self
5686        }
5687
5688        /// Sends the request.
5689        ///
5690        /// # Long running operations
5691        ///
5692        /// This starts, but does not poll, a longrunning operation. More information
5693        /// on [update_hub][crate::client::HubService::update_hub].
5694        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5695            (*self.0.stub)
5696                .update_hub(self.0.request, self.0.options)
5697                .await
5698                .map(crate::Response::into_body)
5699        }
5700
5701        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_hub`.
5702        pub fn poller(
5703            self,
5704        ) -> impl google_cloud_lro::Poller<crate::model::Hub, crate::model::OperationMetadata>
5705        {
5706            type Operation = google_cloud_lro::internal::Operation<
5707                crate::model::Hub,
5708                crate::model::OperationMetadata,
5709            >;
5710            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5711            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5712
5713            let stub = self.0.stub.clone();
5714            let mut options = self.0.options.clone();
5715            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5716            let query = move |name| {
5717                let stub = stub.clone();
5718                let options = options.clone();
5719                async {
5720                    let op = GetOperation::new(stub)
5721                        .set_name(name)
5722                        .with_options(options)
5723                        .send()
5724                        .await?;
5725                    Ok(Operation::new(op))
5726                }
5727            };
5728
5729            let start = move || async {
5730                let op = self.send().await?;
5731                Ok(Operation::new(op))
5732            };
5733
5734            google_cloud_lro::internal::new_poller(
5735                polling_error_policy,
5736                polling_backoff_policy,
5737                start,
5738                query,
5739            )
5740        }
5741
5742        /// Sets the value of [update_mask][crate::model::UpdateHubRequest::update_mask].
5743        pub fn set_update_mask<T>(mut self, v: T) -> Self
5744        where
5745            T: std::convert::Into<wkt::FieldMask>,
5746        {
5747            self.0.request.update_mask = std::option::Option::Some(v.into());
5748            self
5749        }
5750
5751        /// Sets or clears the value of [update_mask][crate::model::UpdateHubRequest::update_mask].
5752        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5753        where
5754            T: std::convert::Into<wkt::FieldMask>,
5755        {
5756            self.0.request.update_mask = v.map(|x| x.into());
5757            self
5758        }
5759
5760        /// Sets the value of [hub][crate::model::UpdateHubRequest::hub].
5761        ///
5762        /// This is a **required** field for requests.
5763        pub fn set_hub<T>(mut self, v: T) -> Self
5764        where
5765            T: std::convert::Into<crate::model::Hub>,
5766        {
5767            self.0.request.hub = std::option::Option::Some(v.into());
5768            self
5769        }
5770
5771        /// Sets or clears the value of [hub][crate::model::UpdateHubRequest::hub].
5772        ///
5773        /// This is a **required** field for requests.
5774        pub fn set_or_clear_hub<T>(mut self, v: std::option::Option<T>) -> Self
5775        where
5776            T: std::convert::Into<crate::model::Hub>,
5777        {
5778            self.0.request.hub = v.map(|x| x.into());
5779            self
5780        }
5781
5782        /// Sets the value of [request_id][crate::model::UpdateHubRequest::request_id].
5783        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5784            self.0.request.request_id = v.into();
5785            self
5786        }
5787    }
5788
5789    #[doc(hidden)]
5790    impl crate::RequestBuilder for UpdateHub {
5791        fn request_options(&mut self) -> &mut crate::RequestOptions {
5792            &mut self.0.options
5793        }
5794    }
5795
5796    /// The request builder for [HubService::delete_hub][crate::client::HubService::delete_hub] calls.
5797    ///
5798    /// # Example
5799    /// ```
5800    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::DeleteHub;
5801    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
5802    /// use google_cloud_lro::Poller;
5803    ///
5804    /// let builder = prepare_request_builder();
5805    /// let response = builder.poller().until_done().await?;
5806    /// # Ok(()) }
5807    ///
5808    /// fn prepare_request_builder() -> DeleteHub {
5809    ///   # panic!();
5810    ///   // ... details omitted ...
5811    /// }
5812    /// ```
5813    #[derive(Clone, Debug)]
5814    pub struct DeleteHub(RequestBuilder<crate::model::DeleteHubRequest>);
5815
5816    impl DeleteHub {
5817        pub(crate) fn new(
5818            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5819        ) -> Self {
5820            Self(RequestBuilder::new(stub))
5821        }
5822
5823        /// Sets the full request, replacing any prior values.
5824        pub fn with_request<V: Into<crate::model::DeleteHubRequest>>(mut self, v: V) -> Self {
5825            self.0.request = v.into();
5826            self
5827        }
5828
5829        /// Sets all the options, replacing any prior values.
5830        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5831            self.0.options = v.into();
5832            self
5833        }
5834
5835        /// Sends the request.
5836        ///
5837        /// # Long running operations
5838        ///
5839        /// This starts, but does not poll, a longrunning operation. More information
5840        /// on [delete_hub][crate::client::HubService::delete_hub].
5841        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5842            (*self.0.stub)
5843                .delete_hub(self.0.request, self.0.options)
5844                .await
5845                .map(crate::Response::into_body)
5846        }
5847
5848        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_hub`.
5849        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
5850            type Operation =
5851                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
5852            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5853            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5854
5855            let stub = self.0.stub.clone();
5856            let mut options = self.0.options.clone();
5857            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5858            let query = move |name| {
5859                let stub = stub.clone();
5860                let options = options.clone();
5861                async {
5862                    let op = GetOperation::new(stub)
5863                        .set_name(name)
5864                        .with_options(options)
5865                        .send()
5866                        .await?;
5867                    Ok(Operation::new(op))
5868                }
5869            };
5870
5871            let start = move || async {
5872                let op = self.send().await?;
5873                Ok(Operation::new(op))
5874            };
5875
5876            google_cloud_lro::internal::new_unit_response_poller(
5877                polling_error_policy,
5878                polling_backoff_policy,
5879                start,
5880                query,
5881            )
5882        }
5883
5884        /// Sets the value of [name][crate::model::DeleteHubRequest::name].
5885        ///
5886        /// This is a **required** field for requests.
5887        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5888            self.0.request.name = v.into();
5889            self
5890        }
5891
5892        /// Sets the value of [request_id][crate::model::DeleteHubRequest::request_id].
5893        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5894            self.0.request.request_id = v.into();
5895            self
5896        }
5897    }
5898
5899    #[doc(hidden)]
5900    impl crate::RequestBuilder for DeleteHub {
5901        fn request_options(&mut self) -> &mut crate::RequestOptions {
5902            &mut self.0.options
5903        }
5904    }
5905
5906    /// The request builder for [HubService::list_hub_spokes][crate::client::HubService::list_hub_spokes] calls.
5907    ///
5908    /// # Example
5909    /// ```
5910    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::ListHubSpokes;
5911    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
5912    /// use google_cloud_gax::paginator::ItemPaginator;
5913    ///
5914    /// let builder = prepare_request_builder();
5915    /// let mut items = builder.by_item();
5916    /// while let Some(result) = items.next().await {
5917    ///   let item = result?;
5918    /// }
5919    /// # Ok(()) }
5920    ///
5921    /// fn prepare_request_builder() -> ListHubSpokes {
5922    ///   # panic!();
5923    ///   // ... details omitted ...
5924    /// }
5925    /// ```
5926    #[derive(Clone, Debug)]
5927    pub struct ListHubSpokes(RequestBuilder<crate::model::ListHubSpokesRequest>);
5928
5929    impl ListHubSpokes {
5930        pub(crate) fn new(
5931            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
5932        ) -> Self {
5933            Self(RequestBuilder::new(stub))
5934        }
5935
5936        /// Sets the full request, replacing any prior values.
5937        pub fn with_request<V: Into<crate::model::ListHubSpokesRequest>>(mut self, v: V) -> Self {
5938            self.0.request = v.into();
5939            self
5940        }
5941
5942        /// Sets all the options, replacing any prior values.
5943        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5944            self.0.options = v.into();
5945            self
5946        }
5947
5948        /// Sends the request.
5949        pub async fn send(self) -> Result<crate::model::ListHubSpokesResponse> {
5950            (*self.0.stub)
5951                .list_hub_spokes(self.0.request, self.0.options)
5952                .await
5953                .map(crate::Response::into_body)
5954        }
5955
5956        /// Streams each page in the collection.
5957        pub fn by_page(
5958            self,
5959        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListHubSpokesResponse, crate::Error>
5960        {
5961            use std::clone::Clone;
5962            let token = self.0.request.page_token.clone();
5963            let execute = move |token: String| {
5964                let mut builder = self.clone();
5965                builder.0.request = builder.0.request.set_page_token(token);
5966                builder.send()
5967            };
5968            google_cloud_gax::paginator::internal::new_paginator(token, execute)
5969        }
5970
5971        /// Streams each item in the collection.
5972        pub fn by_item(
5973            self,
5974        ) -> impl google_cloud_gax::paginator::ItemPaginator<
5975            crate::model::ListHubSpokesResponse,
5976            crate::Error,
5977        > {
5978            use google_cloud_gax::paginator::Paginator;
5979            self.by_page().items()
5980        }
5981
5982        /// Sets the value of [name][crate::model::ListHubSpokesRequest::name].
5983        ///
5984        /// This is a **required** field for requests.
5985        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5986            self.0.request.name = v.into();
5987            self
5988        }
5989
5990        /// Sets the value of [spoke_locations][crate::model::ListHubSpokesRequest::spoke_locations].
5991        pub fn set_spoke_locations<T, V>(mut self, v: T) -> Self
5992        where
5993            T: std::iter::IntoIterator<Item = V>,
5994            V: std::convert::Into<std::string::String>,
5995        {
5996            use std::iter::Iterator;
5997            self.0.request.spoke_locations = v.into_iter().map(|i| i.into()).collect();
5998            self
5999        }
6000
6001        /// Sets the value of [page_size][crate::model::ListHubSpokesRequest::page_size].
6002        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6003            self.0.request.page_size = v.into();
6004            self
6005        }
6006
6007        /// Sets the value of [page_token][crate::model::ListHubSpokesRequest::page_token].
6008        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6009            self.0.request.page_token = v.into();
6010            self
6011        }
6012
6013        /// Sets the value of [filter][crate::model::ListHubSpokesRequest::filter].
6014        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6015            self.0.request.filter = v.into();
6016            self
6017        }
6018
6019        /// Sets the value of [order_by][crate::model::ListHubSpokesRequest::order_by].
6020        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
6021            self.0.request.order_by = v.into();
6022            self
6023        }
6024
6025        /// Sets the value of [view][crate::model::ListHubSpokesRequest::view].
6026        pub fn set_view<T: Into<crate::model::list_hub_spokes_request::SpokeView>>(
6027            mut self,
6028            v: T,
6029        ) -> Self {
6030            self.0.request.view = v.into();
6031            self
6032        }
6033    }
6034
6035    #[doc(hidden)]
6036    impl crate::RequestBuilder for ListHubSpokes {
6037        fn request_options(&mut self) -> &mut crate::RequestOptions {
6038            &mut self.0.options
6039        }
6040    }
6041
6042    /// The request builder for [HubService::query_hub_status][crate::client::HubService::query_hub_status] calls.
6043    ///
6044    /// # Example
6045    /// ```
6046    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::QueryHubStatus;
6047    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
6048    /// use google_cloud_gax::paginator::ItemPaginator;
6049    ///
6050    /// let builder = prepare_request_builder();
6051    /// let mut items = builder.by_item();
6052    /// while let Some(result) = items.next().await {
6053    ///   let item = result?;
6054    /// }
6055    /// # Ok(()) }
6056    ///
6057    /// fn prepare_request_builder() -> QueryHubStatus {
6058    ///   # panic!();
6059    ///   // ... details omitted ...
6060    /// }
6061    /// ```
6062    #[derive(Clone, Debug)]
6063    pub struct QueryHubStatus(RequestBuilder<crate::model::QueryHubStatusRequest>);
6064
6065    impl QueryHubStatus {
6066        pub(crate) fn new(
6067            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6068        ) -> Self {
6069            Self(RequestBuilder::new(stub))
6070        }
6071
6072        /// Sets the full request, replacing any prior values.
6073        pub fn with_request<V: Into<crate::model::QueryHubStatusRequest>>(mut self, v: V) -> Self {
6074            self.0.request = v.into();
6075            self
6076        }
6077
6078        /// Sets all the options, replacing any prior values.
6079        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6080            self.0.options = v.into();
6081            self
6082        }
6083
6084        /// Sends the request.
6085        pub async fn send(self) -> Result<crate::model::QueryHubStatusResponse> {
6086            (*self.0.stub)
6087                .query_hub_status(self.0.request, self.0.options)
6088                .await
6089                .map(crate::Response::into_body)
6090        }
6091
6092        /// Streams each page in the collection.
6093        pub fn by_page(
6094            self,
6095        ) -> impl google_cloud_gax::paginator::Paginator<
6096            crate::model::QueryHubStatusResponse,
6097            crate::Error,
6098        > {
6099            use std::clone::Clone;
6100            let token = self.0.request.page_token.clone();
6101            let execute = move |token: String| {
6102                let mut builder = self.clone();
6103                builder.0.request = builder.0.request.set_page_token(token);
6104                builder.send()
6105            };
6106            google_cloud_gax::paginator::internal::new_paginator(token, execute)
6107        }
6108
6109        /// Streams each item in the collection.
6110        pub fn by_item(
6111            self,
6112        ) -> impl google_cloud_gax::paginator::ItemPaginator<
6113            crate::model::QueryHubStatusResponse,
6114            crate::Error,
6115        > {
6116            use google_cloud_gax::paginator::Paginator;
6117            self.by_page().items()
6118        }
6119
6120        /// Sets the value of [name][crate::model::QueryHubStatusRequest::name].
6121        ///
6122        /// This is a **required** field for requests.
6123        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6124            self.0.request.name = v.into();
6125            self
6126        }
6127
6128        /// Sets the value of [page_size][crate::model::QueryHubStatusRequest::page_size].
6129        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6130            self.0.request.page_size = v.into();
6131            self
6132        }
6133
6134        /// Sets the value of [page_token][crate::model::QueryHubStatusRequest::page_token].
6135        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6136            self.0.request.page_token = v.into();
6137            self
6138        }
6139
6140        /// Sets the value of [filter][crate::model::QueryHubStatusRequest::filter].
6141        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6142            self.0.request.filter = v.into();
6143            self
6144        }
6145
6146        /// Sets the value of [order_by][crate::model::QueryHubStatusRequest::order_by].
6147        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
6148            self.0.request.order_by = v.into();
6149            self
6150        }
6151
6152        /// Sets the value of [group_by][crate::model::QueryHubStatusRequest::group_by].
6153        pub fn set_group_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
6154            self.0.request.group_by = v.into();
6155            self
6156        }
6157    }
6158
6159    #[doc(hidden)]
6160    impl crate::RequestBuilder for QueryHubStatus {
6161        fn request_options(&mut self) -> &mut crate::RequestOptions {
6162            &mut self.0.options
6163        }
6164    }
6165
6166    /// The request builder for [HubService::list_spokes][crate::client::HubService::list_spokes] calls.
6167    ///
6168    /// # Example
6169    /// ```
6170    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::ListSpokes;
6171    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
6172    /// use google_cloud_gax::paginator::ItemPaginator;
6173    ///
6174    /// let builder = prepare_request_builder();
6175    /// let mut items = builder.by_item();
6176    /// while let Some(result) = items.next().await {
6177    ///   let item = result?;
6178    /// }
6179    /// # Ok(()) }
6180    ///
6181    /// fn prepare_request_builder() -> ListSpokes {
6182    ///   # panic!();
6183    ///   // ... details omitted ...
6184    /// }
6185    /// ```
6186    #[derive(Clone, Debug)]
6187    pub struct ListSpokes(RequestBuilder<crate::model::ListSpokesRequest>);
6188
6189    impl ListSpokes {
6190        pub(crate) fn new(
6191            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6192        ) -> Self {
6193            Self(RequestBuilder::new(stub))
6194        }
6195
6196        /// Sets the full request, replacing any prior values.
6197        pub fn with_request<V: Into<crate::model::ListSpokesRequest>>(mut self, v: V) -> Self {
6198            self.0.request = v.into();
6199            self
6200        }
6201
6202        /// Sets all the options, replacing any prior values.
6203        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6204            self.0.options = v.into();
6205            self
6206        }
6207
6208        /// Sends the request.
6209        pub async fn send(self) -> Result<crate::model::ListSpokesResponse> {
6210            (*self.0.stub)
6211                .list_spokes(self.0.request, self.0.options)
6212                .await
6213                .map(crate::Response::into_body)
6214        }
6215
6216        /// Streams each page in the collection.
6217        pub fn by_page(
6218            self,
6219        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListSpokesResponse, crate::Error>
6220        {
6221            use std::clone::Clone;
6222            let token = self.0.request.page_token.clone();
6223            let execute = move |token: String| {
6224                let mut builder = self.clone();
6225                builder.0.request = builder.0.request.set_page_token(token);
6226                builder.send()
6227            };
6228            google_cloud_gax::paginator::internal::new_paginator(token, execute)
6229        }
6230
6231        /// Streams each item in the collection.
6232        pub fn by_item(
6233            self,
6234        ) -> impl google_cloud_gax::paginator::ItemPaginator<
6235            crate::model::ListSpokesResponse,
6236            crate::Error,
6237        > {
6238            use google_cloud_gax::paginator::Paginator;
6239            self.by_page().items()
6240        }
6241
6242        /// Sets the value of [parent][crate::model::ListSpokesRequest::parent].
6243        ///
6244        /// This is a **required** field for requests.
6245        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6246            self.0.request.parent = v.into();
6247            self
6248        }
6249
6250        /// Sets the value of [page_size][crate::model::ListSpokesRequest::page_size].
6251        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6252            self.0.request.page_size = v.into();
6253            self
6254        }
6255
6256        /// Sets the value of [page_token][crate::model::ListSpokesRequest::page_token].
6257        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6258            self.0.request.page_token = v.into();
6259            self
6260        }
6261
6262        /// Sets the value of [filter][crate::model::ListSpokesRequest::filter].
6263        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6264            self.0.request.filter = v.into();
6265            self
6266        }
6267
6268        /// Sets the value of [order_by][crate::model::ListSpokesRequest::order_by].
6269        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
6270            self.0.request.order_by = v.into();
6271            self
6272        }
6273    }
6274
6275    #[doc(hidden)]
6276    impl crate::RequestBuilder for ListSpokes {
6277        fn request_options(&mut self) -> &mut crate::RequestOptions {
6278            &mut self.0.options
6279        }
6280    }
6281
6282    /// The request builder for [HubService::get_spoke][crate::client::HubService::get_spoke] calls.
6283    ///
6284    /// # Example
6285    /// ```
6286    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::GetSpoke;
6287    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
6288    ///
6289    /// let builder = prepare_request_builder();
6290    /// let response = builder.send().await?;
6291    /// # Ok(()) }
6292    ///
6293    /// fn prepare_request_builder() -> GetSpoke {
6294    ///   # panic!();
6295    ///   // ... details omitted ...
6296    /// }
6297    /// ```
6298    #[derive(Clone, Debug)]
6299    pub struct GetSpoke(RequestBuilder<crate::model::GetSpokeRequest>);
6300
6301    impl GetSpoke {
6302        pub(crate) fn new(
6303            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6304        ) -> Self {
6305            Self(RequestBuilder::new(stub))
6306        }
6307
6308        /// Sets the full request, replacing any prior values.
6309        pub fn with_request<V: Into<crate::model::GetSpokeRequest>>(mut self, v: V) -> Self {
6310            self.0.request = v.into();
6311            self
6312        }
6313
6314        /// Sets all the options, replacing any prior values.
6315        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6316            self.0.options = v.into();
6317            self
6318        }
6319
6320        /// Sends the request.
6321        pub async fn send(self) -> Result<crate::model::Spoke> {
6322            (*self.0.stub)
6323                .get_spoke(self.0.request, self.0.options)
6324                .await
6325                .map(crate::Response::into_body)
6326        }
6327
6328        /// Sets the value of [name][crate::model::GetSpokeRequest::name].
6329        ///
6330        /// This is a **required** field for requests.
6331        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6332            self.0.request.name = v.into();
6333            self
6334        }
6335    }
6336
6337    #[doc(hidden)]
6338    impl crate::RequestBuilder for GetSpoke {
6339        fn request_options(&mut self) -> &mut crate::RequestOptions {
6340            &mut self.0.options
6341        }
6342    }
6343
6344    /// The request builder for [HubService::create_spoke][crate::client::HubService::create_spoke] calls.
6345    ///
6346    /// # Example
6347    /// ```
6348    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::CreateSpoke;
6349    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
6350    /// use google_cloud_lro::Poller;
6351    ///
6352    /// let builder = prepare_request_builder();
6353    /// let response = builder.poller().until_done().await?;
6354    /// # Ok(()) }
6355    ///
6356    /// fn prepare_request_builder() -> CreateSpoke {
6357    ///   # panic!();
6358    ///   // ... details omitted ...
6359    /// }
6360    /// ```
6361    #[derive(Clone, Debug)]
6362    pub struct CreateSpoke(RequestBuilder<crate::model::CreateSpokeRequest>);
6363
6364    impl CreateSpoke {
6365        pub(crate) fn new(
6366            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6367        ) -> Self {
6368            Self(RequestBuilder::new(stub))
6369        }
6370
6371        /// Sets the full request, replacing any prior values.
6372        pub fn with_request<V: Into<crate::model::CreateSpokeRequest>>(mut self, v: V) -> Self {
6373            self.0.request = v.into();
6374            self
6375        }
6376
6377        /// Sets all the options, replacing any prior values.
6378        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6379            self.0.options = v.into();
6380            self
6381        }
6382
6383        /// Sends the request.
6384        ///
6385        /// # Long running operations
6386        ///
6387        /// This starts, but does not poll, a longrunning operation. More information
6388        /// on [create_spoke][crate::client::HubService::create_spoke].
6389        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6390            (*self.0.stub)
6391                .create_spoke(self.0.request, self.0.options)
6392                .await
6393                .map(crate::Response::into_body)
6394        }
6395
6396        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_spoke`.
6397        pub fn poller(
6398            self,
6399        ) -> impl google_cloud_lro::Poller<crate::model::Spoke, crate::model::OperationMetadata>
6400        {
6401            type Operation = google_cloud_lro::internal::Operation<
6402                crate::model::Spoke,
6403                crate::model::OperationMetadata,
6404            >;
6405            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6406            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6407
6408            let stub = self.0.stub.clone();
6409            let mut options = self.0.options.clone();
6410            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6411            let query = move |name| {
6412                let stub = stub.clone();
6413                let options = options.clone();
6414                async {
6415                    let op = GetOperation::new(stub)
6416                        .set_name(name)
6417                        .with_options(options)
6418                        .send()
6419                        .await?;
6420                    Ok(Operation::new(op))
6421                }
6422            };
6423
6424            let start = move || async {
6425                let op = self.send().await?;
6426                Ok(Operation::new(op))
6427            };
6428
6429            google_cloud_lro::internal::new_poller(
6430                polling_error_policy,
6431                polling_backoff_policy,
6432                start,
6433                query,
6434            )
6435        }
6436
6437        /// Sets the value of [parent][crate::model::CreateSpokeRequest::parent].
6438        ///
6439        /// This is a **required** field for requests.
6440        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6441            self.0.request.parent = v.into();
6442            self
6443        }
6444
6445        /// Sets the value of [spoke_id][crate::model::CreateSpokeRequest::spoke_id].
6446        ///
6447        /// This is a **required** field for requests.
6448        pub fn set_spoke_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6449            self.0.request.spoke_id = v.into();
6450            self
6451        }
6452
6453        /// Sets the value of [spoke][crate::model::CreateSpokeRequest::spoke].
6454        ///
6455        /// This is a **required** field for requests.
6456        pub fn set_spoke<T>(mut self, v: T) -> Self
6457        where
6458            T: std::convert::Into<crate::model::Spoke>,
6459        {
6460            self.0.request.spoke = std::option::Option::Some(v.into());
6461            self
6462        }
6463
6464        /// Sets or clears the value of [spoke][crate::model::CreateSpokeRequest::spoke].
6465        ///
6466        /// This is a **required** field for requests.
6467        pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
6468        where
6469            T: std::convert::Into<crate::model::Spoke>,
6470        {
6471            self.0.request.spoke = v.map(|x| x.into());
6472            self
6473        }
6474
6475        /// Sets the value of [request_id][crate::model::CreateSpokeRequest::request_id].
6476        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6477            self.0.request.request_id = v.into();
6478            self
6479        }
6480    }
6481
6482    #[doc(hidden)]
6483    impl crate::RequestBuilder for CreateSpoke {
6484        fn request_options(&mut self) -> &mut crate::RequestOptions {
6485            &mut self.0.options
6486        }
6487    }
6488
6489    /// The request builder for [HubService::update_spoke][crate::client::HubService::update_spoke] calls.
6490    ///
6491    /// # Example
6492    /// ```
6493    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::UpdateSpoke;
6494    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
6495    /// use google_cloud_lro::Poller;
6496    ///
6497    /// let builder = prepare_request_builder();
6498    /// let response = builder.poller().until_done().await?;
6499    /// # Ok(()) }
6500    ///
6501    /// fn prepare_request_builder() -> UpdateSpoke {
6502    ///   # panic!();
6503    ///   // ... details omitted ...
6504    /// }
6505    /// ```
6506    #[derive(Clone, Debug)]
6507    pub struct UpdateSpoke(RequestBuilder<crate::model::UpdateSpokeRequest>);
6508
6509    impl UpdateSpoke {
6510        pub(crate) fn new(
6511            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6512        ) -> Self {
6513            Self(RequestBuilder::new(stub))
6514        }
6515
6516        /// Sets the full request, replacing any prior values.
6517        pub fn with_request<V: Into<crate::model::UpdateSpokeRequest>>(mut self, v: V) -> Self {
6518            self.0.request = v.into();
6519            self
6520        }
6521
6522        /// Sets all the options, replacing any prior values.
6523        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6524            self.0.options = v.into();
6525            self
6526        }
6527
6528        /// Sends the request.
6529        ///
6530        /// # Long running operations
6531        ///
6532        /// This starts, but does not poll, a longrunning operation. More information
6533        /// on [update_spoke][crate::client::HubService::update_spoke].
6534        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6535            (*self.0.stub)
6536                .update_spoke(self.0.request, self.0.options)
6537                .await
6538                .map(crate::Response::into_body)
6539        }
6540
6541        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_spoke`.
6542        pub fn poller(
6543            self,
6544        ) -> impl google_cloud_lro::Poller<crate::model::Spoke, crate::model::OperationMetadata>
6545        {
6546            type Operation = google_cloud_lro::internal::Operation<
6547                crate::model::Spoke,
6548                crate::model::OperationMetadata,
6549            >;
6550            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6551            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6552
6553            let stub = self.0.stub.clone();
6554            let mut options = self.0.options.clone();
6555            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6556            let query = move |name| {
6557                let stub = stub.clone();
6558                let options = options.clone();
6559                async {
6560                    let op = GetOperation::new(stub)
6561                        .set_name(name)
6562                        .with_options(options)
6563                        .send()
6564                        .await?;
6565                    Ok(Operation::new(op))
6566                }
6567            };
6568
6569            let start = move || async {
6570                let op = self.send().await?;
6571                Ok(Operation::new(op))
6572            };
6573
6574            google_cloud_lro::internal::new_poller(
6575                polling_error_policy,
6576                polling_backoff_policy,
6577                start,
6578                query,
6579            )
6580        }
6581
6582        /// Sets the value of [update_mask][crate::model::UpdateSpokeRequest::update_mask].
6583        pub fn set_update_mask<T>(mut self, v: T) -> Self
6584        where
6585            T: std::convert::Into<wkt::FieldMask>,
6586        {
6587            self.0.request.update_mask = std::option::Option::Some(v.into());
6588            self
6589        }
6590
6591        /// Sets or clears the value of [update_mask][crate::model::UpdateSpokeRequest::update_mask].
6592        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6593        where
6594            T: std::convert::Into<wkt::FieldMask>,
6595        {
6596            self.0.request.update_mask = v.map(|x| x.into());
6597            self
6598        }
6599
6600        /// Sets the value of [spoke][crate::model::UpdateSpokeRequest::spoke].
6601        ///
6602        /// This is a **required** field for requests.
6603        pub fn set_spoke<T>(mut self, v: T) -> Self
6604        where
6605            T: std::convert::Into<crate::model::Spoke>,
6606        {
6607            self.0.request.spoke = std::option::Option::Some(v.into());
6608            self
6609        }
6610
6611        /// Sets or clears the value of [spoke][crate::model::UpdateSpokeRequest::spoke].
6612        ///
6613        /// This is a **required** field for requests.
6614        pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
6615        where
6616            T: std::convert::Into<crate::model::Spoke>,
6617        {
6618            self.0.request.spoke = v.map(|x| x.into());
6619            self
6620        }
6621
6622        /// Sets the value of [request_id][crate::model::UpdateSpokeRequest::request_id].
6623        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6624            self.0.request.request_id = v.into();
6625            self
6626        }
6627    }
6628
6629    #[doc(hidden)]
6630    impl crate::RequestBuilder for UpdateSpoke {
6631        fn request_options(&mut self) -> &mut crate::RequestOptions {
6632            &mut self.0.options
6633        }
6634    }
6635
6636    /// The request builder for [HubService::reject_hub_spoke][crate::client::HubService::reject_hub_spoke] calls.
6637    ///
6638    /// # Example
6639    /// ```
6640    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::RejectHubSpoke;
6641    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
6642    /// use google_cloud_lro::Poller;
6643    ///
6644    /// let builder = prepare_request_builder();
6645    /// let response = builder.poller().until_done().await?;
6646    /// # Ok(()) }
6647    ///
6648    /// fn prepare_request_builder() -> RejectHubSpoke {
6649    ///   # panic!();
6650    ///   // ... details omitted ...
6651    /// }
6652    /// ```
6653    #[derive(Clone, Debug)]
6654    pub struct RejectHubSpoke(RequestBuilder<crate::model::RejectHubSpokeRequest>);
6655
6656    impl RejectHubSpoke {
6657        pub(crate) fn new(
6658            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6659        ) -> Self {
6660            Self(RequestBuilder::new(stub))
6661        }
6662
6663        /// Sets the full request, replacing any prior values.
6664        pub fn with_request<V: Into<crate::model::RejectHubSpokeRequest>>(mut self, v: V) -> Self {
6665            self.0.request = v.into();
6666            self
6667        }
6668
6669        /// Sets all the options, replacing any prior values.
6670        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6671            self.0.options = v.into();
6672            self
6673        }
6674
6675        /// Sends the request.
6676        ///
6677        /// # Long running operations
6678        ///
6679        /// This starts, but does not poll, a longrunning operation. More information
6680        /// on [reject_hub_spoke][crate::client::HubService::reject_hub_spoke].
6681        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6682            (*self.0.stub)
6683                .reject_hub_spoke(self.0.request, self.0.options)
6684                .await
6685                .map(crate::Response::into_body)
6686        }
6687
6688        /// Creates a [Poller][google_cloud_lro::Poller] to work with `reject_hub_spoke`.
6689        pub fn poller(
6690            self,
6691        ) -> impl google_cloud_lro::Poller<
6692            crate::model::RejectHubSpokeResponse,
6693            crate::model::OperationMetadata,
6694        > {
6695            type Operation = google_cloud_lro::internal::Operation<
6696                crate::model::RejectHubSpokeResponse,
6697                crate::model::OperationMetadata,
6698            >;
6699            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6700            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6701
6702            let stub = self.0.stub.clone();
6703            let mut options = self.0.options.clone();
6704            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6705            let query = move |name| {
6706                let stub = stub.clone();
6707                let options = options.clone();
6708                async {
6709                    let op = GetOperation::new(stub)
6710                        .set_name(name)
6711                        .with_options(options)
6712                        .send()
6713                        .await?;
6714                    Ok(Operation::new(op))
6715                }
6716            };
6717
6718            let start = move || async {
6719                let op = self.send().await?;
6720                Ok(Operation::new(op))
6721            };
6722
6723            google_cloud_lro::internal::new_poller(
6724                polling_error_policy,
6725                polling_backoff_policy,
6726                start,
6727                query,
6728            )
6729        }
6730
6731        /// Sets the value of [name][crate::model::RejectHubSpokeRequest::name].
6732        ///
6733        /// This is a **required** field for requests.
6734        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6735            self.0.request.name = v.into();
6736            self
6737        }
6738
6739        /// Sets the value of [spoke_uri][crate::model::RejectHubSpokeRequest::spoke_uri].
6740        ///
6741        /// This is a **required** field for requests.
6742        pub fn set_spoke_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
6743            self.0.request.spoke_uri = v.into();
6744            self
6745        }
6746
6747        /// Sets the value of [request_id][crate::model::RejectHubSpokeRequest::request_id].
6748        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6749            self.0.request.request_id = v.into();
6750            self
6751        }
6752
6753        /// Sets the value of [details][crate::model::RejectHubSpokeRequest::details].
6754        pub fn set_details<T: Into<std::string::String>>(mut self, v: T) -> Self {
6755            self.0.request.details = v.into();
6756            self
6757        }
6758    }
6759
6760    #[doc(hidden)]
6761    impl crate::RequestBuilder for RejectHubSpoke {
6762        fn request_options(&mut self) -> &mut crate::RequestOptions {
6763            &mut self.0.options
6764        }
6765    }
6766
6767    /// The request builder for [HubService::accept_hub_spoke][crate::client::HubService::accept_hub_spoke] calls.
6768    ///
6769    /// # Example
6770    /// ```
6771    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::AcceptHubSpoke;
6772    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
6773    /// use google_cloud_lro::Poller;
6774    ///
6775    /// let builder = prepare_request_builder();
6776    /// let response = builder.poller().until_done().await?;
6777    /// # Ok(()) }
6778    ///
6779    /// fn prepare_request_builder() -> AcceptHubSpoke {
6780    ///   # panic!();
6781    ///   // ... details omitted ...
6782    /// }
6783    /// ```
6784    #[derive(Clone, Debug)]
6785    pub struct AcceptHubSpoke(RequestBuilder<crate::model::AcceptHubSpokeRequest>);
6786
6787    impl AcceptHubSpoke {
6788        pub(crate) fn new(
6789            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6790        ) -> Self {
6791            Self(RequestBuilder::new(stub))
6792        }
6793
6794        /// Sets the full request, replacing any prior values.
6795        pub fn with_request<V: Into<crate::model::AcceptHubSpokeRequest>>(mut self, v: V) -> Self {
6796            self.0.request = v.into();
6797            self
6798        }
6799
6800        /// Sets all the options, replacing any prior values.
6801        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6802            self.0.options = v.into();
6803            self
6804        }
6805
6806        /// Sends the request.
6807        ///
6808        /// # Long running operations
6809        ///
6810        /// This starts, but does not poll, a longrunning operation. More information
6811        /// on [accept_hub_spoke][crate::client::HubService::accept_hub_spoke].
6812        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6813            (*self.0.stub)
6814                .accept_hub_spoke(self.0.request, self.0.options)
6815                .await
6816                .map(crate::Response::into_body)
6817        }
6818
6819        /// Creates a [Poller][google_cloud_lro::Poller] to work with `accept_hub_spoke`.
6820        pub fn poller(
6821            self,
6822        ) -> impl google_cloud_lro::Poller<
6823            crate::model::AcceptHubSpokeResponse,
6824            crate::model::OperationMetadata,
6825        > {
6826            type Operation = google_cloud_lro::internal::Operation<
6827                crate::model::AcceptHubSpokeResponse,
6828                crate::model::OperationMetadata,
6829            >;
6830            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6831            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6832
6833            let stub = self.0.stub.clone();
6834            let mut options = self.0.options.clone();
6835            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6836            let query = move |name| {
6837                let stub = stub.clone();
6838                let options = options.clone();
6839                async {
6840                    let op = GetOperation::new(stub)
6841                        .set_name(name)
6842                        .with_options(options)
6843                        .send()
6844                        .await?;
6845                    Ok(Operation::new(op))
6846                }
6847            };
6848
6849            let start = move || async {
6850                let op = self.send().await?;
6851                Ok(Operation::new(op))
6852            };
6853
6854            google_cloud_lro::internal::new_poller(
6855                polling_error_policy,
6856                polling_backoff_policy,
6857                start,
6858                query,
6859            )
6860        }
6861
6862        /// Sets the value of [name][crate::model::AcceptHubSpokeRequest::name].
6863        ///
6864        /// This is a **required** field for requests.
6865        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6866            self.0.request.name = v.into();
6867            self
6868        }
6869
6870        /// Sets the value of [spoke_uri][crate::model::AcceptHubSpokeRequest::spoke_uri].
6871        ///
6872        /// This is a **required** field for requests.
6873        pub fn set_spoke_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
6874            self.0.request.spoke_uri = v.into();
6875            self
6876        }
6877
6878        /// Sets the value of [request_id][crate::model::AcceptHubSpokeRequest::request_id].
6879        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6880            self.0.request.request_id = v.into();
6881            self
6882        }
6883    }
6884
6885    #[doc(hidden)]
6886    impl crate::RequestBuilder for AcceptHubSpoke {
6887        fn request_options(&mut self) -> &mut crate::RequestOptions {
6888            &mut self.0.options
6889        }
6890    }
6891
6892    /// The request builder for [HubService::accept_spoke_update][crate::client::HubService::accept_spoke_update] calls.
6893    ///
6894    /// # Example
6895    /// ```
6896    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::AcceptSpokeUpdate;
6897    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
6898    /// use google_cloud_lro::Poller;
6899    ///
6900    /// let builder = prepare_request_builder();
6901    /// let response = builder.poller().until_done().await?;
6902    /// # Ok(()) }
6903    ///
6904    /// fn prepare_request_builder() -> AcceptSpokeUpdate {
6905    ///   # panic!();
6906    ///   // ... details omitted ...
6907    /// }
6908    /// ```
6909    #[derive(Clone, Debug)]
6910    pub struct AcceptSpokeUpdate(RequestBuilder<crate::model::AcceptSpokeUpdateRequest>);
6911
6912    impl AcceptSpokeUpdate {
6913        pub(crate) fn new(
6914            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
6915        ) -> Self {
6916            Self(RequestBuilder::new(stub))
6917        }
6918
6919        /// Sets the full request, replacing any prior values.
6920        pub fn with_request<V: Into<crate::model::AcceptSpokeUpdateRequest>>(
6921            mut self,
6922            v: V,
6923        ) -> Self {
6924            self.0.request = v.into();
6925            self
6926        }
6927
6928        /// Sets all the options, replacing any prior values.
6929        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6930            self.0.options = v.into();
6931            self
6932        }
6933
6934        /// Sends the request.
6935        ///
6936        /// # Long running operations
6937        ///
6938        /// This starts, but does not poll, a longrunning operation. More information
6939        /// on [accept_spoke_update][crate::client::HubService::accept_spoke_update].
6940        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6941            (*self.0.stub)
6942                .accept_spoke_update(self.0.request, self.0.options)
6943                .await
6944                .map(crate::Response::into_body)
6945        }
6946
6947        /// Creates a [Poller][google_cloud_lro::Poller] to work with `accept_spoke_update`.
6948        pub fn poller(
6949            self,
6950        ) -> impl google_cloud_lro::Poller<
6951            crate::model::AcceptSpokeUpdateResponse,
6952            crate::model::OperationMetadata,
6953        > {
6954            type Operation = google_cloud_lro::internal::Operation<
6955                crate::model::AcceptSpokeUpdateResponse,
6956                crate::model::OperationMetadata,
6957            >;
6958            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6959            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6960
6961            let stub = self.0.stub.clone();
6962            let mut options = self.0.options.clone();
6963            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6964            let query = move |name| {
6965                let stub = stub.clone();
6966                let options = options.clone();
6967                async {
6968                    let op = GetOperation::new(stub)
6969                        .set_name(name)
6970                        .with_options(options)
6971                        .send()
6972                        .await?;
6973                    Ok(Operation::new(op))
6974                }
6975            };
6976
6977            let start = move || async {
6978                let op = self.send().await?;
6979                Ok(Operation::new(op))
6980            };
6981
6982            google_cloud_lro::internal::new_poller(
6983                polling_error_policy,
6984                polling_backoff_policy,
6985                start,
6986                query,
6987            )
6988        }
6989
6990        /// Sets the value of [name][crate::model::AcceptSpokeUpdateRequest::name].
6991        ///
6992        /// This is a **required** field for requests.
6993        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6994            self.0.request.name = v.into();
6995            self
6996        }
6997
6998        /// Sets the value of [spoke_uri][crate::model::AcceptSpokeUpdateRequest::spoke_uri].
6999        ///
7000        /// This is a **required** field for requests.
7001        pub fn set_spoke_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
7002            self.0.request.spoke_uri = v.into();
7003            self
7004        }
7005
7006        /// Sets the value of [spoke_etag][crate::model::AcceptSpokeUpdateRequest::spoke_etag].
7007        ///
7008        /// This is a **required** field for requests.
7009        pub fn set_spoke_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
7010            self.0.request.spoke_etag = v.into();
7011            self
7012        }
7013
7014        /// Sets the value of [request_id][crate::model::AcceptSpokeUpdateRequest::request_id].
7015        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
7016            self.0.request.request_id = v.into();
7017            self
7018        }
7019    }
7020
7021    #[doc(hidden)]
7022    impl crate::RequestBuilder for AcceptSpokeUpdate {
7023        fn request_options(&mut self) -> &mut crate::RequestOptions {
7024            &mut self.0.options
7025        }
7026    }
7027
7028    /// The request builder for [HubService::reject_spoke_update][crate::client::HubService::reject_spoke_update] calls.
7029    ///
7030    /// # Example
7031    /// ```
7032    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::RejectSpokeUpdate;
7033    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
7034    /// use google_cloud_lro::Poller;
7035    ///
7036    /// let builder = prepare_request_builder();
7037    /// let response = builder.poller().until_done().await?;
7038    /// # Ok(()) }
7039    ///
7040    /// fn prepare_request_builder() -> RejectSpokeUpdate {
7041    ///   # panic!();
7042    ///   // ... details omitted ...
7043    /// }
7044    /// ```
7045    #[derive(Clone, Debug)]
7046    pub struct RejectSpokeUpdate(RequestBuilder<crate::model::RejectSpokeUpdateRequest>);
7047
7048    impl RejectSpokeUpdate {
7049        pub(crate) fn new(
7050            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7051        ) -> Self {
7052            Self(RequestBuilder::new(stub))
7053        }
7054
7055        /// Sets the full request, replacing any prior values.
7056        pub fn with_request<V: Into<crate::model::RejectSpokeUpdateRequest>>(
7057            mut self,
7058            v: V,
7059        ) -> Self {
7060            self.0.request = v.into();
7061            self
7062        }
7063
7064        /// Sets all the options, replacing any prior values.
7065        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7066            self.0.options = v.into();
7067            self
7068        }
7069
7070        /// Sends the request.
7071        ///
7072        /// # Long running operations
7073        ///
7074        /// This starts, but does not poll, a longrunning operation. More information
7075        /// on [reject_spoke_update][crate::client::HubService::reject_spoke_update].
7076        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7077            (*self.0.stub)
7078                .reject_spoke_update(self.0.request, self.0.options)
7079                .await
7080                .map(crate::Response::into_body)
7081        }
7082
7083        /// Creates a [Poller][google_cloud_lro::Poller] to work with `reject_spoke_update`.
7084        pub fn poller(
7085            self,
7086        ) -> impl google_cloud_lro::Poller<
7087            crate::model::RejectSpokeUpdateResponse,
7088            crate::model::OperationMetadata,
7089        > {
7090            type Operation = google_cloud_lro::internal::Operation<
7091                crate::model::RejectSpokeUpdateResponse,
7092                crate::model::OperationMetadata,
7093            >;
7094            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7095            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7096
7097            let stub = self.0.stub.clone();
7098            let mut options = self.0.options.clone();
7099            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
7100            let query = move |name| {
7101                let stub = stub.clone();
7102                let options = options.clone();
7103                async {
7104                    let op = GetOperation::new(stub)
7105                        .set_name(name)
7106                        .with_options(options)
7107                        .send()
7108                        .await?;
7109                    Ok(Operation::new(op))
7110                }
7111            };
7112
7113            let start = move || async {
7114                let op = self.send().await?;
7115                Ok(Operation::new(op))
7116            };
7117
7118            google_cloud_lro::internal::new_poller(
7119                polling_error_policy,
7120                polling_backoff_policy,
7121                start,
7122                query,
7123            )
7124        }
7125
7126        /// Sets the value of [name][crate::model::RejectSpokeUpdateRequest::name].
7127        ///
7128        /// This is a **required** field for requests.
7129        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7130            self.0.request.name = v.into();
7131            self
7132        }
7133
7134        /// Sets the value of [spoke_uri][crate::model::RejectSpokeUpdateRequest::spoke_uri].
7135        ///
7136        /// This is a **required** field for requests.
7137        pub fn set_spoke_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
7138            self.0.request.spoke_uri = v.into();
7139            self
7140        }
7141
7142        /// Sets the value of [spoke_etag][crate::model::RejectSpokeUpdateRequest::spoke_etag].
7143        ///
7144        /// This is a **required** field for requests.
7145        pub fn set_spoke_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
7146            self.0.request.spoke_etag = v.into();
7147            self
7148        }
7149
7150        /// Sets the value of [details][crate::model::RejectSpokeUpdateRequest::details].
7151        pub fn set_details<T: Into<std::string::String>>(mut self, v: T) -> Self {
7152            self.0.request.details = v.into();
7153            self
7154        }
7155
7156        /// Sets the value of [request_id][crate::model::RejectSpokeUpdateRequest::request_id].
7157        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
7158            self.0.request.request_id = v.into();
7159            self
7160        }
7161    }
7162
7163    #[doc(hidden)]
7164    impl crate::RequestBuilder for RejectSpokeUpdate {
7165        fn request_options(&mut self) -> &mut crate::RequestOptions {
7166            &mut self.0.options
7167        }
7168    }
7169
7170    /// The request builder for [HubService::delete_spoke][crate::client::HubService::delete_spoke] calls.
7171    ///
7172    /// # Example
7173    /// ```
7174    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::DeleteSpoke;
7175    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
7176    /// use google_cloud_lro::Poller;
7177    ///
7178    /// let builder = prepare_request_builder();
7179    /// let response = builder.poller().until_done().await?;
7180    /// # Ok(()) }
7181    ///
7182    /// fn prepare_request_builder() -> DeleteSpoke {
7183    ///   # panic!();
7184    ///   // ... details omitted ...
7185    /// }
7186    /// ```
7187    #[derive(Clone, Debug)]
7188    pub struct DeleteSpoke(RequestBuilder<crate::model::DeleteSpokeRequest>);
7189
7190    impl DeleteSpoke {
7191        pub(crate) fn new(
7192            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7193        ) -> Self {
7194            Self(RequestBuilder::new(stub))
7195        }
7196
7197        /// Sets the full request, replacing any prior values.
7198        pub fn with_request<V: Into<crate::model::DeleteSpokeRequest>>(mut self, v: V) -> Self {
7199            self.0.request = v.into();
7200            self
7201        }
7202
7203        /// Sets all the options, replacing any prior values.
7204        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7205            self.0.options = v.into();
7206            self
7207        }
7208
7209        /// Sends the request.
7210        ///
7211        /// # Long running operations
7212        ///
7213        /// This starts, but does not poll, a longrunning operation. More information
7214        /// on [delete_spoke][crate::client::HubService::delete_spoke].
7215        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7216            (*self.0.stub)
7217                .delete_spoke(self.0.request, self.0.options)
7218                .await
7219                .map(crate::Response::into_body)
7220        }
7221
7222        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_spoke`.
7223        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
7224            type Operation =
7225                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
7226            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7227            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7228
7229            let stub = self.0.stub.clone();
7230            let mut options = self.0.options.clone();
7231            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
7232            let query = move |name| {
7233                let stub = stub.clone();
7234                let options = options.clone();
7235                async {
7236                    let op = GetOperation::new(stub)
7237                        .set_name(name)
7238                        .with_options(options)
7239                        .send()
7240                        .await?;
7241                    Ok(Operation::new(op))
7242                }
7243            };
7244
7245            let start = move || async {
7246                let op = self.send().await?;
7247                Ok(Operation::new(op))
7248            };
7249
7250            google_cloud_lro::internal::new_unit_response_poller(
7251                polling_error_policy,
7252                polling_backoff_policy,
7253                start,
7254                query,
7255            )
7256        }
7257
7258        /// Sets the value of [name][crate::model::DeleteSpokeRequest::name].
7259        ///
7260        /// This is a **required** field for requests.
7261        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7262            self.0.request.name = v.into();
7263            self
7264        }
7265
7266        /// Sets the value of [request_id][crate::model::DeleteSpokeRequest::request_id].
7267        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
7268            self.0.request.request_id = v.into();
7269            self
7270        }
7271    }
7272
7273    #[doc(hidden)]
7274    impl crate::RequestBuilder for DeleteSpoke {
7275        fn request_options(&mut self) -> &mut crate::RequestOptions {
7276            &mut self.0.options
7277        }
7278    }
7279
7280    /// The request builder for [HubService::get_route_table][crate::client::HubService::get_route_table] calls.
7281    ///
7282    /// # Example
7283    /// ```
7284    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::GetRouteTable;
7285    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
7286    ///
7287    /// let builder = prepare_request_builder();
7288    /// let response = builder.send().await?;
7289    /// # Ok(()) }
7290    ///
7291    /// fn prepare_request_builder() -> GetRouteTable {
7292    ///   # panic!();
7293    ///   // ... details omitted ...
7294    /// }
7295    /// ```
7296    #[derive(Clone, Debug)]
7297    pub struct GetRouteTable(RequestBuilder<crate::model::GetRouteTableRequest>);
7298
7299    impl GetRouteTable {
7300        pub(crate) fn new(
7301            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7302        ) -> Self {
7303            Self(RequestBuilder::new(stub))
7304        }
7305
7306        /// Sets the full request, replacing any prior values.
7307        pub fn with_request<V: Into<crate::model::GetRouteTableRequest>>(mut self, v: V) -> Self {
7308            self.0.request = v.into();
7309            self
7310        }
7311
7312        /// Sets all the options, replacing any prior values.
7313        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7314            self.0.options = v.into();
7315            self
7316        }
7317
7318        /// Sends the request.
7319        pub async fn send(self) -> Result<crate::model::RouteTable> {
7320            (*self.0.stub)
7321                .get_route_table(self.0.request, self.0.options)
7322                .await
7323                .map(crate::Response::into_body)
7324        }
7325
7326        /// Sets the value of [name][crate::model::GetRouteTableRequest::name].
7327        ///
7328        /// This is a **required** field for requests.
7329        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7330            self.0.request.name = v.into();
7331            self
7332        }
7333    }
7334
7335    #[doc(hidden)]
7336    impl crate::RequestBuilder for GetRouteTable {
7337        fn request_options(&mut self) -> &mut crate::RequestOptions {
7338            &mut self.0.options
7339        }
7340    }
7341
7342    /// The request builder for [HubService::get_route][crate::client::HubService::get_route] calls.
7343    ///
7344    /// # Example
7345    /// ```
7346    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::GetRoute;
7347    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
7348    ///
7349    /// let builder = prepare_request_builder();
7350    /// let response = builder.send().await?;
7351    /// # Ok(()) }
7352    ///
7353    /// fn prepare_request_builder() -> GetRoute {
7354    ///   # panic!();
7355    ///   // ... details omitted ...
7356    /// }
7357    /// ```
7358    #[derive(Clone, Debug)]
7359    pub struct GetRoute(RequestBuilder<crate::model::GetRouteRequest>);
7360
7361    impl GetRoute {
7362        pub(crate) fn new(
7363            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7364        ) -> Self {
7365            Self(RequestBuilder::new(stub))
7366        }
7367
7368        /// Sets the full request, replacing any prior values.
7369        pub fn with_request<V: Into<crate::model::GetRouteRequest>>(mut self, v: V) -> Self {
7370            self.0.request = v.into();
7371            self
7372        }
7373
7374        /// Sets all the options, replacing any prior values.
7375        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7376            self.0.options = v.into();
7377            self
7378        }
7379
7380        /// Sends the request.
7381        pub async fn send(self) -> Result<crate::model::Route> {
7382            (*self.0.stub)
7383                .get_route(self.0.request, self.0.options)
7384                .await
7385                .map(crate::Response::into_body)
7386        }
7387
7388        /// Sets the value of [name][crate::model::GetRouteRequest::name].
7389        ///
7390        /// This is a **required** field for requests.
7391        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7392            self.0.request.name = v.into();
7393            self
7394        }
7395    }
7396
7397    #[doc(hidden)]
7398    impl crate::RequestBuilder for GetRoute {
7399        fn request_options(&mut self) -> &mut crate::RequestOptions {
7400            &mut self.0.options
7401        }
7402    }
7403
7404    /// The request builder for [HubService::list_routes][crate::client::HubService::list_routes] calls.
7405    ///
7406    /// # Example
7407    /// ```
7408    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::ListRoutes;
7409    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
7410    /// use google_cloud_gax::paginator::ItemPaginator;
7411    ///
7412    /// let builder = prepare_request_builder();
7413    /// let mut items = builder.by_item();
7414    /// while let Some(result) = items.next().await {
7415    ///   let item = result?;
7416    /// }
7417    /// # Ok(()) }
7418    ///
7419    /// fn prepare_request_builder() -> ListRoutes {
7420    ///   # panic!();
7421    ///   // ... details omitted ...
7422    /// }
7423    /// ```
7424    #[derive(Clone, Debug)]
7425    pub struct ListRoutes(RequestBuilder<crate::model::ListRoutesRequest>);
7426
7427    impl ListRoutes {
7428        pub(crate) fn new(
7429            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7430        ) -> Self {
7431            Self(RequestBuilder::new(stub))
7432        }
7433
7434        /// Sets the full request, replacing any prior values.
7435        pub fn with_request<V: Into<crate::model::ListRoutesRequest>>(mut self, v: V) -> Self {
7436            self.0.request = v.into();
7437            self
7438        }
7439
7440        /// Sets all the options, replacing any prior values.
7441        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7442            self.0.options = v.into();
7443            self
7444        }
7445
7446        /// Sends the request.
7447        pub async fn send(self) -> Result<crate::model::ListRoutesResponse> {
7448            (*self.0.stub)
7449                .list_routes(self.0.request, self.0.options)
7450                .await
7451                .map(crate::Response::into_body)
7452        }
7453
7454        /// Streams each page in the collection.
7455        pub fn by_page(
7456            self,
7457        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListRoutesResponse, crate::Error>
7458        {
7459            use std::clone::Clone;
7460            let token = self.0.request.page_token.clone();
7461            let execute = move |token: String| {
7462                let mut builder = self.clone();
7463                builder.0.request = builder.0.request.set_page_token(token);
7464                builder.send()
7465            };
7466            google_cloud_gax::paginator::internal::new_paginator(token, execute)
7467        }
7468
7469        /// Streams each item in the collection.
7470        pub fn by_item(
7471            self,
7472        ) -> impl google_cloud_gax::paginator::ItemPaginator<
7473            crate::model::ListRoutesResponse,
7474            crate::Error,
7475        > {
7476            use google_cloud_gax::paginator::Paginator;
7477            self.by_page().items()
7478        }
7479
7480        /// Sets the value of [parent][crate::model::ListRoutesRequest::parent].
7481        ///
7482        /// This is a **required** field for requests.
7483        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7484            self.0.request.parent = v.into();
7485            self
7486        }
7487
7488        /// Sets the value of [page_size][crate::model::ListRoutesRequest::page_size].
7489        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7490            self.0.request.page_size = v.into();
7491            self
7492        }
7493
7494        /// Sets the value of [page_token][crate::model::ListRoutesRequest::page_token].
7495        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7496            self.0.request.page_token = v.into();
7497            self
7498        }
7499
7500        /// Sets the value of [filter][crate::model::ListRoutesRequest::filter].
7501        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7502            self.0.request.filter = v.into();
7503            self
7504        }
7505
7506        /// Sets the value of [order_by][crate::model::ListRoutesRequest::order_by].
7507        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
7508            self.0.request.order_by = v.into();
7509            self
7510        }
7511    }
7512
7513    #[doc(hidden)]
7514    impl crate::RequestBuilder for ListRoutes {
7515        fn request_options(&mut self) -> &mut crate::RequestOptions {
7516            &mut self.0.options
7517        }
7518    }
7519
7520    /// The request builder for [HubService::list_route_tables][crate::client::HubService::list_route_tables] calls.
7521    ///
7522    /// # Example
7523    /// ```
7524    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::ListRouteTables;
7525    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
7526    /// use google_cloud_gax::paginator::ItemPaginator;
7527    ///
7528    /// let builder = prepare_request_builder();
7529    /// let mut items = builder.by_item();
7530    /// while let Some(result) = items.next().await {
7531    ///   let item = result?;
7532    /// }
7533    /// # Ok(()) }
7534    ///
7535    /// fn prepare_request_builder() -> ListRouteTables {
7536    ///   # panic!();
7537    ///   // ... details omitted ...
7538    /// }
7539    /// ```
7540    #[derive(Clone, Debug)]
7541    pub struct ListRouteTables(RequestBuilder<crate::model::ListRouteTablesRequest>);
7542
7543    impl ListRouteTables {
7544        pub(crate) fn new(
7545            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7546        ) -> Self {
7547            Self(RequestBuilder::new(stub))
7548        }
7549
7550        /// Sets the full request, replacing any prior values.
7551        pub fn with_request<V: Into<crate::model::ListRouteTablesRequest>>(mut self, v: V) -> Self {
7552            self.0.request = v.into();
7553            self
7554        }
7555
7556        /// Sets all the options, replacing any prior values.
7557        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7558            self.0.options = v.into();
7559            self
7560        }
7561
7562        /// Sends the request.
7563        pub async fn send(self) -> Result<crate::model::ListRouteTablesResponse> {
7564            (*self.0.stub)
7565                .list_route_tables(self.0.request, self.0.options)
7566                .await
7567                .map(crate::Response::into_body)
7568        }
7569
7570        /// Streams each page in the collection.
7571        pub fn by_page(
7572            self,
7573        ) -> impl google_cloud_gax::paginator::Paginator<
7574            crate::model::ListRouteTablesResponse,
7575            crate::Error,
7576        > {
7577            use std::clone::Clone;
7578            let token = self.0.request.page_token.clone();
7579            let execute = move |token: String| {
7580                let mut builder = self.clone();
7581                builder.0.request = builder.0.request.set_page_token(token);
7582                builder.send()
7583            };
7584            google_cloud_gax::paginator::internal::new_paginator(token, execute)
7585        }
7586
7587        /// Streams each item in the collection.
7588        pub fn by_item(
7589            self,
7590        ) -> impl google_cloud_gax::paginator::ItemPaginator<
7591            crate::model::ListRouteTablesResponse,
7592            crate::Error,
7593        > {
7594            use google_cloud_gax::paginator::Paginator;
7595            self.by_page().items()
7596        }
7597
7598        /// Sets the value of [parent][crate::model::ListRouteTablesRequest::parent].
7599        ///
7600        /// This is a **required** field for requests.
7601        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7602            self.0.request.parent = v.into();
7603            self
7604        }
7605
7606        /// Sets the value of [page_size][crate::model::ListRouteTablesRequest::page_size].
7607        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7608            self.0.request.page_size = v.into();
7609            self
7610        }
7611
7612        /// Sets the value of [page_token][crate::model::ListRouteTablesRequest::page_token].
7613        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7614            self.0.request.page_token = v.into();
7615            self
7616        }
7617
7618        /// Sets the value of [filter][crate::model::ListRouteTablesRequest::filter].
7619        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7620            self.0.request.filter = v.into();
7621            self
7622        }
7623
7624        /// Sets the value of [order_by][crate::model::ListRouteTablesRequest::order_by].
7625        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
7626            self.0.request.order_by = v.into();
7627            self
7628        }
7629    }
7630
7631    #[doc(hidden)]
7632    impl crate::RequestBuilder for ListRouteTables {
7633        fn request_options(&mut self) -> &mut crate::RequestOptions {
7634            &mut self.0.options
7635        }
7636    }
7637
7638    /// The request builder for [HubService::get_group][crate::client::HubService::get_group] calls.
7639    ///
7640    /// # Example
7641    /// ```
7642    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::GetGroup;
7643    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
7644    ///
7645    /// let builder = prepare_request_builder();
7646    /// let response = builder.send().await?;
7647    /// # Ok(()) }
7648    ///
7649    /// fn prepare_request_builder() -> GetGroup {
7650    ///   # panic!();
7651    ///   // ... details omitted ...
7652    /// }
7653    /// ```
7654    #[derive(Clone, Debug)]
7655    pub struct GetGroup(RequestBuilder<crate::model::GetGroupRequest>);
7656
7657    impl GetGroup {
7658        pub(crate) fn new(
7659            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7660        ) -> Self {
7661            Self(RequestBuilder::new(stub))
7662        }
7663
7664        /// Sets the full request, replacing any prior values.
7665        pub fn with_request<V: Into<crate::model::GetGroupRequest>>(mut self, v: V) -> Self {
7666            self.0.request = v.into();
7667            self
7668        }
7669
7670        /// Sets all the options, replacing any prior values.
7671        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7672            self.0.options = v.into();
7673            self
7674        }
7675
7676        /// Sends the request.
7677        pub async fn send(self) -> Result<crate::model::Group> {
7678            (*self.0.stub)
7679                .get_group(self.0.request, self.0.options)
7680                .await
7681                .map(crate::Response::into_body)
7682        }
7683
7684        /// Sets the value of [name][crate::model::GetGroupRequest::name].
7685        ///
7686        /// This is a **required** field for requests.
7687        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7688            self.0.request.name = v.into();
7689            self
7690        }
7691    }
7692
7693    #[doc(hidden)]
7694    impl crate::RequestBuilder for GetGroup {
7695        fn request_options(&mut self) -> &mut crate::RequestOptions {
7696            &mut self.0.options
7697        }
7698    }
7699
7700    /// The request builder for [HubService::list_groups][crate::client::HubService::list_groups] calls.
7701    ///
7702    /// # Example
7703    /// ```
7704    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::ListGroups;
7705    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
7706    /// use google_cloud_gax::paginator::ItemPaginator;
7707    ///
7708    /// let builder = prepare_request_builder();
7709    /// let mut items = builder.by_item();
7710    /// while let Some(result) = items.next().await {
7711    ///   let item = result?;
7712    /// }
7713    /// # Ok(()) }
7714    ///
7715    /// fn prepare_request_builder() -> ListGroups {
7716    ///   # panic!();
7717    ///   // ... details omitted ...
7718    /// }
7719    /// ```
7720    #[derive(Clone, Debug)]
7721    pub struct ListGroups(RequestBuilder<crate::model::ListGroupsRequest>);
7722
7723    impl ListGroups {
7724        pub(crate) fn new(
7725            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7726        ) -> Self {
7727            Self(RequestBuilder::new(stub))
7728        }
7729
7730        /// Sets the full request, replacing any prior values.
7731        pub fn with_request<V: Into<crate::model::ListGroupsRequest>>(mut self, v: V) -> Self {
7732            self.0.request = v.into();
7733            self
7734        }
7735
7736        /// Sets all the options, replacing any prior values.
7737        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7738            self.0.options = v.into();
7739            self
7740        }
7741
7742        /// Sends the request.
7743        pub async fn send(self) -> Result<crate::model::ListGroupsResponse> {
7744            (*self.0.stub)
7745                .list_groups(self.0.request, self.0.options)
7746                .await
7747                .map(crate::Response::into_body)
7748        }
7749
7750        /// Streams each page in the collection.
7751        pub fn by_page(
7752            self,
7753        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListGroupsResponse, crate::Error>
7754        {
7755            use std::clone::Clone;
7756            let token = self.0.request.page_token.clone();
7757            let execute = move |token: String| {
7758                let mut builder = self.clone();
7759                builder.0.request = builder.0.request.set_page_token(token);
7760                builder.send()
7761            };
7762            google_cloud_gax::paginator::internal::new_paginator(token, execute)
7763        }
7764
7765        /// Streams each item in the collection.
7766        pub fn by_item(
7767            self,
7768        ) -> impl google_cloud_gax::paginator::ItemPaginator<
7769            crate::model::ListGroupsResponse,
7770            crate::Error,
7771        > {
7772            use google_cloud_gax::paginator::Paginator;
7773            self.by_page().items()
7774        }
7775
7776        /// Sets the value of [parent][crate::model::ListGroupsRequest::parent].
7777        ///
7778        /// This is a **required** field for requests.
7779        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7780            self.0.request.parent = v.into();
7781            self
7782        }
7783
7784        /// Sets the value of [page_size][crate::model::ListGroupsRequest::page_size].
7785        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7786            self.0.request.page_size = v.into();
7787            self
7788        }
7789
7790        /// Sets the value of [page_token][crate::model::ListGroupsRequest::page_token].
7791        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7792            self.0.request.page_token = v.into();
7793            self
7794        }
7795
7796        /// Sets the value of [filter][crate::model::ListGroupsRequest::filter].
7797        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7798            self.0.request.filter = v.into();
7799            self
7800        }
7801
7802        /// Sets the value of [order_by][crate::model::ListGroupsRequest::order_by].
7803        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
7804            self.0.request.order_by = v.into();
7805            self
7806        }
7807    }
7808
7809    #[doc(hidden)]
7810    impl crate::RequestBuilder for ListGroups {
7811        fn request_options(&mut self) -> &mut crate::RequestOptions {
7812            &mut self.0.options
7813        }
7814    }
7815
7816    /// The request builder for [HubService::update_group][crate::client::HubService::update_group] calls.
7817    ///
7818    /// # Example
7819    /// ```
7820    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::UpdateGroup;
7821    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
7822    /// use google_cloud_lro::Poller;
7823    ///
7824    /// let builder = prepare_request_builder();
7825    /// let response = builder.poller().until_done().await?;
7826    /// # Ok(()) }
7827    ///
7828    /// fn prepare_request_builder() -> UpdateGroup {
7829    ///   # panic!();
7830    ///   // ... details omitted ...
7831    /// }
7832    /// ```
7833    #[derive(Clone, Debug)]
7834    pub struct UpdateGroup(RequestBuilder<crate::model::UpdateGroupRequest>);
7835
7836    impl UpdateGroup {
7837        pub(crate) fn new(
7838            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7839        ) -> Self {
7840            Self(RequestBuilder::new(stub))
7841        }
7842
7843        /// Sets the full request, replacing any prior values.
7844        pub fn with_request<V: Into<crate::model::UpdateGroupRequest>>(mut self, v: V) -> Self {
7845            self.0.request = v.into();
7846            self
7847        }
7848
7849        /// Sets all the options, replacing any prior values.
7850        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7851            self.0.options = v.into();
7852            self
7853        }
7854
7855        /// Sends the request.
7856        ///
7857        /// # Long running operations
7858        ///
7859        /// This starts, but does not poll, a longrunning operation. More information
7860        /// on [update_group][crate::client::HubService::update_group].
7861        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7862            (*self.0.stub)
7863                .update_group(self.0.request, self.0.options)
7864                .await
7865                .map(crate::Response::into_body)
7866        }
7867
7868        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_group`.
7869        pub fn poller(
7870            self,
7871        ) -> impl google_cloud_lro::Poller<crate::model::Group, crate::model::OperationMetadata>
7872        {
7873            type Operation = google_cloud_lro::internal::Operation<
7874                crate::model::Group,
7875                crate::model::OperationMetadata,
7876            >;
7877            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7878            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7879
7880            let stub = self.0.stub.clone();
7881            let mut options = self.0.options.clone();
7882            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
7883            let query = move |name| {
7884                let stub = stub.clone();
7885                let options = options.clone();
7886                async {
7887                    let op = GetOperation::new(stub)
7888                        .set_name(name)
7889                        .with_options(options)
7890                        .send()
7891                        .await?;
7892                    Ok(Operation::new(op))
7893                }
7894            };
7895
7896            let start = move || async {
7897                let op = self.send().await?;
7898                Ok(Operation::new(op))
7899            };
7900
7901            google_cloud_lro::internal::new_poller(
7902                polling_error_policy,
7903                polling_backoff_policy,
7904                start,
7905                query,
7906            )
7907        }
7908
7909        /// Sets the value of [update_mask][crate::model::UpdateGroupRequest::update_mask].
7910        pub fn set_update_mask<T>(mut self, v: T) -> Self
7911        where
7912            T: std::convert::Into<wkt::FieldMask>,
7913        {
7914            self.0.request.update_mask = std::option::Option::Some(v.into());
7915            self
7916        }
7917
7918        /// Sets or clears the value of [update_mask][crate::model::UpdateGroupRequest::update_mask].
7919        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7920        where
7921            T: std::convert::Into<wkt::FieldMask>,
7922        {
7923            self.0.request.update_mask = v.map(|x| x.into());
7924            self
7925        }
7926
7927        /// Sets the value of [group][crate::model::UpdateGroupRequest::group].
7928        ///
7929        /// This is a **required** field for requests.
7930        pub fn set_group<T>(mut self, v: T) -> Self
7931        where
7932            T: std::convert::Into<crate::model::Group>,
7933        {
7934            self.0.request.group = std::option::Option::Some(v.into());
7935            self
7936        }
7937
7938        /// Sets or clears the value of [group][crate::model::UpdateGroupRequest::group].
7939        ///
7940        /// This is a **required** field for requests.
7941        pub fn set_or_clear_group<T>(mut self, v: std::option::Option<T>) -> Self
7942        where
7943            T: std::convert::Into<crate::model::Group>,
7944        {
7945            self.0.request.group = v.map(|x| x.into());
7946            self
7947        }
7948
7949        /// Sets the value of [request_id][crate::model::UpdateGroupRequest::request_id].
7950        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
7951            self.0.request.request_id = v.into();
7952            self
7953        }
7954    }
7955
7956    #[doc(hidden)]
7957    impl crate::RequestBuilder for UpdateGroup {
7958        fn request_options(&mut self) -> &mut crate::RequestOptions {
7959            &mut self.0.options
7960        }
7961    }
7962
7963    /// The request builder for [HubService::list_locations][crate::client::HubService::list_locations] calls.
7964    ///
7965    /// # Example
7966    /// ```
7967    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::ListLocations;
7968    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
7969    /// use google_cloud_gax::paginator::ItemPaginator;
7970    ///
7971    /// let builder = prepare_request_builder();
7972    /// let mut items = builder.by_item();
7973    /// while let Some(result) = items.next().await {
7974    ///   let item = result?;
7975    /// }
7976    /// # Ok(()) }
7977    ///
7978    /// fn prepare_request_builder() -> ListLocations {
7979    ///   # panic!();
7980    ///   // ... details omitted ...
7981    /// }
7982    /// ```
7983    #[derive(Clone, Debug)]
7984    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
7985
7986    impl ListLocations {
7987        pub(crate) fn new(
7988            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
7989        ) -> Self {
7990            Self(RequestBuilder::new(stub))
7991        }
7992
7993        /// Sets the full request, replacing any prior values.
7994        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
7995            mut self,
7996            v: V,
7997        ) -> Self {
7998            self.0.request = v.into();
7999            self
8000        }
8001
8002        /// Sets all the options, replacing any prior values.
8003        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8004            self.0.options = v.into();
8005            self
8006        }
8007
8008        /// Sends the request.
8009        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
8010            (*self.0.stub)
8011                .list_locations(self.0.request, self.0.options)
8012                .await
8013                .map(crate::Response::into_body)
8014        }
8015
8016        /// Streams each page in the collection.
8017        pub fn by_page(
8018            self,
8019        ) -> impl google_cloud_gax::paginator::Paginator<
8020            google_cloud_location::model::ListLocationsResponse,
8021            crate::Error,
8022        > {
8023            use std::clone::Clone;
8024            let token = self.0.request.page_token.clone();
8025            let execute = move |token: String| {
8026                let mut builder = self.clone();
8027                builder.0.request = builder.0.request.set_page_token(token);
8028                builder.send()
8029            };
8030            google_cloud_gax::paginator::internal::new_paginator(token, execute)
8031        }
8032
8033        /// Streams each item in the collection.
8034        pub fn by_item(
8035            self,
8036        ) -> impl google_cloud_gax::paginator::ItemPaginator<
8037            google_cloud_location::model::ListLocationsResponse,
8038            crate::Error,
8039        > {
8040            use google_cloud_gax::paginator::Paginator;
8041            self.by_page().items()
8042        }
8043
8044        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
8045        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8046            self.0.request.name = v.into();
8047            self
8048        }
8049
8050        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
8051        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8052            self.0.request.filter = v.into();
8053            self
8054        }
8055
8056        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
8057        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8058            self.0.request.page_size = v.into();
8059            self
8060        }
8061
8062        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
8063        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8064            self.0.request.page_token = v.into();
8065            self
8066        }
8067    }
8068
8069    #[doc(hidden)]
8070    impl crate::RequestBuilder for ListLocations {
8071        fn request_options(&mut self) -> &mut crate::RequestOptions {
8072            &mut self.0.options
8073        }
8074    }
8075
8076    /// The request builder for [HubService::get_location][crate::client::HubService::get_location] calls.
8077    ///
8078    /// # Example
8079    /// ```
8080    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::GetLocation;
8081    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
8082    ///
8083    /// let builder = prepare_request_builder();
8084    /// let response = builder.send().await?;
8085    /// # Ok(()) }
8086    ///
8087    /// fn prepare_request_builder() -> GetLocation {
8088    ///   # panic!();
8089    ///   // ... details omitted ...
8090    /// }
8091    /// ```
8092    #[derive(Clone, Debug)]
8093    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
8094
8095    impl GetLocation {
8096        pub(crate) fn new(
8097            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8098        ) -> Self {
8099            Self(RequestBuilder::new(stub))
8100        }
8101
8102        /// Sets the full request, replacing any prior values.
8103        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
8104            mut self,
8105            v: V,
8106        ) -> Self {
8107            self.0.request = v.into();
8108            self
8109        }
8110
8111        /// Sets all the options, replacing any prior values.
8112        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8113            self.0.options = v.into();
8114            self
8115        }
8116
8117        /// Sends the request.
8118        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
8119            (*self.0.stub)
8120                .get_location(self.0.request, self.0.options)
8121                .await
8122                .map(crate::Response::into_body)
8123        }
8124
8125        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
8126        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8127            self.0.request.name = v.into();
8128            self
8129        }
8130    }
8131
8132    #[doc(hidden)]
8133    impl crate::RequestBuilder for GetLocation {
8134        fn request_options(&mut self) -> &mut crate::RequestOptions {
8135            &mut self.0.options
8136        }
8137    }
8138
8139    /// The request builder for [HubService::set_iam_policy][crate::client::HubService::set_iam_policy] calls.
8140    ///
8141    /// # Example
8142    /// ```
8143    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::SetIamPolicy;
8144    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
8145    ///
8146    /// let builder = prepare_request_builder();
8147    /// let response = builder.send().await?;
8148    /// # Ok(()) }
8149    ///
8150    /// fn prepare_request_builder() -> SetIamPolicy {
8151    ///   # panic!();
8152    ///   // ... details omitted ...
8153    /// }
8154    /// ```
8155    #[derive(Clone, Debug)]
8156    pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
8157
8158    impl SetIamPolicy {
8159        pub(crate) fn new(
8160            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8161        ) -> Self {
8162            Self(RequestBuilder::new(stub))
8163        }
8164
8165        /// Sets the full request, replacing any prior values.
8166        pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
8167            mut self,
8168            v: V,
8169        ) -> Self {
8170            self.0.request = v.into();
8171            self
8172        }
8173
8174        /// Sets all the options, replacing any prior values.
8175        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8176            self.0.options = v.into();
8177            self
8178        }
8179
8180        /// Sends the request.
8181        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
8182            (*self.0.stub)
8183                .set_iam_policy(self.0.request, self.0.options)
8184                .await
8185                .map(crate::Response::into_body)
8186        }
8187
8188        /// Sets the value of [resource][google_cloud_iam_v1::model::SetIamPolicyRequest::resource].
8189        ///
8190        /// This is a **required** field for requests.
8191        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
8192            self.0.request.resource = v.into();
8193            self
8194        }
8195
8196        /// Sets the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
8197        ///
8198        /// This is a **required** field for requests.
8199        pub fn set_policy<T>(mut self, v: T) -> Self
8200        where
8201            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
8202        {
8203            self.0.request.policy = std::option::Option::Some(v.into());
8204            self
8205        }
8206
8207        /// Sets or clears the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
8208        ///
8209        /// This is a **required** field for requests.
8210        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
8211        where
8212            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
8213        {
8214            self.0.request.policy = v.map(|x| x.into());
8215            self
8216        }
8217
8218        /// Sets the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
8219        pub fn set_update_mask<T>(mut self, v: T) -> Self
8220        where
8221            T: std::convert::Into<wkt::FieldMask>,
8222        {
8223            self.0.request.update_mask = std::option::Option::Some(v.into());
8224            self
8225        }
8226
8227        /// Sets or clears the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
8228        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
8229        where
8230            T: std::convert::Into<wkt::FieldMask>,
8231        {
8232            self.0.request.update_mask = v.map(|x| x.into());
8233            self
8234        }
8235    }
8236
8237    #[doc(hidden)]
8238    impl crate::RequestBuilder for SetIamPolicy {
8239        fn request_options(&mut self) -> &mut crate::RequestOptions {
8240            &mut self.0.options
8241        }
8242    }
8243
8244    /// The request builder for [HubService::get_iam_policy][crate::client::HubService::get_iam_policy] calls.
8245    ///
8246    /// # Example
8247    /// ```
8248    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::GetIamPolicy;
8249    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
8250    ///
8251    /// let builder = prepare_request_builder();
8252    /// let response = builder.send().await?;
8253    /// # Ok(()) }
8254    ///
8255    /// fn prepare_request_builder() -> GetIamPolicy {
8256    ///   # panic!();
8257    ///   // ... details omitted ...
8258    /// }
8259    /// ```
8260    #[derive(Clone, Debug)]
8261    pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
8262
8263    impl GetIamPolicy {
8264        pub(crate) fn new(
8265            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8266        ) -> Self {
8267            Self(RequestBuilder::new(stub))
8268        }
8269
8270        /// Sets the full request, replacing any prior values.
8271        pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
8272            mut self,
8273            v: V,
8274        ) -> Self {
8275            self.0.request = v.into();
8276            self
8277        }
8278
8279        /// Sets all the options, replacing any prior values.
8280        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8281            self.0.options = v.into();
8282            self
8283        }
8284
8285        /// Sends the request.
8286        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
8287            (*self.0.stub)
8288                .get_iam_policy(self.0.request, self.0.options)
8289                .await
8290                .map(crate::Response::into_body)
8291        }
8292
8293        /// Sets the value of [resource][google_cloud_iam_v1::model::GetIamPolicyRequest::resource].
8294        ///
8295        /// This is a **required** field for requests.
8296        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
8297            self.0.request.resource = v.into();
8298            self
8299        }
8300
8301        /// Sets the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
8302        pub fn set_options<T>(mut self, v: T) -> Self
8303        where
8304            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
8305        {
8306            self.0.request.options = std::option::Option::Some(v.into());
8307            self
8308        }
8309
8310        /// Sets or clears the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
8311        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
8312        where
8313            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
8314        {
8315            self.0.request.options = v.map(|x| x.into());
8316            self
8317        }
8318    }
8319
8320    #[doc(hidden)]
8321    impl crate::RequestBuilder for GetIamPolicy {
8322        fn request_options(&mut self) -> &mut crate::RequestOptions {
8323            &mut self.0.options
8324        }
8325    }
8326
8327    /// The request builder for [HubService::test_iam_permissions][crate::client::HubService::test_iam_permissions] calls.
8328    ///
8329    /// # Example
8330    /// ```
8331    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::TestIamPermissions;
8332    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
8333    ///
8334    /// let builder = prepare_request_builder();
8335    /// let response = builder.send().await?;
8336    /// # Ok(()) }
8337    ///
8338    /// fn prepare_request_builder() -> TestIamPermissions {
8339    ///   # panic!();
8340    ///   // ... details omitted ...
8341    /// }
8342    /// ```
8343    #[derive(Clone, Debug)]
8344    pub struct TestIamPermissions(
8345        RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
8346    );
8347
8348    impl TestIamPermissions {
8349        pub(crate) fn new(
8350            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8351        ) -> Self {
8352            Self(RequestBuilder::new(stub))
8353        }
8354
8355        /// Sets the full request, replacing any prior values.
8356        pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
8357            mut self,
8358            v: V,
8359        ) -> Self {
8360            self.0.request = v.into();
8361            self
8362        }
8363
8364        /// Sets all the options, replacing any prior values.
8365        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8366            self.0.options = v.into();
8367            self
8368        }
8369
8370        /// Sends the request.
8371        pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
8372            (*self.0.stub)
8373                .test_iam_permissions(self.0.request, self.0.options)
8374                .await
8375                .map(crate::Response::into_body)
8376        }
8377
8378        /// Sets the value of [resource][google_cloud_iam_v1::model::TestIamPermissionsRequest::resource].
8379        ///
8380        /// This is a **required** field for requests.
8381        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
8382            self.0.request.resource = v.into();
8383            self
8384        }
8385
8386        /// Sets the value of [permissions][google_cloud_iam_v1::model::TestIamPermissionsRequest::permissions].
8387        ///
8388        /// This is a **required** field for requests.
8389        pub fn set_permissions<T, V>(mut self, v: T) -> Self
8390        where
8391            T: std::iter::IntoIterator<Item = V>,
8392            V: std::convert::Into<std::string::String>,
8393        {
8394            use std::iter::Iterator;
8395            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
8396            self
8397        }
8398    }
8399
8400    #[doc(hidden)]
8401    impl crate::RequestBuilder for TestIamPermissions {
8402        fn request_options(&mut self) -> &mut crate::RequestOptions {
8403            &mut self.0.options
8404        }
8405    }
8406
8407    /// The request builder for [HubService::list_operations][crate::client::HubService::list_operations] calls.
8408    ///
8409    /// # Example
8410    /// ```
8411    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::ListOperations;
8412    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
8413    /// use google_cloud_gax::paginator::ItemPaginator;
8414    ///
8415    /// let builder = prepare_request_builder();
8416    /// let mut items = builder.by_item();
8417    /// while let Some(result) = items.next().await {
8418    ///   let item = result?;
8419    /// }
8420    /// # Ok(()) }
8421    ///
8422    /// fn prepare_request_builder() -> ListOperations {
8423    ///   # panic!();
8424    ///   // ... details omitted ...
8425    /// }
8426    /// ```
8427    #[derive(Clone, Debug)]
8428    pub struct ListOperations(
8429        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
8430    );
8431
8432    impl ListOperations {
8433        pub(crate) fn new(
8434            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8435        ) -> Self {
8436            Self(RequestBuilder::new(stub))
8437        }
8438
8439        /// Sets the full request, replacing any prior values.
8440        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
8441            mut self,
8442            v: V,
8443        ) -> Self {
8444            self.0.request = v.into();
8445            self
8446        }
8447
8448        /// Sets all the options, replacing any prior values.
8449        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8450            self.0.options = v.into();
8451            self
8452        }
8453
8454        /// Sends the request.
8455        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
8456            (*self.0.stub)
8457                .list_operations(self.0.request, self.0.options)
8458                .await
8459                .map(crate::Response::into_body)
8460        }
8461
8462        /// Streams each page in the collection.
8463        pub fn by_page(
8464            self,
8465        ) -> impl google_cloud_gax::paginator::Paginator<
8466            google_cloud_longrunning::model::ListOperationsResponse,
8467            crate::Error,
8468        > {
8469            use std::clone::Clone;
8470            let token = self.0.request.page_token.clone();
8471            let execute = move |token: String| {
8472                let mut builder = self.clone();
8473                builder.0.request = builder.0.request.set_page_token(token);
8474                builder.send()
8475            };
8476            google_cloud_gax::paginator::internal::new_paginator(token, execute)
8477        }
8478
8479        /// Streams each item in the collection.
8480        pub fn by_item(
8481            self,
8482        ) -> impl google_cloud_gax::paginator::ItemPaginator<
8483            google_cloud_longrunning::model::ListOperationsResponse,
8484            crate::Error,
8485        > {
8486            use google_cloud_gax::paginator::Paginator;
8487            self.by_page().items()
8488        }
8489
8490        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
8491        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8492            self.0.request.name = v.into();
8493            self
8494        }
8495
8496        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
8497        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8498            self.0.request.filter = v.into();
8499            self
8500        }
8501
8502        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
8503        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8504            self.0.request.page_size = v.into();
8505            self
8506        }
8507
8508        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
8509        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8510            self.0.request.page_token = v.into();
8511            self
8512        }
8513
8514        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
8515        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
8516            self.0.request.return_partial_success = v.into();
8517            self
8518        }
8519    }
8520
8521    #[doc(hidden)]
8522    impl crate::RequestBuilder for ListOperations {
8523        fn request_options(&mut self) -> &mut crate::RequestOptions {
8524            &mut self.0.options
8525        }
8526    }
8527
8528    /// The request builder for [HubService::get_operation][crate::client::HubService::get_operation] calls.
8529    ///
8530    /// # Example
8531    /// ```
8532    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::GetOperation;
8533    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
8534    ///
8535    /// let builder = prepare_request_builder();
8536    /// let response = builder.send().await?;
8537    /// # Ok(()) }
8538    ///
8539    /// fn prepare_request_builder() -> GetOperation {
8540    ///   # panic!();
8541    ///   // ... details omitted ...
8542    /// }
8543    /// ```
8544    #[derive(Clone, Debug)]
8545    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
8546
8547    impl GetOperation {
8548        pub(crate) fn new(
8549            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8550        ) -> Self {
8551            Self(RequestBuilder::new(stub))
8552        }
8553
8554        /// Sets the full request, replacing any prior values.
8555        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
8556            mut self,
8557            v: V,
8558        ) -> Self {
8559            self.0.request = v.into();
8560            self
8561        }
8562
8563        /// Sets all the options, replacing any prior values.
8564        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8565            self.0.options = v.into();
8566            self
8567        }
8568
8569        /// Sends the request.
8570        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8571            (*self.0.stub)
8572                .get_operation(self.0.request, self.0.options)
8573                .await
8574                .map(crate::Response::into_body)
8575        }
8576
8577        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
8578        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8579            self.0.request.name = v.into();
8580            self
8581        }
8582    }
8583
8584    #[doc(hidden)]
8585    impl crate::RequestBuilder for GetOperation {
8586        fn request_options(&mut self) -> &mut crate::RequestOptions {
8587            &mut self.0.options
8588        }
8589    }
8590
8591    /// The request builder for [HubService::delete_operation][crate::client::HubService::delete_operation] calls.
8592    ///
8593    /// # Example
8594    /// ```
8595    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::DeleteOperation;
8596    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
8597    ///
8598    /// let builder = prepare_request_builder();
8599    /// let response = builder.send().await?;
8600    /// # Ok(()) }
8601    ///
8602    /// fn prepare_request_builder() -> DeleteOperation {
8603    ///   # panic!();
8604    ///   // ... details omitted ...
8605    /// }
8606    /// ```
8607    #[derive(Clone, Debug)]
8608    pub struct DeleteOperation(
8609        RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
8610    );
8611
8612    impl DeleteOperation {
8613        pub(crate) fn new(
8614            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8615        ) -> Self {
8616            Self(RequestBuilder::new(stub))
8617        }
8618
8619        /// Sets the full request, replacing any prior values.
8620        pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
8621            mut self,
8622            v: V,
8623        ) -> Self {
8624            self.0.request = v.into();
8625            self
8626        }
8627
8628        /// Sets all the options, replacing any prior values.
8629        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8630            self.0.options = v.into();
8631            self
8632        }
8633
8634        /// Sends the request.
8635        pub async fn send(self) -> Result<()> {
8636            (*self.0.stub)
8637                .delete_operation(self.0.request, self.0.options)
8638                .await
8639                .map(crate::Response::into_body)
8640        }
8641
8642        /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
8643        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8644            self.0.request.name = v.into();
8645            self
8646        }
8647    }
8648
8649    #[doc(hidden)]
8650    impl crate::RequestBuilder for DeleteOperation {
8651        fn request_options(&mut self) -> &mut crate::RequestOptions {
8652            &mut self.0.options
8653        }
8654    }
8655
8656    /// The request builder for [HubService::cancel_operation][crate::client::HubService::cancel_operation] calls.
8657    ///
8658    /// # Example
8659    /// ```
8660    /// # use google_cloud_networkconnectivity_v1::builder::hub_service::CancelOperation;
8661    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
8662    ///
8663    /// let builder = prepare_request_builder();
8664    /// let response = builder.send().await?;
8665    /// # Ok(()) }
8666    ///
8667    /// fn prepare_request_builder() -> CancelOperation {
8668    ///   # panic!();
8669    ///   // ... details omitted ...
8670    /// }
8671    /// ```
8672    #[derive(Clone, Debug)]
8673    pub struct CancelOperation(
8674        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
8675    );
8676
8677    impl CancelOperation {
8678        pub(crate) fn new(
8679            stub: std::sync::Arc<dyn super::super::stub::dynamic::HubService>,
8680        ) -> Self {
8681            Self(RequestBuilder::new(stub))
8682        }
8683
8684        /// Sets the full request, replacing any prior values.
8685        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
8686            mut self,
8687            v: V,
8688        ) -> Self {
8689            self.0.request = v.into();
8690            self
8691        }
8692
8693        /// Sets all the options, replacing any prior values.
8694        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8695            self.0.options = v.into();
8696            self
8697        }
8698
8699        /// Sends the request.
8700        pub async fn send(self) -> Result<()> {
8701            (*self.0.stub)
8702                .cancel_operation(self.0.request, self.0.options)
8703                .await
8704                .map(crate::Response::into_body)
8705        }
8706
8707        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
8708        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8709            self.0.request.name = v.into();
8710            self
8711        }
8712    }
8713
8714    #[doc(hidden)]
8715    impl crate::RequestBuilder for CancelOperation {
8716        fn request_options(&mut self) -> &mut crate::RequestOptions {
8717            &mut self.0.options
8718        }
8719    }
8720}
8721
8722pub mod internal_range_service {
8723    use crate::Result;
8724
8725    /// A builder for [InternalRangeService][crate::client::InternalRangeService].
8726    ///
8727    /// ```
8728    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
8729    /// # use google_cloud_networkconnectivity_v1::*;
8730    /// # use builder::internal_range_service::ClientBuilder;
8731    /// # use client::InternalRangeService;
8732    /// let builder : ClientBuilder = InternalRangeService::builder();
8733    /// let client = builder
8734    ///     .with_endpoint("https://networkconnectivity.googleapis.com")
8735    ///     .build().await?;
8736    /// # Ok(()) }
8737    /// ```
8738    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
8739
8740    pub(crate) mod client {
8741        use super::super::super::client::InternalRangeService;
8742        pub struct Factory;
8743        impl crate::ClientFactory for Factory {
8744            type Client = InternalRangeService;
8745            type Credentials = gaxi::options::Credentials;
8746            async fn build(
8747                self,
8748                config: gaxi::options::ClientConfig,
8749            ) -> crate::ClientBuilderResult<Self::Client> {
8750                Self::Client::new(config).await
8751            }
8752        }
8753    }
8754
8755    /// Common implementation for [crate::client::InternalRangeService] request builders.
8756    #[derive(Clone, Debug)]
8757    pub(crate) struct RequestBuilder<R: std::default::Default> {
8758        stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
8759        request: R,
8760        options: crate::RequestOptions,
8761    }
8762
8763    impl<R> RequestBuilder<R>
8764    where
8765        R: std::default::Default,
8766    {
8767        pub(crate) fn new(
8768            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
8769        ) -> Self {
8770            Self {
8771                stub,
8772                request: R::default(),
8773                options: crate::RequestOptions::default(),
8774            }
8775        }
8776    }
8777
8778    /// The request builder for [InternalRangeService::list_internal_ranges][crate::client::InternalRangeService::list_internal_ranges] calls.
8779    ///
8780    /// # Example
8781    /// ```
8782    /// # use google_cloud_networkconnectivity_v1::builder::internal_range_service::ListInternalRanges;
8783    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
8784    /// use google_cloud_gax::paginator::ItemPaginator;
8785    ///
8786    /// let builder = prepare_request_builder();
8787    /// let mut items = builder.by_item();
8788    /// while let Some(result) = items.next().await {
8789    ///   let item = result?;
8790    /// }
8791    /// # Ok(()) }
8792    ///
8793    /// fn prepare_request_builder() -> ListInternalRanges {
8794    ///   # panic!();
8795    ///   // ... details omitted ...
8796    /// }
8797    /// ```
8798    #[derive(Clone, Debug)]
8799    pub struct ListInternalRanges(RequestBuilder<crate::model::ListInternalRangesRequest>);
8800
8801    impl ListInternalRanges {
8802        pub(crate) fn new(
8803            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
8804        ) -> Self {
8805            Self(RequestBuilder::new(stub))
8806        }
8807
8808        /// Sets the full request, replacing any prior values.
8809        pub fn with_request<V: Into<crate::model::ListInternalRangesRequest>>(
8810            mut self,
8811            v: V,
8812        ) -> Self {
8813            self.0.request = v.into();
8814            self
8815        }
8816
8817        /// Sets all the options, replacing any prior values.
8818        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8819            self.0.options = v.into();
8820            self
8821        }
8822
8823        /// Sends the request.
8824        pub async fn send(self) -> Result<crate::model::ListInternalRangesResponse> {
8825            (*self.0.stub)
8826                .list_internal_ranges(self.0.request, self.0.options)
8827                .await
8828                .map(crate::Response::into_body)
8829        }
8830
8831        /// Streams each page in the collection.
8832        pub fn by_page(
8833            self,
8834        ) -> impl google_cloud_gax::paginator::Paginator<
8835            crate::model::ListInternalRangesResponse,
8836            crate::Error,
8837        > {
8838            use std::clone::Clone;
8839            let token = self.0.request.page_token.clone();
8840            let execute = move |token: String| {
8841                let mut builder = self.clone();
8842                builder.0.request = builder.0.request.set_page_token(token);
8843                builder.send()
8844            };
8845            google_cloud_gax::paginator::internal::new_paginator(token, execute)
8846        }
8847
8848        /// Streams each item in the collection.
8849        pub fn by_item(
8850            self,
8851        ) -> impl google_cloud_gax::paginator::ItemPaginator<
8852            crate::model::ListInternalRangesResponse,
8853            crate::Error,
8854        > {
8855            use google_cloud_gax::paginator::Paginator;
8856            self.by_page().items()
8857        }
8858
8859        /// Sets the value of [parent][crate::model::ListInternalRangesRequest::parent].
8860        ///
8861        /// This is a **required** field for requests.
8862        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
8863            self.0.request.parent = v.into();
8864            self
8865        }
8866
8867        /// Sets the value of [page_size][crate::model::ListInternalRangesRequest::page_size].
8868        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8869            self.0.request.page_size = v.into();
8870            self
8871        }
8872
8873        /// Sets the value of [page_token][crate::model::ListInternalRangesRequest::page_token].
8874        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8875            self.0.request.page_token = v.into();
8876            self
8877        }
8878
8879        /// Sets the value of [filter][crate::model::ListInternalRangesRequest::filter].
8880        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8881            self.0.request.filter = v.into();
8882            self
8883        }
8884
8885        /// Sets the value of [order_by][crate::model::ListInternalRangesRequest::order_by].
8886        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
8887            self.0.request.order_by = v.into();
8888            self
8889        }
8890    }
8891
8892    #[doc(hidden)]
8893    impl crate::RequestBuilder for ListInternalRanges {
8894        fn request_options(&mut self) -> &mut crate::RequestOptions {
8895            &mut self.0.options
8896        }
8897    }
8898
8899    /// The request builder for [InternalRangeService::get_internal_range][crate::client::InternalRangeService::get_internal_range] calls.
8900    ///
8901    /// # Example
8902    /// ```
8903    /// # use google_cloud_networkconnectivity_v1::builder::internal_range_service::GetInternalRange;
8904    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
8905    ///
8906    /// let builder = prepare_request_builder();
8907    /// let response = builder.send().await?;
8908    /// # Ok(()) }
8909    ///
8910    /// fn prepare_request_builder() -> GetInternalRange {
8911    ///   # panic!();
8912    ///   // ... details omitted ...
8913    /// }
8914    /// ```
8915    #[derive(Clone, Debug)]
8916    pub struct GetInternalRange(RequestBuilder<crate::model::GetInternalRangeRequest>);
8917
8918    impl GetInternalRange {
8919        pub(crate) fn new(
8920            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
8921        ) -> Self {
8922            Self(RequestBuilder::new(stub))
8923        }
8924
8925        /// Sets the full request, replacing any prior values.
8926        pub fn with_request<V: Into<crate::model::GetInternalRangeRequest>>(
8927            mut self,
8928            v: V,
8929        ) -> Self {
8930            self.0.request = v.into();
8931            self
8932        }
8933
8934        /// Sets all the options, replacing any prior values.
8935        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8936            self.0.options = v.into();
8937            self
8938        }
8939
8940        /// Sends the request.
8941        pub async fn send(self) -> Result<crate::model::InternalRange> {
8942            (*self.0.stub)
8943                .get_internal_range(self.0.request, self.0.options)
8944                .await
8945                .map(crate::Response::into_body)
8946        }
8947
8948        /// Sets the value of [name][crate::model::GetInternalRangeRequest::name].
8949        ///
8950        /// This is a **required** field for requests.
8951        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8952            self.0.request.name = v.into();
8953            self
8954        }
8955    }
8956
8957    #[doc(hidden)]
8958    impl crate::RequestBuilder for GetInternalRange {
8959        fn request_options(&mut self) -> &mut crate::RequestOptions {
8960            &mut self.0.options
8961        }
8962    }
8963
8964    /// The request builder for [InternalRangeService::create_internal_range][crate::client::InternalRangeService::create_internal_range] calls.
8965    ///
8966    /// # Example
8967    /// ```
8968    /// # use google_cloud_networkconnectivity_v1::builder::internal_range_service::CreateInternalRange;
8969    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
8970    /// use google_cloud_lro::Poller;
8971    ///
8972    /// let builder = prepare_request_builder();
8973    /// let response = builder.poller().until_done().await?;
8974    /// # Ok(()) }
8975    ///
8976    /// fn prepare_request_builder() -> CreateInternalRange {
8977    ///   # panic!();
8978    ///   // ... details omitted ...
8979    /// }
8980    /// ```
8981    #[derive(Clone, Debug)]
8982    pub struct CreateInternalRange(RequestBuilder<crate::model::CreateInternalRangeRequest>);
8983
8984    impl CreateInternalRange {
8985        pub(crate) fn new(
8986            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
8987        ) -> Self {
8988            Self(RequestBuilder::new(stub))
8989        }
8990
8991        /// Sets the full request, replacing any prior values.
8992        pub fn with_request<V: Into<crate::model::CreateInternalRangeRequest>>(
8993            mut self,
8994            v: V,
8995        ) -> Self {
8996            self.0.request = v.into();
8997            self
8998        }
8999
9000        /// Sets all the options, replacing any prior values.
9001        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9002            self.0.options = v.into();
9003            self
9004        }
9005
9006        /// Sends the request.
9007        ///
9008        /// # Long running operations
9009        ///
9010        /// This starts, but does not poll, a longrunning operation. More information
9011        /// on [create_internal_range][crate::client::InternalRangeService::create_internal_range].
9012        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9013            (*self.0.stub)
9014                .create_internal_range(self.0.request, self.0.options)
9015                .await
9016                .map(crate::Response::into_body)
9017        }
9018
9019        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_internal_range`.
9020        pub fn poller(
9021            self,
9022        ) -> impl google_cloud_lro::Poller<crate::model::InternalRange, crate::model::OperationMetadata>
9023        {
9024            type Operation = google_cloud_lro::internal::Operation<
9025                crate::model::InternalRange,
9026                crate::model::OperationMetadata,
9027            >;
9028            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9029            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9030
9031            let stub = self.0.stub.clone();
9032            let mut options = self.0.options.clone();
9033            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
9034            let query = move |name| {
9035                let stub = stub.clone();
9036                let options = options.clone();
9037                async {
9038                    let op = GetOperation::new(stub)
9039                        .set_name(name)
9040                        .with_options(options)
9041                        .send()
9042                        .await?;
9043                    Ok(Operation::new(op))
9044                }
9045            };
9046
9047            let start = move || async {
9048                let op = self.send().await?;
9049                Ok(Operation::new(op))
9050            };
9051
9052            google_cloud_lro::internal::new_poller(
9053                polling_error_policy,
9054                polling_backoff_policy,
9055                start,
9056                query,
9057            )
9058        }
9059
9060        /// Sets the value of [parent][crate::model::CreateInternalRangeRequest::parent].
9061        ///
9062        /// This is a **required** field for requests.
9063        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
9064            self.0.request.parent = v.into();
9065            self
9066        }
9067
9068        /// Sets the value of [internal_range_id][crate::model::CreateInternalRangeRequest::internal_range_id].
9069        pub fn set_internal_range_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9070            self.0.request.internal_range_id = v.into();
9071            self
9072        }
9073
9074        /// Sets the value of [internal_range][crate::model::CreateInternalRangeRequest::internal_range].
9075        ///
9076        /// This is a **required** field for requests.
9077        pub fn set_internal_range<T>(mut self, v: T) -> Self
9078        where
9079            T: std::convert::Into<crate::model::InternalRange>,
9080        {
9081            self.0.request.internal_range = std::option::Option::Some(v.into());
9082            self
9083        }
9084
9085        /// Sets or clears the value of [internal_range][crate::model::CreateInternalRangeRequest::internal_range].
9086        ///
9087        /// This is a **required** field for requests.
9088        pub fn set_or_clear_internal_range<T>(mut self, v: std::option::Option<T>) -> Self
9089        where
9090            T: std::convert::Into<crate::model::InternalRange>,
9091        {
9092            self.0.request.internal_range = v.map(|x| x.into());
9093            self
9094        }
9095
9096        /// Sets the value of [request_id][crate::model::CreateInternalRangeRequest::request_id].
9097        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9098            self.0.request.request_id = v.into();
9099            self
9100        }
9101    }
9102
9103    #[doc(hidden)]
9104    impl crate::RequestBuilder for CreateInternalRange {
9105        fn request_options(&mut self) -> &mut crate::RequestOptions {
9106            &mut self.0.options
9107        }
9108    }
9109
9110    /// The request builder for [InternalRangeService::update_internal_range][crate::client::InternalRangeService::update_internal_range] calls.
9111    ///
9112    /// # Example
9113    /// ```
9114    /// # use google_cloud_networkconnectivity_v1::builder::internal_range_service::UpdateInternalRange;
9115    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
9116    /// use google_cloud_lro::Poller;
9117    ///
9118    /// let builder = prepare_request_builder();
9119    /// let response = builder.poller().until_done().await?;
9120    /// # Ok(()) }
9121    ///
9122    /// fn prepare_request_builder() -> UpdateInternalRange {
9123    ///   # panic!();
9124    ///   // ... details omitted ...
9125    /// }
9126    /// ```
9127    #[derive(Clone, Debug)]
9128    pub struct UpdateInternalRange(RequestBuilder<crate::model::UpdateInternalRangeRequest>);
9129
9130    impl UpdateInternalRange {
9131        pub(crate) fn new(
9132            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9133        ) -> Self {
9134            Self(RequestBuilder::new(stub))
9135        }
9136
9137        /// Sets the full request, replacing any prior values.
9138        pub fn with_request<V: Into<crate::model::UpdateInternalRangeRequest>>(
9139            mut self,
9140            v: V,
9141        ) -> Self {
9142            self.0.request = v.into();
9143            self
9144        }
9145
9146        /// Sets all the options, replacing any prior values.
9147        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9148            self.0.options = v.into();
9149            self
9150        }
9151
9152        /// Sends the request.
9153        ///
9154        /// # Long running operations
9155        ///
9156        /// This starts, but does not poll, a longrunning operation. More information
9157        /// on [update_internal_range][crate::client::InternalRangeService::update_internal_range].
9158        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9159            (*self.0.stub)
9160                .update_internal_range(self.0.request, self.0.options)
9161                .await
9162                .map(crate::Response::into_body)
9163        }
9164
9165        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_internal_range`.
9166        pub fn poller(
9167            self,
9168        ) -> impl google_cloud_lro::Poller<crate::model::InternalRange, crate::model::OperationMetadata>
9169        {
9170            type Operation = google_cloud_lro::internal::Operation<
9171                crate::model::InternalRange,
9172                crate::model::OperationMetadata,
9173            >;
9174            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9175            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9176
9177            let stub = self.0.stub.clone();
9178            let mut options = self.0.options.clone();
9179            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
9180            let query = move |name| {
9181                let stub = stub.clone();
9182                let options = options.clone();
9183                async {
9184                    let op = GetOperation::new(stub)
9185                        .set_name(name)
9186                        .with_options(options)
9187                        .send()
9188                        .await?;
9189                    Ok(Operation::new(op))
9190                }
9191            };
9192
9193            let start = move || async {
9194                let op = self.send().await?;
9195                Ok(Operation::new(op))
9196            };
9197
9198            google_cloud_lro::internal::new_poller(
9199                polling_error_policy,
9200                polling_backoff_policy,
9201                start,
9202                query,
9203            )
9204        }
9205
9206        /// Sets the value of [update_mask][crate::model::UpdateInternalRangeRequest::update_mask].
9207        pub fn set_update_mask<T>(mut self, v: T) -> Self
9208        where
9209            T: std::convert::Into<wkt::FieldMask>,
9210        {
9211            self.0.request.update_mask = std::option::Option::Some(v.into());
9212            self
9213        }
9214
9215        /// Sets or clears the value of [update_mask][crate::model::UpdateInternalRangeRequest::update_mask].
9216        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
9217        where
9218            T: std::convert::Into<wkt::FieldMask>,
9219        {
9220            self.0.request.update_mask = v.map(|x| x.into());
9221            self
9222        }
9223
9224        /// Sets the value of [internal_range][crate::model::UpdateInternalRangeRequest::internal_range].
9225        ///
9226        /// This is a **required** field for requests.
9227        pub fn set_internal_range<T>(mut self, v: T) -> Self
9228        where
9229            T: std::convert::Into<crate::model::InternalRange>,
9230        {
9231            self.0.request.internal_range = std::option::Option::Some(v.into());
9232            self
9233        }
9234
9235        /// Sets or clears the value of [internal_range][crate::model::UpdateInternalRangeRequest::internal_range].
9236        ///
9237        /// This is a **required** field for requests.
9238        pub fn set_or_clear_internal_range<T>(mut self, v: std::option::Option<T>) -> Self
9239        where
9240            T: std::convert::Into<crate::model::InternalRange>,
9241        {
9242            self.0.request.internal_range = v.map(|x| x.into());
9243            self
9244        }
9245
9246        /// Sets the value of [request_id][crate::model::UpdateInternalRangeRequest::request_id].
9247        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9248            self.0.request.request_id = v.into();
9249            self
9250        }
9251    }
9252
9253    #[doc(hidden)]
9254    impl crate::RequestBuilder for UpdateInternalRange {
9255        fn request_options(&mut self) -> &mut crate::RequestOptions {
9256            &mut self.0.options
9257        }
9258    }
9259
9260    /// The request builder for [InternalRangeService::delete_internal_range][crate::client::InternalRangeService::delete_internal_range] calls.
9261    ///
9262    /// # Example
9263    /// ```
9264    /// # use google_cloud_networkconnectivity_v1::builder::internal_range_service::DeleteInternalRange;
9265    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
9266    /// use google_cloud_lro::Poller;
9267    ///
9268    /// let builder = prepare_request_builder();
9269    /// let response = builder.poller().until_done().await?;
9270    /// # Ok(()) }
9271    ///
9272    /// fn prepare_request_builder() -> DeleteInternalRange {
9273    ///   # panic!();
9274    ///   // ... details omitted ...
9275    /// }
9276    /// ```
9277    #[derive(Clone, Debug)]
9278    pub struct DeleteInternalRange(RequestBuilder<crate::model::DeleteInternalRangeRequest>);
9279
9280    impl DeleteInternalRange {
9281        pub(crate) fn new(
9282            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9283        ) -> Self {
9284            Self(RequestBuilder::new(stub))
9285        }
9286
9287        /// Sets the full request, replacing any prior values.
9288        pub fn with_request<V: Into<crate::model::DeleteInternalRangeRequest>>(
9289            mut self,
9290            v: V,
9291        ) -> Self {
9292            self.0.request = v.into();
9293            self
9294        }
9295
9296        /// Sets all the options, replacing any prior values.
9297        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9298            self.0.options = v.into();
9299            self
9300        }
9301
9302        /// Sends the request.
9303        ///
9304        /// # Long running operations
9305        ///
9306        /// This starts, but does not poll, a longrunning operation. More information
9307        /// on [delete_internal_range][crate::client::InternalRangeService::delete_internal_range].
9308        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9309            (*self.0.stub)
9310                .delete_internal_range(self.0.request, self.0.options)
9311                .await
9312                .map(crate::Response::into_body)
9313        }
9314
9315        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_internal_range`.
9316        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
9317            type Operation =
9318                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
9319            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9320            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9321
9322            let stub = self.0.stub.clone();
9323            let mut options = self.0.options.clone();
9324            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
9325            let query = move |name| {
9326                let stub = stub.clone();
9327                let options = options.clone();
9328                async {
9329                    let op = GetOperation::new(stub)
9330                        .set_name(name)
9331                        .with_options(options)
9332                        .send()
9333                        .await?;
9334                    Ok(Operation::new(op))
9335                }
9336            };
9337
9338            let start = move || async {
9339                let op = self.send().await?;
9340                Ok(Operation::new(op))
9341            };
9342
9343            google_cloud_lro::internal::new_unit_response_poller(
9344                polling_error_policy,
9345                polling_backoff_policy,
9346                start,
9347                query,
9348            )
9349        }
9350
9351        /// Sets the value of [name][crate::model::DeleteInternalRangeRequest::name].
9352        ///
9353        /// This is a **required** field for requests.
9354        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9355            self.0.request.name = v.into();
9356            self
9357        }
9358
9359        /// Sets the value of [request_id][crate::model::DeleteInternalRangeRequest::request_id].
9360        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
9361            self.0.request.request_id = v.into();
9362            self
9363        }
9364    }
9365
9366    #[doc(hidden)]
9367    impl crate::RequestBuilder for DeleteInternalRange {
9368        fn request_options(&mut self) -> &mut crate::RequestOptions {
9369            &mut self.0.options
9370        }
9371    }
9372
9373    /// The request builder for [InternalRangeService::list_locations][crate::client::InternalRangeService::list_locations] calls.
9374    ///
9375    /// # Example
9376    /// ```
9377    /// # use google_cloud_networkconnectivity_v1::builder::internal_range_service::ListLocations;
9378    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
9379    /// use google_cloud_gax::paginator::ItemPaginator;
9380    ///
9381    /// let builder = prepare_request_builder();
9382    /// let mut items = builder.by_item();
9383    /// while let Some(result) = items.next().await {
9384    ///   let item = result?;
9385    /// }
9386    /// # Ok(()) }
9387    ///
9388    /// fn prepare_request_builder() -> ListLocations {
9389    ///   # panic!();
9390    ///   // ... details omitted ...
9391    /// }
9392    /// ```
9393    #[derive(Clone, Debug)]
9394    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
9395
9396    impl ListLocations {
9397        pub(crate) fn new(
9398            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9399        ) -> Self {
9400            Self(RequestBuilder::new(stub))
9401        }
9402
9403        /// Sets the full request, replacing any prior values.
9404        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
9405            mut self,
9406            v: V,
9407        ) -> Self {
9408            self.0.request = v.into();
9409            self
9410        }
9411
9412        /// Sets all the options, replacing any prior values.
9413        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9414            self.0.options = v.into();
9415            self
9416        }
9417
9418        /// Sends the request.
9419        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
9420            (*self.0.stub)
9421                .list_locations(self.0.request, self.0.options)
9422                .await
9423                .map(crate::Response::into_body)
9424        }
9425
9426        /// Streams each page in the collection.
9427        pub fn by_page(
9428            self,
9429        ) -> impl google_cloud_gax::paginator::Paginator<
9430            google_cloud_location::model::ListLocationsResponse,
9431            crate::Error,
9432        > {
9433            use std::clone::Clone;
9434            let token = self.0.request.page_token.clone();
9435            let execute = move |token: String| {
9436                let mut builder = self.clone();
9437                builder.0.request = builder.0.request.set_page_token(token);
9438                builder.send()
9439            };
9440            google_cloud_gax::paginator::internal::new_paginator(token, execute)
9441        }
9442
9443        /// Streams each item in the collection.
9444        pub fn by_item(
9445            self,
9446        ) -> impl google_cloud_gax::paginator::ItemPaginator<
9447            google_cloud_location::model::ListLocationsResponse,
9448            crate::Error,
9449        > {
9450            use google_cloud_gax::paginator::Paginator;
9451            self.by_page().items()
9452        }
9453
9454        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
9455        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9456            self.0.request.name = v.into();
9457            self
9458        }
9459
9460        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
9461        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
9462            self.0.request.filter = v.into();
9463            self
9464        }
9465
9466        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
9467        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
9468            self.0.request.page_size = v.into();
9469            self
9470        }
9471
9472        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
9473        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
9474            self.0.request.page_token = v.into();
9475            self
9476        }
9477    }
9478
9479    #[doc(hidden)]
9480    impl crate::RequestBuilder for ListLocations {
9481        fn request_options(&mut self) -> &mut crate::RequestOptions {
9482            &mut self.0.options
9483        }
9484    }
9485
9486    /// The request builder for [InternalRangeService::get_location][crate::client::InternalRangeService::get_location] calls.
9487    ///
9488    /// # Example
9489    /// ```
9490    /// # use google_cloud_networkconnectivity_v1::builder::internal_range_service::GetLocation;
9491    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
9492    ///
9493    /// let builder = prepare_request_builder();
9494    /// let response = builder.send().await?;
9495    /// # Ok(()) }
9496    ///
9497    /// fn prepare_request_builder() -> GetLocation {
9498    ///   # panic!();
9499    ///   // ... details omitted ...
9500    /// }
9501    /// ```
9502    #[derive(Clone, Debug)]
9503    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
9504
9505    impl GetLocation {
9506        pub(crate) fn new(
9507            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9508        ) -> Self {
9509            Self(RequestBuilder::new(stub))
9510        }
9511
9512        /// Sets the full request, replacing any prior values.
9513        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
9514            mut self,
9515            v: V,
9516        ) -> Self {
9517            self.0.request = v.into();
9518            self
9519        }
9520
9521        /// Sets all the options, replacing any prior values.
9522        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9523            self.0.options = v.into();
9524            self
9525        }
9526
9527        /// Sends the request.
9528        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
9529            (*self.0.stub)
9530                .get_location(self.0.request, self.0.options)
9531                .await
9532                .map(crate::Response::into_body)
9533        }
9534
9535        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
9536        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9537            self.0.request.name = v.into();
9538            self
9539        }
9540    }
9541
9542    #[doc(hidden)]
9543    impl crate::RequestBuilder for GetLocation {
9544        fn request_options(&mut self) -> &mut crate::RequestOptions {
9545            &mut self.0.options
9546        }
9547    }
9548
9549    /// The request builder for [InternalRangeService::set_iam_policy][crate::client::InternalRangeService::set_iam_policy] calls.
9550    ///
9551    /// # Example
9552    /// ```
9553    /// # use google_cloud_networkconnectivity_v1::builder::internal_range_service::SetIamPolicy;
9554    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
9555    ///
9556    /// let builder = prepare_request_builder();
9557    /// let response = builder.send().await?;
9558    /// # Ok(()) }
9559    ///
9560    /// fn prepare_request_builder() -> SetIamPolicy {
9561    ///   # panic!();
9562    ///   // ... details omitted ...
9563    /// }
9564    /// ```
9565    #[derive(Clone, Debug)]
9566    pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
9567
9568    impl SetIamPolicy {
9569        pub(crate) fn new(
9570            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9571        ) -> Self {
9572            Self(RequestBuilder::new(stub))
9573        }
9574
9575        /// Sets the full request, replacing any prior values.
9576        pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
9577            mut self,
9578            v: V,
9579        ) -> Self {
9580            self.0.request = v.into();
9581            self
9582        }
9583
9584        /// Sets all the options, replacing any prior values.
9585        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9586            self.0.options = v.into();
9587            self
9588        }
9589
9590        /// Sends the request.
9591        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
9592            (*self.0.stub)
9593                .set_iam_policy(self.0.request, self.0.options)
9594                .await
9595                .map(crate::Response::into_body)
9596        }
9597
9598        /// Sets the value of [resource][google_cloud_iam_v1::model::SetIamPolicyRequest::resource].
9599        ///
9600        /// This is a **required** field for requests.
9601        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
9602            self.0.request.resource = v.into();
9603            self
9604        }
9605
9606        /// Sets the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
9607        ///
9608        /// This is a **required** field for requests.
9609        pub fn set_policy<T>(mut self, v: T) -> Self
9610        where
9611            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
9612        {
9613            self.0.request.policy = std::option::Option::Some(v.into());
9614            self
9615        }
9616
9617        /// Sets or clears the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
9618        ///
9619        /// This is a **required** field for requests.
9620        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
9621        where
9622            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
9623        {
9624            self.0.request.policy = v.map(|x| x.into());
9625            self
9626        }
9627
9628        /// Sets the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
9629        pub fn set_update_mask<T>(mut self, v: T) -> Self
9630        where
9631            T: std::convert::Into<wkt::FieldMask>,
9632        {
9633            self.0.request.update_mask = std::option::Option::Some(v.into());
9634            self
9635        }
9636
9637        /// Sets or clears the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
9638        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
9639        where
9640            T: std::convert::Into<wkt::FieldMask>,
9641        {
9642            self.0.request.update_mask = v.map(|x| x.into());
9643            self
9644        }
9645    }
9646
9647    #[doc(hidden)]
9648    impl crate::RequestBuilder for SetIamPolicy {
9649        fn request_options(&mut self) -> &mut crate::RequestOptions {
9650            &mut self.0.options
9651        }
9652    }
9653
9654    /// The request builder for [InternalRangeService::get_iam_policy][crate::client::InternalRangeService::get_iam_policy] calls.
9655    ///
9656    /// # Example
9657    /// ```
9658    /// # use google_cloud_networkconnectivity_v1::builder::internal_range_service::GetIamPolicy;
9659    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
9660    ///
9661    /// let builder = prepare_request_builder();
9662    /// let response = builder.send().await?;
9663    /// # Ok(()) }
9664    ///
9665    /// fn prepare_request_builder() -> GetIamPolicy {
9666    ///   # panic!();
9667    ///   // ... details omitted ...
9668    /// }
9669    /// ```
9670    #[derive(Clone, Debug)]
9671    pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
9672
9673    impl GetIamPolicy {
9674        pub(crate) fn new(
9675            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9676        ) -> Self {
9677            Self(RequestBuilder::new(stub))
9678        }
9679
9680        /// Sets the full request, replacing any prior values.
9681        pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
9682            mut self,
9683            v: V,
9684        ) -> Self {
9685            self.0.request = v.into();
9686            self
9687        }
9688
9689        /// Sets all the options, replacing any prior values.
9690        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9691            self.0.options = v.into();
9692            self
9693        }
9694
9695        /// Sends the request.
9696        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
9697            (*self.0.stub)
9698                .get_iam_policy(self.0.request, self.0.options)
9699                .await
9700                .map(crate::Response::into_body)
9701        }
9702
9703        /// Sets the value of [resource][google_cloud_iam_v1::model::GetIamPolicyRequest::resource].
9704        ///
9705        /// This is a **required** field for requests.
9706        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
9707            self.0.request.resource = v.into();
9708            self
9709        }
9710
9711        /// Sets the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
9712        pub fn set_options<T>(mut self, v: T) -> Self
9713        where
9714            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
9715        {
9716            self.0.request.options = std::option::Option::Some(v.into());
9717            self
9718        }
9719
9720        /// Sets or clears the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
9721        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
9722        where
9723            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
9724        {
9725            self.0.request.options = v.map(|x| x.into());
9726            self
9727        }
9728    }
9729
9730    #[doc(hidden)]
9731    impl crate::RequestBuilder for GetIamPolicy {
9732        fn request_options(&mut self) -> &mut crate::RequestOptions {
9733            &mut self.0.options
9734        }
9735    }
9736
9737    /// The request builder for [InternalRangeService::test_iam_permissions][crate::client::InternalRangeService::test_iam_permissions] calls.
9738    ///
9739    /// # Example
9740    /// ```
9741    /// # use google_cloud_networkconnectivity_v1::builder::internal_range_service::TestIamPermissions;
9742    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
9743    ///
9744    /// let builder = prepare_request_builder();
9745    /// let response = builder.send().await?;
9746    /// # Ok(()) }
9747    ///
9748    /// fn prepare_request_builder() -> TestIamPermissions {
9749    ///   # panic!();
9750    ///   // ... details omitted ...
9751    /// }
9752    /// ```
9753    #[derive(Clone, Debug)]
9754    pub struct TestIamPermissions(
9755        RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
9756    );
9757
9758    impl TestIamPermissions {
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<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
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<crate::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<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
9782            (*self.0.stub)
9783                .test_iam_permissions(self.0.request, self.0.options)
9784                .await
9785                .map(crate::Response::into_body)
9786        }
9787
9788        /// Sets the value of [resource][google_cloud_iam_v1::model::TestIamPermissionsRequest::resource].
9789        ///
9790        /// This is a **required** field for requests.
9791        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
9792            self.0.request.resource = v.into();
9793            self
9794        }
9795
9796        /// Sets the value of [permissions][google_cloud_iam_v1::model::TestIamPermissionsRequest::permissions].
9797        ///
9798        /// This is a **required** field for requests.
9799        pub fn set_permissions<T, V>(mut self, v: T) -> Self
9800        where
9801            T: std::iter::IntoIterator<Item = V>,
9802            V: std::convert::Into<std::string::String>,
9803        {
9804            use std::iter::Iterator;
9805            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
9806            self
9807        }
9808    }
9809
9810    #[doc(hidden)]
9811    impl crate::RequestBuilder for TestIamPermissions {
9812        fn request_options(&mut self) -> &mut crate::RequestOptions {
9813            &mut self.0.options
9814        }
9815    }
9816
9817    /// The request builder for [InternalRangeService::list_operations][crate::client::InternalRangeService::list_operations] calls.
9818    ///
9819    /// # Example
9820    /// ```
9821    /// # use google_cloud_networkconnectivity_v1::builder::internal_range_service::ListOperations;
9822    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
9823    /// use google_cloud_gax::paginator::ItemPaginator;
9824    ///
9825    /// let builder = prepare_request_builder();
9826    /// let mut items = builder.by_item();
9827    /// while let Some(result) = items.next().await {
9828    ///   let item = result?;
9829    /// }
9830    /// # Ok(()) }
9831    ///
9832    /// fn prepare_request_builder() -> ListOperations {
9833    ///   # panic!();
9834    ///   // ... details omitted ...
9835    /// }
9836    /// ```
9837    #[derive(Clone, Debug)]
9838    pub struct ListOperations(
9839        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
9840    );
9841
9842    impl ListOperations {
9843        pub(crate) fn new(
9844            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9845        ) -> Self {
9846            Self(RequestBuilder::new(stub))
9847        }
9848
9849        /// Sets the full request, replacing any prior values.
9850        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
9851            mut self,
9852            v: V,
9853        ) -> Self {
9854            self.0.request = v.into();
9855            self
9856        }
9857
9858        /// Sets all the options, replacing any prior values.
9859        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9860            self.0.options = v.into();
9861            self
9862        }
9863
9864        /// Sends the request.
9865        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
9866            (*self.0.stub)
9867                .list_operations(self.0.request, self.0.options)
9868                .await
9869                .map(crate::Response::into_body)
9870        }
9871
9872        /// Streams each page in the collection.
9873        pub fn by_page(
9874            self,
9875        ) -> impl google_cloud_gax::paginator::Paginator<
9876            google_cloud_longrunning::model::ListOperationsResponse,
9877            crate::Error,
9878        > {
9879            use std::clone::Clone;
9880            let token = self.0.request.page_token.clone();
9881            let execute = move |token: String| {
9882                let mut builder = self.clone();
9883                builder.0.request = builder.0.request.set_page_token(token);
9884                builder.send()
9885            };
9886            google_cloud_gax::paginator::internal::new_paginator(token, execute)
9887        }
9888
9889        /// Streams each item in the collection.
9890        pub fn by_item(
9891            self,
9892        ) -> impl google_cloud_gax::paginator::ItemPaginator<
9893            google_cloud_longrunning::model::ListOperationsResponse,
9894            crate::Error,
9895        > {
9896            use google_cloud_gax::paginator::Paginator;
9897            self.by_page().items()
9898        }
9899
9900        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
9901        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9902            self.0.request.name = v.into();
9903            self
9904        }
9905
9906        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
9907        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
9908            self.0.request.filter = v.into();
9909            self
9910        }
9911
9912        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
9913        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
9914            self.0.request.page_size = v.into();
9915            self
9916        }
9917
9918        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
9919        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
9920            self.0.request.page_token = v.into();
9921            self
9922        }
9923
9924        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
9925        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
9926            self.0.request.return_partial_success = v.into();
9927            self
9928        }
9929    }
9930
9931    #[doc(hidden)]
9932    impl crate::RequestBuilder for ListOperations {
9933        fn request_options(&mut self) -> &mut crate::RequestOptions {
9934            &mut self.0.options
9935        }
9936    }
9937
9938    /// The request builder for [InternalRangeService::get_operation][crate::client::InternalRangeService::get_operation] calls.
9939    ///
9940    /// # Example
9941    /// ```
9942    /// # use google_cloud_networkconnectivity_v1::builder::internal_range_service::GetOperation;
9943    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
9944    ///
9945    /// let builder = prepare_request_builder();
9946    /// let response = builder.send().await?;
9947    /// # Ok(()) }
9948    ///
9949    /// fn prepare_request_builder() -> GetOperation {
9950    ///   # panic!();
9951    ///   // ... details omitted ...
9952    /// }
9953    /// ```
9954    #[derive(Clone, Debug)]
9955    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
9956
9957    impl GetOperation {
9958        pub(crate) fn new(
9959            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
9960        ) -> Self {
9961            Self(RequestBuilder::new(stub))
9962        }
9963
9964        /// Sets the full request, replacing any prior values.
9965        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
9966            mut self,
9967            v: V,
9968        ) -> Self {
9969            self.0.request = v.into();
9970            self
9971        }
9972
9973        /// Sets all the options, replacing any prior values.
9974        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9975            self.0.options = v.into();
9976            self
9977        }
9978
9979        /// Sends the request.
9980        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9981            (*self.0.stub)
9982                .get_operation(self.0.request, self.0.options)
9983                .await
9984                .map(crate::Response::into_body)
9985        }
9986
9987        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
9988        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9989            self.0.request.name = v.into();
9990            self
9991        }
9992    }
9993
9994    #[doc(hidden)]
9995    impl crate::RequestBuilder for GetOperation {
9996        fn request_options(&mut self) -> &mut crate::RequestOptions {
9997            &mut self.0.options
9998        }
9999    }
10000
10001    /// The request builder for [InternalRangeService::delete_operation][crate::client::InternalRangeService::delete_operation] calls.
10002    ///
10003    /// # Example
10004    /// ```
10005    /// # use google_cloud_networkconnectivity_v1::builder::internal_range_service::DeleteOperation;
10006    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
10007    ///
10008    /// let builder = prepare_request_builder();
10009    /// let response = builder.send().await?;
10010    /// # Ok(()) }
10011    ///
10012    /// fn prepare_request_builder() -> DeleteOperation {
10013    ///   # panic!();
10014    ///   // ... details omitted ...
10015    /// }
10016    /// ```
10017    #[derive(Clone, Debug)]
10018    pub struct DeleteOperation(
10019        RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
10020    );
10021
10022    impl DeleteOperation {
10023        pub(crate) fn new(
10024            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
10025        ) -> Self {
10026            Self(RequestBuilder::new(stub))
10027        }
10028
10029        /// Sets the full request, replacing any prior values.
10030        pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
10031            mut self,
10032            v: V,
10033        ) -> Self {
10034            self.0.request = v.into();
10035            self
10036        }
10037
10038        /// Sets all the options, replacing any prior values.
10039        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10040            self.0.options = v.into();
10041            self
10042        }
10043
10044        /// Sends the request.
10045        pub async fn send(self) -> Result<()> {
10046            (*self.0.stub)
10047                .delete_operation(self.0.request, self.0.options)
10048                .await
10049                .map(crate::Response::into_body)
10050        }
10051
10052        /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
10053        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10054            self.0.request.name = v.into();
10055            self
10056        }
10057    }
10058
10059    #[doc(hidden)]
10060    impl crate::RequestBuilder for DeleteOperation {
10061        fn request_options(&mut self) -> &mut crate::RequestOptions {
10062            &mut self.0.options
10063        }
10064    }
10065
10066    /// The request builder for [InternalRangeService::cancel_operation][crate::client::InternalRangeService::cancel_operation] calls.
10067    ///
10068    /// # Example
10069    /// ```
10070    /// # use google_cloud_networkconnectivity_v1::builder::internal_range_service::CancelOperation;
10071    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
10072    ///
10073    /// let builder = prepare_request_builder();
10074    /// let response = builder.send().await?;
10075    /// # Ok(()) }
10076    ///
10077    /// fn prepare_request_builder() -> CancelOperation {
10078    ///   # panic!();
10079    ///   // ... details omitted ...
10080    /// }
10081    /// ```
10082    #[derive(Clone, Debug)]
10083    pub struct CancelOperation(
10084        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
10085    );
10086
10087    impl CancelOperation {
10088        pub(crate) fn new(
10089            stub: std::sync::Arc<dyn super::super::stub::dynamic::InternalRangeService>,
10090        ) -> Self {
10091            Self(RequestBuilder::new(stub))
10092        }
10093
10094        /// Sets the full request, replacing any prior values.
10095        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
10096            mut self,
10097            v: V,
10098        ) -> Self {
10099            self.0.request = v.into();
10100            self
10101        }
10102
10103        /// Sets all the options, replacing any prior values.
10104        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10105            self.0.options = v.into();
10106            self
10107        }
10108
10109        /// Sends the request.
10110        pub async fn send(self) -> Result<()> {
10111            (*self.0.stub)
10112                .cancel_operation(self.0.request, self.0.options)
10113                .await
10114                .map(crate::Response::into_body)
10115        }
10116
10117        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
10118        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10119            self.0.request.name = v.into();
10120            self
10121        }
10122    }
10123
10124    #[doc(hidden)]
10125    impl crate::RequestBuilder for CancelOperation {
10126        fn request_options(&mut self) -> &mut crate::RequestOptions {
10127            &mut self.0.options
10128        }
10129    }
10130}
10131
10132pub mod policy_based_routing_service {
10133    use crate::Result;
10134
10135    /// A builder for [PolicyBasedRoutingService][crate::client::PolicyBasedRoutingService].
10136    ///
10137    /// ```
10138    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
10139    /// # use google_cloud_networkconnectivity_v1::*;
10140    /// # use builder::policy_based_routing_service::ClientBuilder;
10141    /// # use client::PolicyBasedRoutingService;
10142    /// let builder : ClientBuilder = PolicyBasedRoutingService::builder();
10143    /// let client = builder
10144    ///     .with_endpoint("https://networkconnectivity.googleapis.com")
10145    ///     .build().await?;
10146    /// # Ok(()) }
10147    /// ```
10148    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
10149
10150    pub(crate) mod client {
10151        use super::super::super::client::PolicyBasedRoutingService;
10152        pub struct Factory;
10153        impl crate::ClientFactory for Factory {
10154            type Client = PolicyBasedRoutingService;
10155            type Credentials = gaxi::options::Credentials;
10156            async fn build(
10157                self,
10158                config: gaxi::options::ClientConfig,
10159            ) -> crate::ClientBuilderResult<Self::Client> {
10160                Self::Client::new(config).await
10161            }
10162        }
10163    }
10164
10165    /// Common implementation for [crate::client::PolicyBasedRoutingService] request builders.
10166    #[derive(Clone, Debug)]
10167    pub(crate) struct RequestBuilder<R: std::default::Default> {
10168        stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10169        request: R,
10170        options: crate::RequestOptions,
10171    }
10172
10173    impl<R> RequestBuilder<R>
10174    where
10175        R: std::default::Default,
10176    {
10177        pub(crate) fn new(
10178            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10179        ) -> Self {
10180            Self {
10181                stub,
10182                request: R::default(),
10183                options: crate::RequestOptions::default(),
10184            }
10185        }
10186    }
10187
10188    /// The request builder for [PolicyBasedRoutingService::list_policy_based_routes][crate::client::PolicyBasedRoutingService::list_policy_based_routes] calls.
10189    ///
10190    /// # Example
10191    /// ```
10192    /// # use google_cloud_networkconnectivity_v1::builder::policy_based_routing_service::ListPolicyBasedRoutes;
10193    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
10194    /// use google_cloud_gax::paginator::ItemPaginator;
10195    ///
10196    /// let builder = prepare_request_builder();
10197    /// let mut items = builder.by_item();
10198    /// while let Some(result) = items.next().await {
10199    ///   let item = result?;
10200    /// }
10201    /// # Ok(()) }
10202    ///
10203    /// fn prepare_request_builder() -> ListPolicyBasedRoutes {
10204    ///   # panic!();
10205    ///   // ... details omitted ...
10206    /// }
10207    /// ```
10208    #[derive(Clone, Debug)]
10209    pub struct ListPolicyBasedRoutes(RequestBuilder<crate::model::ListPolicyBasedRoutesRequest>);
10210
10211    impl ListPolicyBasedRoutes {
10212        pub(crate) fn new(
10213            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10214        ) -> Self {
10215            Self(RequestBuilder::new(stub))
10216        }
10217
10218        /// Sets the full request, replacing any prior values.
10219        pub fn with_request<V: Into<crate::model::ListPolicyBasedRoutesRequest>>(
10220            mut self,
10221            v: V,
10222        ) -> Self {
10223            self.0.request = v.into();
10224            self
10225        }
10226
10227        /// Sets all the options, replacing any prior values.
10228        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10229            self.0.options = v.into();
10230            self
10231        }
10232
10233        /// Sends the request.
10234        pub async fn send(self) -> Result<crate::model::ListPolicyBasedRoutesResponse> {
10235            (*self.0.stub)
10236                .list_policy_based_routes(self.0.request, self.0.options)
10237                .await
10238                .map(crate::Response::into_body)
10239        }
10240
10241        /// Streams each page in the collection.
10242        pub fn by_page(
10243            self,
10244        ) -> impl google_cloud_gax::paginator::Paginator<
10245            crate::model::ListPolicyBasedRoutesResponse,
10246            crate::Error,
10247        > {
10248            use std::clone::Clone;
10249            let token = self.0.request.page_token.clone();
10250            let execute = move |token: String| {
10251                let mut builder = self.clone();
10252                builder.0.request = builder.0.request.set_page_token(token);
10253                builder.send()
10254            };
10255            google_cloud_gax::paginator::internal::new_paginator(token, execute)
10256        }
10257
10258        /// Streams each item in the collection.
10259        pub fn by_item(
10260            self,
10261        ) -> impl google_cloud_gax::paginator::ItemPaginator<
10262            crate::model::ListPolicyBasedRoutesResponse,
10263            crate::Error,
10264        > {
10265            use google_cloud_gax::paginator::Paginator;
10266            self.by_page().items()
10267        }
10268
10269        /// Sets the value of [parent][crate::model::ListPolicyBasedRoutesRequest::parent].
10270        ///
10271        /// This is a **required** field for requests.
10272        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
10273            self.0.request.parent = v.into();
10274            self
10275        }
10276
10277        /// Sets the value of [page_size][crate::model::ListPolicyBasedRoutesRequest::page_size].
10278        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
10279            self.0.request.page_size = v.into();
10280            self
10281        }
10282
10283        /// Sets the value of [page_token][crate::model::ListPolicyBasedRoutesRequest::page_token].
10284        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
10285            self.0.request.page_token = v.into();
10286            self
10287        }
10288
10289        /// Sets the value of [filter][crate::model::ListPolicyBasedRoutesRequest::filter].
10290        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
10291            self.0.request.filter = v.into();
10292            self
10293        }
10294
10295        /// Sets the value of [order_by][crate::model::ListPolicyBasedRoutesRequest::order_by].
10296        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
10297            self.0.request.order_by = v.into();
10298            self
10299        }
10300    }
10301
10302    #[doc(hidden)]
10303    impl crate::RequestBuilder for ListPolicyBasedRoutes {
10304        fn request_options(&mut self) -> &mut crate::RequestOptions {
10305            &mut self.0.options
10306        }
10307    }
10308
10309    /// The request builder for [PolicyBasedRoutingService::get_policy_based_route][crate::client::PolicyBasedRoutingService::get_policy_based_route] calls.
10310    ///
10311    /// # Example
10312    /// ```
10313    /// # use google_cloud_networkconnectivity_v1::builder::policy_based_routing_service::GetPolicyBasedRoute;
10314    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
10315    ///
10316    /// let builder = prepare_request_builder();
10317    /// let response = builder.send().await?;
10318    /// # Ok(()) }
10319    ///
10320    /// fn prepare_request_builder() -> GetPolicyBasedRoute {
10321    ///   # panic!();
10322    ///   // ... details omitted ...
10323    /// }
10324    /// ```
10325    #[derive(Clone, Debug)]
10326    pub struct GetPolicyBasedRoute(RequestBuilder<crate::model::GetPolicyBasedRouteRequest>);
10327
10328    impl GetPolicyBasedRoute {
10329        pub(crate) fn new(
10330            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10331        ) -> Self {
10332            Self(RequestBuilder::new(stub))
10333        }
10334
10335        /// Sets the full request, replacing any prior values.
10336        pub fn with_request<V: Into<crate::model::GetPolicyBasedRouteRequest>>(
10337            mut self,
10338            v: V,
10339        ) -> Self {
10340            self.0.request = v.into();
10341            self
10342        }
10343
10344        /// Sets all the options, replacing any prior values.
10345        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10346            self.0.options = v.into();
10347            self
10348        }
10349
10350        /// Sends the request.
10351        pub async fn send(self) -> Result<crate::model::PolicyBasedRoute> {
10352            (*self.0.stub)
10353                .get_policy_based_route(self.0.request, self.0.options)
10354                .await
10355                .map(crate::Response::into_body)
10356        }
10357
10358        /// Sets the value of [name][crate::model::GetPolicyBasedRouteRequest::name].
10359        ///
10360        /// This is a **required** field for requests.
10361        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10362            self.0.request.name = v.into();
10363            self
10364        }
10365    }
10366
10367    #[doc(hidden)]
10368    impl crate::RequestBuilder for GetPolicyBasedRoute {
10369        fn request_options(&mut self) -> &mut crate::RequestOptions {
10370            &mut self.0.options
10371        }
10372    }
10373
10374    /// The request builder for [PolicyBasedRoutingService::create_policy_based_route][crate::client::PolicyBasedRoutingService::create_policy_based_route] calls.
10375    ///
10376    /// # Example
10377    /// ```
10378    /// # use google_cloud_networkconnectivity_v1::builder::policy_based_routing_service::CreatePolicyBasedRoute;
10379    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
10380    /// use google_cloud_lro::Poller;
10381    ///
10382    /// let builder = prepare_request_builder();
10383    /// let response = builder.poller().until_done().await?;
10384    /// # Ok(()) }
10385    ///
10386    /// fn prepare_request_builder() -> CreatePolicyBasedRoute {
10387    ///   # panic!();
10388    ///   // ... details omitted ...
10389    /// }
10390    /// ```
10391    #[derive(Clone, Debug)]
10392    pub struct CreatePolicyBasedRoute(RequestBuilder<crate::model::CreatePolicyBasedRouteRequest>);
10393
10394    impl CreatePolicyBasedRoute {
10395        pub(crate) fn new(
10396            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10397        ) -> Self {
10398            Self(RequestBuilder::new(stub))
10399        }
10400
10401        /// Sets the full request, replacing any prior values.
10402        pub fn with_request<V: Into<crate::model::CreatePolicyBasedRouteRequest>>(
10403            mut self,
10404            v: V,
10405        ) -> Self {
10406            self.0.request = v.into();
10407            self
10408        }
10409
10410        /// Sets all the options, replacing any prior values.
10411        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10412            self.0.options = v.into();
10413            self
10414        }
10415
10416        /// Sends the request.
10417        ///
10418        /// # Long running operations
10419        ///
10420        /// This starts, but does not poll, a longrunning operation. More information
10421        /// on [create_policy_based_route][crate::client::PolicyBasedRoutingService::create_policy_based_route].
10422        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
10423            (*self.0.stub)
10424                .create_policy_based_route(self.0.request, self.0.options)
10425                .await
10426                .map(crate::Response::into_body)
10427        }
10428
10429        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_policy_based_route`.
10430        pub fn poller(
10431            self,
10432        ) -> impl google_cloud_lro::Poller<crate::model::PolicyBasedRoute, crate::model::OperationMetadata>
10433        {
10434            type Operation = google_cloud_lro::internal::Operation<
10435                crate::model::PolicyBasedRoute,
10436                crate::model::OperationMetadata,
10437            >;
10438            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
10439            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
10440
10441            let stub = self.0.stub.clone();
10442            let mut options = self.0.options.clone();
10443            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
10444            let query = move |name| {
10445                let stub = stub.clone();
10446                let options = options.clone();
10447                async {
10448                    let op = GetOperation::new(stub)
10449                        .set_name(name)
10450                        .with_options(options)
10451                        .send()
10452                        .await?;
10453                    Ok(Operation::new(op))
10454                }
10455            };
10456
10457            let start = move || async {
10458                let op = self.send().await?;
10459                Ok(Operation::new(op))
10460            };
10461
10462            google_cloud_lro::internal::new_poller(
10463                polling_error_policy,
10464                polling_backoff_policy,
10465                start,
10466                query,
10467            )
10468        }
10469
10470        /// Sets the value of [parent][crate::model::CreatePolicyBasedRouteRequest::parent].
10471        ///
10472        /// This is a **required** field for requests.
10473        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
10474            self.0.request.parent = v.into();
10475            self
10476        }
10477
10478        /// Sets the value of [policy_based_route_id][crate::model::CreatePolicyBasedRouteRequest::policy_based_route_id].
10479        ///
10480        /// This is a **required** field for requests.
10481        pub fn set_policy_based_route_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
10482            self.0.request.policy_based_route_id = v.into();
10483            self
10484        }
10485
10486        /// Sets the value of [policy_based_route][crate::model::CreatePolicyBasedRouteRequest::policy_based_route].
10487        ///
10488        /// This is a **required** field for requests.
10489        pub fn set_policy_based_route<T>(mut self, v: T) -> Self
10490        where
10491            T: std::convert::Into<crate::model::PolicyBasedRoute>,
10492        {
10493            self.0.request.policy_based_route = std::option::Option::Some(v.into());
10494            self
10495        }
10496
10497        /// Sets or clears the value of [policy_based_route][crate::model::CreatePolicyBasedRouteRequest::policy_based_route].
10498        ///
10499        /// This is a **required** field for requests.
10500        pub fn set_or_clear_policy_based_route<T>(mut self, v: std::option::Option<T>) -> Self
10501        where
10502            T: std::convert::Into<crate::model::PolicyBasedRoute>,
10503        {
10504            self.0.request.policy_based_route = v.map(|x| x.into());
10505            self
10506        }
10507
10508        /// Sets the value of [request_id][crate::model::CreatePolicyBasedRouteRequest::request_id].
10509        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
10510            self.0.request.request_id = v.into();
10511            self
10512        }
10513    }
10514
10515    #[doc(hidden)]
10516    impl crate::RequestBuilder for CreatePolicyBasedRoute {
10517        fn request_options(&mut self) -> &mut crate::RequestOptions {
10518            &mut self.0.options
10519        }
10520    }
10521
10522    /// The request builder for [PolicyBasedRoutingService::delete_policy_based_route][crate::client::PolicyBasedRoutingService::delete_policy_based_route] calls.
10523    ///
10524    /// # Example
10525    /// ```
10526    /// # use google_cloud_networkconnectivity_v1::builder::policy_based_routing_service::DeletePolicyBasedRoute;
10527    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
10528    /// use google_cloud_lro::Poller;
10529    ///
10530    /// let builder = prepare_request_builder();
10531    /// let response = builder.poller().until_done().await?;
10532    /// # Ok(()) }
10533    ///
10534    /// fn prepare_request_builder() -> DeletePolicyBasedRoute {
10535    ///   # panic!();
10536    ///   // ... details omitted ...
10537    /// }
10538    /// ```
10539    #[derive(Clone, Debug)]
10540    pub struct DeletePolicyBasedRoute(RequestBuilder<crate::model::DeletePolicyBasedRouteRequest>);
10541
10542    impl DeletePolicyBasedRoute {
10543        pub(crate) fn new(
10544            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10545        ) -> Self {
10546            Self(RequestBuilder::new(stub))
10547        }
10548
10549        /// Sets the full request, replacing any prior values.
10550        pub fn with_request<V: Into<crate::model::DeletePolicyBasedRouteRequest>>(
10551            mut self,
10552            v: V,
10553        ) -> Self {
10554            self.0.request = v.into();
10555            self
10556        }
10557
10558        /// Sets all the options, replacing any prior values.
10559        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10560            self.0.options = v.into();
10561            self
10562        }
10563
10564        /// Sends the request.
10565        ///
10566        /// # Long running operations
10567        ///
10568        /// This starts, but does not poll, a longrunning operation. More information
10569        /// on [delete_policy_based_route][crate::client::PolicyBasedRoutingService::delete_policy_based_route].
10570        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
10571            (*self.0.stub)
10572                .delete_policy_based_route(self.0.request, self.0.options)
10573                .await
10574                .map(crate::Response::into_body)
10575        }
10576
10577        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_policy_based_route`.
10578        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
10579            type Operation =
10580                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
10581            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
10582            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
10583
10584            let stub = self.0.stub.clone();
10585            let mut options = self.0.options.clone();
10586            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
10587            let query = move |name| {
10588                let stub = stub.clone();
10589                let options = options.clone();
10590                async {
10591                    let op = GetOperation::new(stub)
10592                        .set_name(name)
10593                        .with_options(options)
10594                        .send()
10595                        .await?;
10596                    Ok(Operation::new(op))
10597                }
10598            };
10599
10600            let start = move || async {
10601                let op = self.send().await?;
10602                Ok(Operation::new(op))
10603            };
10604
10605            google_cloud_lro::internal::new_unit_response_poller(
10606                polling_error_policy,
10607                polling_backoff_policy,
10608                start,
10609                query,
10610            )
10611        }
10612
10613        /// Sets the value of [name][crate::model::DeletePolicyBasedRouteRequest::name].
10614        ///
10615        /// This is a **required** field for requests.
10616        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10617            self.0.request.name = v.into();
10618            self
10619        }
10620
10621        /// Sets the value of [request_id][crate::model::DeletePolicyBasedRouteRequest::request_id].
10622        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
10623            self.0.request.request_id = v.into();
10624            self
10625        }
10626    }
10627
10628    #[doc(hidden)]
10629    impl crate::RequestBuilder for DeletePolicyBasedRoute {
10630        fn request_options(&mut self) -> &mut crate::RequestOptions {
10631            &mut self.0.options
10632        }
10633    }
10634
10635    /// The request builder for [PolicyBasedRoutingService::list_locations][crate::client::PolicyBasedRoutingService::list_locations] calls.
10636    ///
10637    /// # Example
10638    /// ```
10639    /// # use google_cloud_networkconnectivity_v1::builder::policy_based_routing_service::ListLocations;
10640    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
10641    /// use google_cloud_gax::paginator::ItemPaginator;
10642    ///
10643    /// let builder = prepare_request_builder();
10644    /// let mut items = builder.by_item();
10645    /// while let Some(result) = items.next().await {
10646    ///   let item = result?;
10647    /// }
10648    /// # Ok(()) }
10649    ///
10650    /// fn prepare_request_builder() -> ListLocations {
10651    ///   # panic!();
10652    ///   // ... details omitted ...
10653    /// }
10654    /// ```
10655    #[derive(Clone, Debug)]
10656    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
10657
10658    impl ListLocations {
10659        pub(crate) fn new(
10660            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10661        ) -> Self {
10662            Self(RequestBuilder::new(stub))
10663        }
10664
10665        /// Sets the full request, replacing any prior values.
10666        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
10667            mut self,
10668            v: V,
10669        ) -> Self {
10670            self.0.request = v.into();
10671            self
10672        }
10673
10674        /// Sets all the options, replacing any prior values.
10675        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10676            self.0.options = v.into();
10677            self
10678        }
10679
10680        /// Sends the request.
10681        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
10682            (*self.0.stub)
10683                .list_locations(self.0.request, self.0.options)
10684                .await
10685                .map(crate::Response::into_body)
10686        }
10687
10688        /// Streams each page in the collection.
10689        pub fn by_page(
10690            self,
10691        ) -> impl google_cloud_gax::paginator::Paginator<
10692            google_cloud_location::model::ListLocationsResponse,
10693            crate::Error,
10694        > {
10695            use std::clone::Clone;
10696            let token = self.0.request.page_token.clone();
10697            let execute = move |token: String| {
10698                let mut builder = self.clone();
10699                builder.0.request = builder.0.request.set_page_token(token);
10700                builder.send()
10701            };
10702            google_cloud_gax::paginator::internal::new_paginator(token, execute)
10703        }
10704
10705        /// Streams each item in the collection.
10706        pub fn by_item(
10707            self,
10708        ) -> impl google_cloud_gax::paginator::ItemPaginator<
10709            google_cloud_location::model::ListLocationsResponse,
10710            crate::Error,
10711        > {
10712            use google_cloud_gax::paginator::Paginator;
10713            self.by_page().items()
10714        }
10715
10716        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
10717        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10718            self.0.request.name = v.into();
10719            self
10720        }
10721
10722        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
10723        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
10724            self.0.request.filter = v.into();
10725            self
10726        }
10727
10728        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
10729        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
10730            self.0.request.page_size = v.into();
10731            self
10732        }
10733
10734        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
10735        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
10736            self.0.request.page_token = v.into();
10737            self
10738        }
10739    }
10740
10741    #[doc(hidden)]
10742    impl crate::RequestBuilder for ListLocations {
10743        fn request_options(&mut self) -> &mut crate::RequestOptions {
10744            &mut self.0.options
10745        }
10746    }
10747
10748    /// The request builder for [PolicyBasedRoutingService::get_location][crate::client::PolicyBasedRoutingService::get_location] calls.
10749    ///
10750    /// # Example
10751    /// ```
10752    /// # use google_cloud_networkconnectivity_v1::builder::policy_based_routing_service::GetLocation;
10753    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
10754    ///
10755    /// let builder = prepare_request_builder();
10756    /// let response = builder.send().await?;
10757    /// # Ok(()) }
10758    ///
10759    /// fn prepare_request_builder() -> GetLocation {
10760    ///   # panic!();
10761    ///   // ... details omitted ...
10762    /// }
10763    /// ```
10764    #[derive(Clone, Debug)]
10765    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
10766
10767    impl GetLocation {
10768        pub(crate) fn new(
10769            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10770        ) -> Self {
10771            Self(RequestBuilder::new(stub))
10772        }
10773
10774        /// Sets the full request, replacing any prior values.
10775        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
10776            mut self,
10777            v: V,
10778        ) -> Self {
10779            self.0.request = v.into();
10780            self
10781        }
10782
10783        /// Sets all the options, replacing any prior values.
10784        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10785            self.0.options = v.into();
10786            self
10787        }
10788
10789        /// Sends the request.
10790        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
10791            (*self.0.stub)
10792                .get_location(self.0.request, self.0.options)
10793                .await
10794                .map(crate::Response::into_body)
10795        }
10796
10797        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
10798        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10799            self.0.request.name = v.into();
10800            self
10801        }
10802    }
10803
10804    #[doc(hidden)]
10805    impl crate::RequestBuilder for GetLocation {
10806        fn request_options(&mut self) -> &mut crate::RequestOptions {
10807            &mut self.0.options
10808        }
10809    }
10810
10811    /// The request builder for [PolicyBasedRoutingService::set_iam_policy][crate::client::PolicyBasedRoutingService::set_iam_policy] calls.
10812    ///
10813    /// # Example
10814    /// ```
10815    /// # use google_cloud_networkconnectivity_v1::builder::policy_based_routing_service::SetIamPolicy;
10816    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
10817    ///
10818    /// let builder = prepare_request_builder();
10819    /// let response = builder.send().await?;
10820    /// # Ok(()) }
10821    ///
10822    /// fn prepare_request_builder() -> SetIamPolicy {
10823    ///   # panic!();
10824    ///   // ... details omitted ...
10825    /// }
10826    /// ```
10827    #[derive(Clone, Debug)]
10828    pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
10829
10830    impl SetIamPolicy {
10831        pub(crate) fn new(
10832            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10833        ) -> Self {
10834            Self(RequestBuilder::new(stub))
10835        }
10836
10837        /// Sets the full request, replacing any prior values.
10838        pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
10839            mut self,
10840            v: V,
10841        ) -> Self {
10842            self.0.request = v.into();
10843            self
10844        }
10845
10846        /// Sets all the options, replacing any prior values.
10847        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10848            self.0.options = v.into();
10849            self
10850        }
10851
10852        /// Sends the request.
10853        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
10854            (*self.0.stub)
10855                .set_iam_policy(self.0.request, self.0.options)
10856                .await
10857                .map(crate::Response::into_body)
10858        }
10859
10860        /// Sets the value of [resource][google_cloud_iam_v1::model::SetIamPolicyRequest::resource].
10861        ///
10862        /// This is a **required** field for requests.
10863        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
10864            self.0.request.resource = v.into();
10865            self
10866        }
10867
10868        /// Sets the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
10869        ///
10870        /// This is a **required** field for requests.
10871        pub fn set_policy<T>(mut self, v: T) -> Self
10872        where
10873            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
10874        {
10875            self.0.request.policy = std::option::Option::Some(v.into());
10876            self
10877        }
10878
10879        /// Sets or clears the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
10880        ///
10881        /// This is a **required** field for requests.
10882        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
10883        where
10884            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
10885        {
10886            self.0.request.policy = v.map(|x| x.into());
10887            self
10888        }
10889
10890        /// Sets the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
10891        pub fn set_update_mask<T>(mut self, v: T) -> Self
10892        where
10893            T: std::convert::Into<wkt::FieldMask>,
10894        {
10895            self.0.request.update_mask = std::option::Option::Some(v.into());
10896            self
10897        }
10898
10899        /// Sets or clears the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
10900        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
10901        where
10902            T: std::convert::Into<wkt::FieldMask>,
10903        {
10904            self.0.request.update_mask = v.map(|x| x.into());
10905            self
10906        }
10907    }
10908
10909    #[doc(hidden)]
10910    impl crate::RequestBuilder for SetIamPolicy {
10911        fn request_options(&mut self) -> &mut crate::RequestOptions {
10912            &mut self.0.options
10913        }
10914    }
10915
10916    /// The request builder for [PolicyBasedRoutingService::get_iam_policy][crate::client::PolicyBasedRoutingService::get_iam_policy] calls.
10917    ///
10918    /// # Example
10919    /// ```
10920    /// # use google_cloud_networkconnectivity_v1::builder::policy_based_routing_service::GetIamPolicy;
10921    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
10922    ///
10923    /// let builder = prepare_request_builder();
10924    /// let response = builder.send().await?;
10925    /// # Ok(()) }
10926    ///
10927    /// fn prepare_request_builder() -> GetIamPolicy {
10928    ///   # panic!();
10929    ///   // ... details omitted ...
10930    /// }
10931    /// ```
10932    #[derive(Clone, Debug)]
10933    pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
10934
10935    impl GetIamPolicy {
10936        pub(crate) fn new(
10937            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
10938        ) -> Self {
10939            Self(RequestBuilder::new(stub))
10940        }
10941
10942        /// Sets the full request, replacing any prior values.
10943        pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
10944            mut self,
10945            v: V,
10946        ) -> Self {
10947            self.0.request = v.into();
10948            self
10949        }
10950
10951        /// Sets all the options, replacing any prior values.
10952        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10953            self.0.options = v.into();
10954            self
10955        }
10956
10957        /// Sends the request.
10958        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
10959            (*self.0.stub)
10960                .get_iam_policy(self.0.request, self.0.options)
10961                .await
10962                .map(crate::Response::into_body)
10963        }
10964
10965        /// Sets the value of [resource][google_cloud_iam_v1::model::GetIamPolicyRequest::resource].
10966        ///
10967        /// This is a **required** field for requests.
10968        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
10969            self.0.request.resource = v.into();
10970            self
10971        }
10972
10973        /// Sets the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
10974        pub fn set_options<T>(mut self, v: T) -> Self
10975        where
10976            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
10977        {
10978            self.0.request.options = std::option::Option::Some(v.into());
10979            self
10980        }
10981
10982        /// Sets or clears the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
10983        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
10984        where
10985            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
10986        {
10987            self.0.request.options = v.map(|x| x.into());
10988            self
10989        }
10990    }
10991
10992    #[doc(hidden)]
10993    impl crate::RequestBuilder for GetIamPolicy {
10994        fn request_options(&mut self) -> &mut crate::RequestOptions {
10995            &mut self.0.options
10996        }
10997    }
10998
10999    /// The request builder for [PolicyBasedRoutingService::test_iam_permissions][crate::client::PolicyBasedRoutingService::test_iam_permissions] calls.
11000    ///
11001    /// # Example
11002    /// ```
11003    /// # use google_cloud_networkconnectivity_v1::builder::policy_based_routing_service::TestIamPermissions;
11004    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
11005    ///
11006    /// let builder = prepare_request_builder();
11007    /// let response = builder.send().await?;
11008    /// # Ok(()) }
11009    ///
11010    /// fn prepare_request_builder() -> TestIamPermissions {
11011    ///   # panic!();
11012    ///   // ... details omitted ...
11013    /// }
11014    /// ```
11015    #[derive(Clone, Debug)]
11016    pub struct TestIamPermissions(
11017        RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
11018    );
11019
11020    impl TestIamPermissions {
11021        pub(crate) fn new(
11022            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
11023        ) -> Self {
11024            Self(RequestBuilder::new(stub))
11025        }
11026
11027        /// Sets the full request, replacing any prior values.
11028        pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
11029            mut self,
11030            v: V,
11031        ) -> Self {
11032            self.0.request = v.into();
11033            self
11034        }
11035
11036        /// Sets all the options, replacing any prior values.
11037        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11038            self.0.options = v.into();
11039            self
11040        }
11041
11042        /// Sends the request.
11043        pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
11044            (*self.0.stub)
11045                .test_iam_permissions(self.0.request, self.0.options)
11046                .await
11047                .map(crate::Response::into_body)
11048        }
11049
11050        /// Sets the value of [resource][google_cloud_iam_v1::model::TestIamPermissionsRequest::resource].
11051        ///
11052        /// This is a **required** field for requests.
11053        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
11054            self.0.request.resource = v.into();
11055            self
11056        }
11057
11058        /// Sets the value of [permissions][google_cloud_iam_v1::model::TestIamPermissionsRequest::permissions].
11059        ///
11060        /// This is a **required** field for requests.
11061        pub fn set_permissions<T, V>(mut self, v: T) -> Self
11062        where
11063            T: std::iter::IntoIterator<Item = V>,
11064            V: std::convert::Into<std::string::String>,
11065        {
11066            use std::iter::Iterator;
11067            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
11068            self
11069        }
11070    }
11071
11072    #[doc(hidden)]
11073    impl crate::RequestBuilder for TestIamPermissions {
11074        fn request_options(&mut self) -> &mut crate::RequestOptions {
11075            &mut self.0.options
11076        }
11077    }
11078
11079    /// The request builder for [PolicyBasedRoutingService::list_operations][crate::client::PolicyBasedRoutingService::list_operations] calls.
11080    ///
11081    /// # Example
11082    /// ```
11083    /// # use google_cloud_networkconnectivity_v1::builder::policy_based_routing_service::ListOperations;
11084    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
11085    /// use google_cloud_gax::paginator::ItemPaginator;
11086    ///
11087    /// let builder = prepare_request_builder();
11088    /// let mut items = builder.by_item();
11089    /// while let Some(result) = items.next().await {
11090    ///   let item = result?;
11091    /// }
11092    /// # Ok(()) }
11093    ///
11094    /// fn prepare_request_builder() -> ListOperations {
11095    ///   # panic!();
11096    ///   // ... details omitted ...
11097    /// }
11098    /// ```
11099    #[derive(Clone, Debug)]
11100    pub struct ListOperations(
11101        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
11102    );
11103
11104    impl ListOperations {
11105        pub(crate) fn new(
11106            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
11107        ) -> Self {
11108            Self(RequestBuilder::new(stub))
11109        }
11110
11111        /// Sets the full request, replacing any prior values.
11112        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
11113            mut self,
11114            v: V,
11115        ) -> Self {
11116            self.0.request = v.into();
11117            self
11118        }
11119
11120        /// Sets all the options, replacing any prior values.
11121        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11122            self.0.options = v.into();
11123            self
11124        }
11125
11126        /// Sends the request.
11127        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
11128            (*self.0.stub)
11129                .list_operations(self.0.request, self.0.options)
11130                .await
11131                .map(crate::Response::into_body)
11132        }
11133
11134        /// Streams each page in the collection.
11135        pub fn by_page(
11136            self,
11137        ) -> impl google_cloud_gax::paginator::Paginator<
11138            google_cloud_longrunning::model::ListOperationsResponse,
11139            crate::Error,
11140        > {
11141            use std::clone::Clone;
11142            let token = self.0.request.page_token.clone();
11143            let execute = move |token: String| {
11144                let mut builder = self.clone();
11145                builder.0.request = builder.0.request.set_page_token(token);
11146                builder.send()
11147            };
11148            google_cloud_gax::paginator::internal::new_paginator(token, execute)
11149        }
11150
11151        /// Streams each item in the collection.
11152        pub fn by_item(
11153            self,
11154        ) -> impl google_cloud_gax::paginator::ItemPaginator<
11155            google_cloud_longrunning::model::ListOperationsResponse,
11156            crate::Error,
11157        > {
11158            use google_cloud_gax::paginator::Paginator;
11159            self.by_page().items()
11160        }
11161
11162        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
11163        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11164            self.0.request.name = v.into();
11165            self
11166        }
11167
11168        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
11169        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
11170            self.0.request.filter = v.into();
11171            self
11172        }
11173
11174        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
11175        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
11176            self.0.request.page_size = v.into();
11177            self
11178        }
11179
11180        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
11181        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
11182            self.0.request.page_token = v.into();
11183            self
11184        }
11185
11186        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
11187        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
11188            self.0.request.return_partial_success = v.into();
11189            self
11190        }
11191    }
11192
11193    #[doc(hidden)]
11194    impl crate::RequestBuilder for ListOperations {
11195        fn request_options(&mut self) -> &mut crate::RequestOptions {
11196            &mut self.0.options
11197        }
11198    }
11199
11200    /// The request builder for [PolicyBasedRoutingService::get_operation][crate::client::PolicyBasedRoutingService::get_operation] calls.
11201    ///
11202    /// # Example
11203    /// ```
11204    /// # use google_cloud_networkconnectivity_v1::builder::policy_based_routing_service::GetOperation;
11205    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
11206    ///
11207    /// let builder = prepare_request_builder();
11208    /// let response = builder.send().await?;
11209    /// # Ok(()) }
11210    ///
11211    /// fn prepare_request_builder() -> GetOperation {
11212    ///   # panic!();
11213    ///   // ... details omitted ...
11214    /// }
11215    /// ```
11216    #[derive(Clone, Debug)]
11217    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
11218
11219    impl GetOperation {
11220        pub(crate) fn new(
11221            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
11222        ) -> Self {
11223            Self(RequestBuilder::new(stub))
11224        }
11225
11226        /// Sets the full request, replacing any prior values.
11227        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
11228            mut self,
11229            v: V,
11230        ) -> Self {
11231            self.0.request = v.into();
11232            self
11233        }
11234
11235        /// Sets all the options, replacing any prior values.
11236        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11237            self.0.options = v.into();
11238            self
11239        }
11240
11241        /// Sends the request.
11242        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
11243            (*self.0.stub)
11244                .get_operation(self.0.request, self.0.options)
11245                .await
11246                .map(crate::Response::into_body)
11247        }
11248
11249        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
11250        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11251            self.0.request.name = v.into();
11252            self
11253        }
11254    }
11255
11256    #[doc(hidden)]
11257    impl crate::RequestBuilder for GetOperation {
11258        fn request_options(&mut self) -> &mut crate::RequestOptions {
11259            &mut self.0.options
11260        }
11261    }
11262
11263    /// The request builder for [PolicyBasedRoutingService::delete_operation][crate::client::PolicyBasedRoutingService::delete_operation] calls.
11264    ///
11265    /// # Example
11266    /// ```
11267    /// # use google_cloud_networkconnectivity_v1::builder::policy_based_routing_service::DeleteOperation;
11268    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
11269    ///
11270    /// let builder = prepare_request_builder();
11271    /// let response = builder.send().await?;
11272    /// # Ok(()) }
11273    ///
11274    /// fn prepare_request_builder() -> DeleteOperation {
11275    ///   # panic!();
11276    ///   // ... details omitted ...
11277    /// }
11278    /// ```
11279    #[derive(Clone, Debug)]
11280    pub struct DeleteOperation(
11281        RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
11282    );
11283
11284    impl DeleteOperation {
11285        pub(crate) fn new(
11286            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
11287        ) -> Self {
11288            Self(RequestBuilder::new(stub))
11289        }
11290
11291        /// Sets the full request, replacing any prior values.
11292        pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
11293            mut self,
11294            v: V,
11295        ) -> Self {
11296            self.0.request = v.into();
11297            self
11298        }
11299
11300        /// Sets all the options, replacing any prior values.
11301        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11302            self.0.options = v.into();
11303            self
11304        }
11305
11306        /// Sends the request.
11307        pub async fn send(self) -> Result<()> {
11308            (*self.0.stub)
11309                .delete_operation(self.0.request, self.0.options)
11310                .await
11311                .map(crate::Response::into_body)
11312        }
11313
11314        /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
11315        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11316            self.0.request.name = v.into();
11317            self
11318        }
11319    }
11320
11321    #[doc(hidden)]
11322    impl crate::RequestBuilder for DeleteOperation {
11323        fn request_options(&mut self) -> &mut crate::RequestOptions {
11324            &mut self.0.options
11325        }
11326    }
11327
11328    /// The request builder for [PolicyBasedRoutingService::cancel_operation][crate::client::PolicyBasedRoutingService::cancel_operation] calls.
11329    ///
11330    /// # Example
11331    /// ```
11332    /// # use google_cloud_networkconnectivity_v1::builder::policy_based_routing_service::CancelOperation;
11333    /// # async fn sample() -> google_cloud_networkconnectivity_v1::Result<()> {
11334    ///
11335    /// let builder = prepare_request_builder();
11336    /// let response = builder.send().await?;
11337    /// # Ok(()) }
11338    ///
11339    /// fn prepare_request_builder() -> CancelOperation {
11340    ///   # panic!();
11341    ///   // ... details omitted ...
11342    /// }
11343    /// ```
11344    #[derive(Clone, Debug)]
11345    pub struct CancelOperation(
11346        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
11347    );
11348
11349    impl CancelOperation {
11350        pub(crate) fn new(
11351            stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyBasedRoutingService>,
11352        ) -> Self {
11353            Self(RequestBuilder::new(stub))
11354        }
11355
11356        /// Sets the full request, replacing any prior values.
11357        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
11358            mut self,
11359            v: V,
11360        ) -> Self {
11361            self.0.request = v.into();
11362            self
11363        }
11364
11365        /// Sets all the options, replacing any prior values.
11366        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11367            self.0.options = v.into();
11368            self
11369        }
11370
11371        /// Sends the request.
11372        pub async fn send(self) -> Result<()> {
11373            (*self.0.stub)
11374                .cancel_operation(self.0.request, self.0.options)
11375                .await
11376                .map(crate::Response::into_body)
11377        }
11378
11379        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
11380        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11381            self.0.request.name = v.into();
11382            self
11383        }
11384    }
11385
11386    #[doc(hidden)]
11387    impl crate::RequestBuilder for CancelOperation {
11388        fn request_options(&mut self) -> &mut crate::RequestOptions {
11389            &mut self.0.options
11390        }
11391    }
11392}