Skip to main content

google_cloud_networkmanagement_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 reachability_service {
18    use crate::Result;
19
20    /// A builder for [ReachabilityService][crate::client::ReachabilityService].
21    ///
22    /// ```
23    /// # async fn sample() -> gax::client_builder::Result<()> {
24    /// # use google_cloud_networkmanagement_v1::*;
25    /// # use builder::reachability_service::ClientBuilder;
26    /// # use client::ReachabilityService;
27    /// let builder : ClientBuilder = ReachabilityService::builder();
28    /// let client = builder
29    ///     .with_endpoint("https://networkmanagement.googleapis.com")
30    ///     .build().await?;
31    /// # Ok(()) }
32    /// ```
33    pub type ClientBuilder =
34        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
35
36    pub(crate) mod client {
37        use super::super::super::client::ReachabilityService;
38        pub struct Factory;
39        impl gax::client_builder::internal::ClientFactory for Factory {
40            type Client = ReachabilityService;
41            type Credentials = gaxi::options::Credentials;
42            async fn build(
43                self,
44                config: gaxi::options::ClientConfig,
45            ) -> gax::client_builder::Result<Self::Client> {
46                Self::Client::new(config).await
47            }
48        }
49    }
50
51    /// Common implementation for [crate::client::ReachabilityService] request builders.
52    #[derive(Clone, Debug)]
53    pub(crate) struct RequestBuilder<R: std::default::Default> {
54        stub: std::sync::Arc<dyn super::super::stub::dynamic::ReachabilityService>,
55        request: R,
56        options: gax::options::RequestOptions,
57    }
58
59    impl<R> RequestBuilder<R>
60    where
61        R: std::default::Default,
62    {
63        pub(crate) fn new(
64            stub: std::sync::Arc<dyn super::super::stub::dynamic::ReachabilityService>,
65        ) -> Self {
66            Self {
67                stub,
68                request: R::default(),
69                options: gax::options::RequestOptions::default(),
70            }
71        }
72    }
73
74    /// The request builder for [ReachabilityService::list_connectivity_tests][crate::client::ReachabilityService::list_connectivity_tests] calls.
75    ///
76    /// # Example
77    /// ```
78    /// # use google_cloud_networkmanagement_v1::builder::reachability_service::ListConnectivityTests;
79    /// # async fn sample() -> gax::Result<()> {
80    /// use gax::paginator::ItemPaginator;
81    ///
82    /// let builder = prepare_request_builder();
83    /// let mut items = builder.by_item();
84    /// while let Some(result) = items.next().await {
85    ///   let item = result?;
86    /// }
87    /// # Ok(()) }
88    ///
89    /// fn prepare_request_builder() -> ListConnectivityTests {
90    ///   # panic!();
91    ///   // ... details omitted ...
92    /// }
93    /// ```
94    #[derive(Clone, Debug)]
95    pub struct ListConnectivityTests(RequestBuilder<crate::model::ListConnectivityTestsRequest>);
96
97    impl ListConnectivityTests {
98        pub(crate) fn new(
99            stub: std::sync::Arc<dyn super::super::stub::dynamic::ReachabilityService>,
100        ) -> Self {
101            Self(RequestBuilder::new(stub))
102        }
103
104        /// Sets the full request, replacing any prior values.
105        pub fn with_request<V: Into<crate::model::ListConnectivityTestsRequest>>(
106            mut self,
107            v: V,
108        ) -> Self {
109            self.0.request = v.into();
110            self
111        }
112
113        /// Sets all the options, replacing any prior values.
114        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
115            self.0.options = v.into();
116            self
117        }
118
119        /// Sends the request.
120        pub async fn send(self) -> Result<crate::model::ListConnectivityTestsResponse> {
121            (*self.0.stub)
122                .list_connectivity_tests(self.0.request, self.0.options)
123                .await
124                .map(gax::response::Response::into_body)
125        }
126
127        /// Streams each page in the collection.
128        pub fn by_page(
129            self,
130        ) -> impl gax::paginator::Paginator<crate::model::ListConnectivityTestsResponse, gax::error::Error>
131        {
132            use std::clone::Clone;
133            let token = self.0.request.page_token.clone();
134            let execute = move |token: String| {
135                let mut builder = self.clone();
136                builder.0.request = builder.0.request.set_page_token(token);
137                builder.send()
138            };
139            gax::paginator::internal::new_paginator(token, execute)
140        }
141
142        /// Streams each item in the collection.
143        pub fn by_item(
144            self,
145        ) -> impl gax::paginator::ItemPaginator<
146            crate::model::ListConnectivityTestsResponse,
147            gax::error::Error,
148        > {
149            use gax::paginator::Paginator;
150            self.by_page().items()
151        }
152
153        /// Sets the value of [parent][crate::model::ListConnectivityTestsRequest::parent].
154        ///
155        /// This is a **required** field for requests.
156        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
157            self.0.request.parent = v.into();
158            self
159        }
160
161        /// Sets the value of [page_size][crate::model::ListConnectivityTestsRequest::page_size].
162        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
163            self.0.request.page_size = v.into();
164            self
165        }
166
167        /// Sets the value of [page_token][crate::model::ListConnectivityTestsRequest::page_token].
168        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
169            self.0.request.page_token = v.into();
170            self
171        }
172
173        /// Sets the value of [filter][crate::model::ListConnectivityTestsRequest::filter].
174        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
175            self.0.request.filter = v.into();
176            self
177        }
178
179        /// Sets the value of [order_by][crate::model::ListConnectivityTestsRequest::order_by].
180        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
181            self.0.request.order_by = v.into();
182            self
183        }
184    }
185
186    #[doc(hidden)]
187    impl gax::options::internal::RequestBuilder for ListConnectivityTests {
188        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
189            &mut self.0.options
190        }
191    }
192
193    /// The request builder for [ReachabilityService::get_connectivity_test][crate::client::ReachabilityService::get_connectivity_test] calls.
194    ///
195    /// # Example
196    /// ```
197    /// # use google_cloud_networkmanagement_v1::builder::reachability_service::GetConnectivityTest;
198    /// # async fn sample() -> gax::Result<()> {
199    ///
200    /// let builder = prepare_request_builder();
201    /// let response = builder.send().await?;
202    /// # Ok(()) }
203    ///
204    /// fn prepare_request_builder() -> GetConnectivityTest {
205    ///   # panic!();
206    ///   // ... details omitted ...
207    /// }
208    /// ```
209    #[derive(Clone, Debug)]
210    pub struct GetConnectivityTest(RequestBuilder<crate::model::GetConnectivityTestRequest>);
211
212    impl GetConnectivityTest {
213        pub(crate) fn new(
214            stub: std::sync::Arc<dyn super::super::stub::dynamic::ReachabilityService>,
215        ) -> Self {
216            Self(RequestBuilder::new(stub))
217        }
218
219        /// Sets the full request, replacing any prior values.
220        pub fn with_request<V: Into<crate::model::GetConnectivityTestRequest>>(
221            mut self,
222            v: V,
223        ) -> Self {
224            self.0.request = v.into();
225            self
226        }
227
228        /// Sets all the options, replacing any prior values.
229        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
230            self.0.options = v.into();
231            self
232        }
233
234        /// Sends the request.
235        pub async fn send(self) -> Result<crate::model::ConnectivityTest> {
236            (*self.0.stub)
237                .get_connectivity_test(self.0.request, self.0.options)
238                .await
239                .map(gax::response::Response::into_body)
240        }
241
242        /// Sets the value of [name][crate::model::GetConnectivityTestRequest::name].
243        ///
244        /// This is a **required** field for requests.
245        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
246            self.0.request.name = v.into();
247            self
248        }
249    }
250
251    #[doc(hidden)]
252    impl gax::options::internal::RequestBuilder for GetConnectivityTest {
253        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
254            &mut self.0.options
255        }
256    }
257
258    /// The request builder for [ReachabilityService::create_connectivity_test][crate::client::ReachabilityService::create_connectivity_test] calls.
259    ///
260    /// # Example
261    /// ```
262    /// # use google_cloud_networkmanagement_v1::builder::reachability_service::CreateConnectivityTest;
263    /// # async fn sample() -> gax::Result<()> {
264    /// use lro::Poller;
265    ///
266    /// let builder = prepare_request_builder();
267    /// let response = builder.poller().until_done().await?;
268    /// # Ok(()) }
269    ///
270    /// fn prepare_request_builder() -> CreateConnectivityTest {
271    ///   # panic!();
272    ///   // ... details omitted ...
273    /// }
274    /// ```
275    #[derive(Clone, Debug)]
276    pub struct CreateConnectivityTest(RequestBuilder<crate::model::CreateConnectivityTestRequest>);
277
278    impl CreateConnectivityTest {
279        pub(crate) fn new(
280            stub: std::sync::Arc<dyn super::super::stub::dynamic::ReachabilityService>,
281        ) -> Self {
282            Self(RequestBuilder::new(stub))
283        }
284
285        /// Sets the full request, replacing any prior values.
286        pub fn with_request<V: Into<crate::model::CreateConnectivityTestRequest>>(
287            mut self,
288            v: V,
289        ) -> Self {
290            self.0.request = v.into();
291            self
292        }
293
294        /// Sets all the options, replacing any prior values.
295        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
296            self.0.options = v.into();
297            self
298        }
299
300        /// Sends the request.
301        ///
302        /// # Long running operations
303        ///
304        /// This starts, but does not poll, a longrunning operation. More information
305        /// on [create_connectivity_test][crate::client::ReachabilityService::create_connectivity_test].
306        pub async fn send(self) -> Result<longrunning::model::Operation> {
307            (*self.0.stub)
308                .create_connectivity_test(self.0.request, self.0.options)
309                .await
310                .map(gax::response::Response::into_body)
311        }
312
313        /// Creates a [Poller][lro::Poller] to work with `create_connectivity_test`.
314        pub fn poller(
315            self,
316        ) -> impl lro::Poller<crate::model::ConnectivityTest, crate::model::OperationMetadata>
317        {
318            type Operation = lro::internal::Operation<
319                crate::model::ConnectivityTest,
320                crate::model::OperationMetadata,
321            >;
322            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
323            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
324
325            let stub = self.0.stub.clone();
326            let mut options = self.0.options.clone();
327            options.set_retry_policy(gax::retry_policy::NeverRetry);
328            let query = move |name| {
329                let stub = stub.clone();
330                let options = options.clone();
331                async {
332                    let op = GetOperation::new(stub)
333                        .set_name(name)
334                        .with_options(options)
335                        .send()
336                        .await?;
337                    Ok(Operation::new(op))
338                }
339            };
340
341            let start = move || async {
342                let op = self.send().await?;
343                Ok(Operation::new(op))
344            };
345
346            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
347        }
348
349        /// Sets the value of [parent][crate::model::CreateConnectivityTestRequest::parent].
350        ///
351        /// This is a **required** field for requests.
352        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
353            self.0.request.parent = v.into();
354            self
355        }
356
357        /// Sets the value of [test_id][crate::model::CreateConnectivityTestRequest::test_id].
358        ///
359        /// This is a **required** field for requests.
360        pub fn set_test_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
361            self.0.request.test_id = v.into();
362            self
363        }
364
365        /// Sets the value of [resource][crate::model::CreateConnectivityTestRequest::resource].
366        ///
367        /// This is a **required** field for requests.
368        pub fn set_resource<T>(mut self, v: T) -> Self
369        where
370            T: std::convert::Into<crate::model::ConnectivityTest>,
371        {
372            self.0.request.resource = std::option::Option::Some(v.into());
373            self
374        }
375
376        /// Sets or clears the value of [resource][crate::model::CreateConnectivityTestRequest::resource].
377        ///
378        /// This is a **required** field for requests.
379        pub fn set_or_clear_resource<T>(mut self, v: std::option::Option<T>) -> Self
380        where
381            T: std::convert::Into<crate::model::ConnectivityTest>,
382        {
383            self.0.request.resource = v.map(|x| x.into());
384            self
385        }
386    }
387
388    #[doc(hidden)]
389    impl gax::options::internal::RequestBuilder for CreateConnectivityTest {
390        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
391            &mut self.0.options
392        }
393    }
394
395    /// The request builder for [ReachabilityService::update_connectivity_test][crate::client::ReachabilityService::update_connectivity_test] calls.
396    ///
397    /// # Example
398    /// ```
399    /// # use google_cloud_networkmanagement_v1::builder::reachability_service::UpdateConnectivityTest;
400    /// # async fn sample() -> gax::Result<()> {
401    /// use lro::Poller;
402    ///
403    /// let builder = prepare_request_builder();
404    /// let response = builder.poller().until_done().await?;
405    /// # Ok(()) }
406    ///
407    /// fn prepare_request_builder() -> UpdateConnectivityTest {
408    ///   # panic!();
409    ///   // ... details omitted ...
410    /// }
411    /// ```
412    #[derive(Clone, Debug)]
413    pub struct UpdateConnectivityTest(RequestBuilder<crate::model::UpdateConnectivityTestRequest>);
414
415    impl UpdateConnectivityTest {
416        pub(crate) fn new(
417            stub: std::sync::Arc<dyn super::super::stub::dynamic::ReachabilityService>,
418        ) -> Self {
419            Self(RequestBuilder::new(stub))
420        }
421
422        /// Sets the full request, replacing any prior values.
423        pub fn with_request<V: Into<crate::model::UpdateConnectivityTestRequest>>(
424            mut self,
425            v: V,
426        ) -> Self {
427            self.0.request = v.into();
428            self
429        }
430
431        /// Sets all the options, replacing any prior values.
432        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
433            self.0.options = v.into();
434            self
435        }
436
437        /// Sends the request.
438        ///
439        /// # Long running operations
440        ///
441        /// This starts, but does not poll, a longrunning operation. More information
442        /// on [update_connectivity_test][crate::client::ReachabilityService::update_connectivity_test].
443        pub async fn send(self) -> Result<longrunning::model::Operation> {
444            (*self.0.stub)
445                .update_connectivity_test(self.0.request, self.0.options)
446                .await
447                .map(gax::response::Response::into_body)
448        }
449
450        /// Creates a [Poller][lro::Poller] to work with `update_connectivity_test`.
451        pub fn poller(
452            self,
453        ) -> impl lro::Poller<crate::model::ConnectivityTest, crate::model::OperationMetadata>
454        {
455            type Operation = lro::internal::Operation<
456                crate::model::ConnectivityTest,
457                crate::model::OperationMetadata,
458            >;
459            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
460            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
461
462            let stub = self.0.stub.clone();
463            let mut options = self.0.options.clone();
464            options.set_retry_policy(gax::retry_policy::NeverRetry);
465            let query = move |name| {
466                let stub = stub.clone();
467                let options = options.clone();
468                async {
469                    let op = GetOperation::new(stub)
470                        .set_name(name)
471                        .with_options(options)
472                        .send()
473                        .await?;
474                    Ok(Operation::new(op))
475                }
476            };
477
478            let start = move || async {
479                let op = self.send().await?;
480                Ok(Operation::new(op))
481            };
482
483            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
484        }
485
486        /// Sets the value of [update_mask][crate::model::UpdateConnectivityTestRequest::update_mask].
487        ///
488        /// This is a **required** field for requests.
489        pub fn set_update_mask<T>(mut self, v: T) -> Self
490        where
491            T: std::convert::Into<wkt::FieldMask>,
492        {
493            self.0.request.update_mask = std::option::Option::Some(v.into());
494            self
495        }
496
497        /// Sets or clears the value of [update_mask][crate::model::UpdateConnectivityTestRequest::update_mask].
498        ///
499        /// This is a **required** field for requests.
500        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
501        where
502            T: std::convert::Into<wkt::FieldMask>,
503        {
504            self.0.request.update_mask = v.map(|x| x.into());
505            self
506        }
507
508        /// Sets the value of [resource][crate::model::UpdateConnectivityTestRequest::resource].
509        ///
510        /// This is a **required** field for requests.
511        pub fn set_resource<T>(mut self, v: T) -> Self
512        where
513            T: std::convert::Into<crate::model::ConnectivityTest>,
514        {
515            self.0.request.resource = std::option::Option::Some(v.into());
516            self
517        }
518
519        /// Sets or clears the value of [resource][crate::model::UpdateConnectivityTestRequest::resource].
520        ///
521        /// This is a **required** field for requests.
522        pub fn set_or_clear_resource<T>(mut self, v: std::option::Option<T>) -> Self
523        where
524            T: std::convert::Into<crate::model::ConnectivityTest>,
525        {
526            self.0.request.resource = v.map(|x| x.into());
527            self
528        }
529    }
530
531    #[doc(hidden)]
532    impl gax::options::internal::RequestBuilder for UpdateConnectivityTest {
533        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
534            &mut self.0.options
535        }
536    }
537
538    /// The request builder for [ReachabilityService::rerun_connectivity_test][crate::client::ReachabilityService::rerun_connectivity_test] calls.
539    ///
540    /// # Example
541    /// ```
542    /// # use google_cloud_networkmanagement_v1::builder::reachability_service::RerunConnectivityTest;
543    /// # async fn sample() -> gax::Result<()> {
544    /// use lro::Poller;
545    ///
546    /// let builder = prepare_request_builder();
547    /// let response = builder.poller().until_done().await?;
548    /// # Ok(()) }
549    ///
550    /// fn prepare_request_builder() -> RerunConnectivityTest {
551    ///   # panic!();
552    ///   // ... details omitted ...
553    /// }
554    /// ```
555    #[derive(Clone, Debug)]
556    pub struct RerunConnectivityTest(RequestBuilder<crate::model::RerunConnectivityTestRequest>);
557
558    impl RerunConnectivityTest {
559        pub(crate) fn new(
560            stub: std::sync::Arc<dyn super::super::stub::dynamic::ReachabilityService>,
561        ) -> Self {
562            Self(RequestBuilder::new(stub))
563        }
564
565        /// Sets the full request, replacing any prior values.
566        pub fn with_request<V: Into<crate::model::RerunConnectivityTestRequest>>(
567            mut self,
568            v: V,
569        ) -> Self {
570            self.0.request = v.into();
571            self
572        }
573
574        /// Sets all the options, replacing any prior values.
575        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
576            self.0.options = v.into();
577            self
578        }
579
580        /// Sends the request.
581        ///
582        /// # Long running operations
583        ///
584        /// This starts, but does not poll, a longrunning operation. More information
585        /// on [rerun_connectivity_test][crate::client::ReachabilityService::rerun_connectivity_test].
586        pub async fn send(self) -> Result<longrunning::model::Operation> {
587            (*self.0.stub)
588                .rerun_connectivity_test(self.0.request, self.0.options)
589                .await
590                .map(gax::response::Response::into_body)
591        }
592
593        /// Creates a [Poller][lro::Poller] to work with `rerun_connectivity_test`.
594        pub fn poller(
595            self,
596        ) -> impl lro::Poller<crate::model::ConnectivityTest, crate::model::OperationMetadata>
597        {
598            type Operation = lro::internal::Operation<
599                crate::model::ConnectivityTest,
600                crate::model::OperationMetadata,
601            >;
602            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
603            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
604
605            let stub = self.0.stub.clone();
606            let mut options = self.0.options.clone();
607            options.set_retry_policy(gax::retry_policy::NeverRetry);
608            let query = move |name| {
609                let stub = stub.clone();
610                let options = options.clone();
611                async {
612                    let op = GetOperation::new(stub)
613                        .set_name(name)
614                        .with_options(options)
615                        .send()
616                        .await?;
617                    Ok(Operation::new(op))
618                }
619            };
620
621            let start = move || async {
622                let op = self.send().await?;
623                Ok(Operation::new(op))
624            };
625
626            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
627        }
628
629        /// Sets the value of [name][crate::model::RerunConnectivityTestRequest::name].
630        ///
631        /// This is a **required** field for requests.
632        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
633            self.0.request.name = v.into();
634            self
635        }
636    }
637
638    #[doc(hidden)]
639    impl gax::options::internal::RequestBuilder for RerunConnectivityTest {
640        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
641            &mut self.0.options
642        }
643    }
644
645    /// The request builder for [ReachabilityService::delete_connectivity_test][crate::client::ReachabilityService::delete_connectivity_test] calls.
646    ///
647    /// # Example
648    /// ```
649    /// # use google_cloud_networkmanagement_v1::builder::reachability_service::DeleteConnectivityTest;
650    /// # async fn sample() -> gax::Result<()> {
651    /// use lro::Poller;
652    ///
653    /// let builder = prepare_request_builder();
654    /// let response = builder.poller().until_done().await?;
655    /// # Ok(()) }
656    ///
657    /// fn prepare_request_builder() -> DeleteConnectivityTest {
658    ///   # panic!();
659    ///   // ... details omitted ...
660    /// }
661    /// ```
662    #[derive(Clone, Debug)]
663    pub struct DeleteConnectivityTest(RequestBuilder<crate::model::DeleteConnectivityTestRequest>);
664
665    impl DeleteConnectivityTest {
666        pub(crate) fn new(
667            stub: std::sync::Arc<dyn super::super::stub::dynamic::ReachabilityService>,
668        ) -> Self {
669            Self(RequestBuilder::new(stub))
670        }
671
672        /// Sets the full request, replacing any prior values.
673        pub fn with_request<V: Into<crate::model::DeleteConnectivityTestRequest>>(
674            mut self,
675            v: V,
676        ) -> Self {
677            self.0.request = v.into();
678            self
679        }
680
681        /// Sets all the options, replacing any prior values.
682        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
683            self.0.options = v.into();
684            self
685        }
686
687        /// Sends the request.
688        ///
689        /// # Long running operations
690        ///
691        /// This starts, but does not poll, a longrunning operation. More information
692        /// on [delete_connectivity_test][crate::client::ReachabilityService::delete_connectivity_test].
693        pub async fn send(self) -> Result<longrunning::model::Operation> {
694            (*self.0.stub)
695                .delete_connectivity_test(self.0.request, self.0.options)
696                .await
697                .map(gax::response::Response::into_body)
698        }
699
700        /// Creates a [Poller][lro::Poller] to work with `delete_connectivity_test`.
701        pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
702            type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
703            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
704            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
705
706            let stub = self.0.stub.clone();
707            let mut options = self.0.options.clone();
708            options.set_retry_policy(gax::retry_policy::NeverRetry);
709            let query = move |name| {
710                let stub = stub.clone();
711                let options = options.clone();
712                async {
713                    let op = GetOperation::new(stub)
714                        .set_name(name)
715                        .with_options(options)
716                        .send()
717                        .await?;
718                    Ok(Operation::new(op))
719                }
720            };
721
722            let start = move || async {
723                let op = self.send().await?;
724                Ok(Operation::new(op))
725            };
726
727            lro::internal::new_unit_response_poller(
728                polling_error_policy,
729                polling_backoff_policy,
730                start,
731                query,
732            )
733        }
734
735        /// Sets the value of [name][crate::model::DeleteConnectivityTestRequest::name].
736        ///
737        /// This is a **required** field for requests.
738        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
739            self.0.request.name = v.into();
740            self
741        }
742    }
743
744    #[doc(hidden)]
745    impl gax::options::internal::RequestBuilder for DeleteConnectivityTest {
746        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
747            &mut self.0.options
748        }
749    }
750
751    /// The request builder for [ReachabilityService::list_locations][crate::client::ReachabilityService::list_locations] calls.
752    ///
753    /// # Example
754    /// ```
755    /// # use google_cloud_networkmanagement_v1::builder::reachability_service::ListLocations;
756    /// # async fn sample() -> gax::Result<()> {
757    /// use gax::paginator::ItemPaginator;
758    ///
759    /// let builder = prepare_request_builder();
760    /// let mut items = builder.by_item();
761    /// while let Some(result) = items.next().await {
762    ///   let item = result?;
763    /// }
764    /// # Ok(()) }
765    ///
766    /// fn prepare_request_builder() -> ListLocations {
767    ///   # panic!();
768    ///   // ... details omitted ...
769    /// }
770    /// ```
771    #[derive(Clone, Debug)]
772    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
773
774    impl ListLocations {
775        pub(crate) fn new(
776            stub: std::sync::Arc<dyn super::super::stub::dynamic::ReachabilityService>,
777        ) -> Self {
778            Self(RequestBuilder::new(stub))
779        }
780
781        /// Sets the full request, replacing any prior values.
782        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
783            mut self,
784            v: V,
785        ) -> Self {
786            self.0.request = v.into();
787            self
788        }
789
790        /// Sets all the options, replacing any prior values.
791        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
792            self.0.options = v.into();
793            self
794        }
795
796        /// Sends the request.
797        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
798            (*self.0.stub)
799                .list_locations(self.0.request, self.0.options)
800                .await
801                .map(gax::response::Response::into_body)
802        }
803
804        /// Streams each page in the collection.
805        pub fn by_page(
806            self,
807        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
808        {
809            use std::clone::Clone;
810            let token = self.0.request.page_token.clone();
811            let execute = move |token: String| {
812                let mut builder = self.clone();
813                builder.0.request = builder.0.request.set_page_token(token);
814                builder.send()
815            };
816            gax::paginator::internal::new_paginator(token, execute)
817        }
818
819        /// Streams each item in the collection.
820        pub fn by_item(
821            self,
822        ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
823        {
824            use gax::paginator::Paginator;
825            self.by_page().items()
826        }
827
828        /// Sets the value of [name][location::model::ListLocationsRequest::name].
829        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
830            self.0.request.name = v.into();
831            self
832        }
833
834        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
835        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
836            self.0.request.filter = v.into();
837            self
838        }
839
840        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
841        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
842            self.0.request.page_size = v.into();
843            self
844        }
845
846        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
847        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
848            self.0.request.page_token = v.into();
849            self
850        }
851    }
852
853    #[doc(hidden)]
854    impl gax::options::internal::RequestBuilder for ListLocations {
855        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
856            &mut self.0.options
857        }
858    }
859
860    /// The request builder for [ReachabilityService::get_location][crate::client::ReachabilityService::get_location] calls.
861    ///
862    /// # Example
863    /// ```
864    /// # use google_cloud_networkmanagement_v1::builder::reachability_service::GetLocation;
865    /// # async fn sample() -> gax::Result<()> {
866    ///
867    /// let builder = prepare_request_builder();
868    /// let response = builder.send().await?;
869    /// # Ok(()) }
870    ///
871    /// fn prepare_request_builder() -> GetLocation {
872    ///   # panic!();
873    ///   // ... details omitted ...
874    /// }
875    /// ```
876    #[derive(Clone, Debug)]
877    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
878
879    impl GetLocation {
880        pub(crate) fn new(
881            stub: std::sync::Arc<dyn super::super::stub::dynamic::ReachabilityService>,
882        ) -> Self {
883            Self(RequestBuilder::new(stub))
884        }
885
886        /// Sets the full request, replacing any prior values.
887        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
888            self.0.request = v.into();
889            self
890        }
891
892        /// Sets all the options, replacing any prior values.
893        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
894            self.0.options = v.into();
895            self
896        }
897
898        /// Sends the request.
899        pub async fn send(self) -> Result<location::model::Location> {
900            (*self.0.stub)
901                .get_location(self.0.request, self.0.options)
902                .await
903                .map(gax::response::Response::into_body)
904        }
905
906        /// Sets the value of [name][location::model::GetLocationRequest::name].
907        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
908            self.0.request.name = v.into();
909            self
910        }
911    }
912
913    #[doc(hidden)]
914    impl gax::options::internal::RequestBuilder for GetLocation {
915        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
916            &mut self.0.options
917        }
918    }
919
920    /// The request builder for [ReachabilityService::set_iam_policy][crate::client::ReachabilityService::set_iam_policy] calls.
921    ///
922    /// # Example
923    /// ```
924    /// # use google_cloud_networkmanagement_v1::builder::reachability_service::SetIamPolicy;
925    /// # async fn sample() -> gax::Result<()> {
926    ///
927    /// let builder = prepare_request_builder();
928    /// let response = builder.send().await?;
929    /// # Ok(()) }
930    ///
931    /// fn prepare_request_builder() -> SetIamPolicy {
932    ///   # panic!();
933    ///   // ... details omitted ...
934    /// }
935    /// ```
936    #[derive(Clone, Debug)]
937    pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
938
939    impl SetIamPolicy {
940        pub(crate) fn new(
941            stub: std::sync::Arc<dyn super::super::stub::dynamic::ReachabilityService>,
942        ) -> Self {
943            Self(RequestBuilder::new(stub))
944        }
945
946        /// Sets the full request, replacing any prior values.
947        pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
948            self.0.request = v.into();
949            self
950        }
951
952        /// Sets all the options, replacing any prior values.
953        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
954            self.0.options = v.into();
955            self
956        }
957
958        /// Sends the request.
959        pub async fn send(self) -> Result<iam_v1::model::Policy> {
960            (*self.0.stub)
961                .set_iam_policy(self.0.request, self.0.options)
962                .await
963                .map(gax::response::Response::into_body)
964        }
965
966        /// Sets the value of [resource][iam_v1::model::SetIamPolicyRequest::resource].
967        ///
968        /// This is a **required** field for requests.
969        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
970            self.0.request.resource = v.into();
971            self
972        }
973
974        /// Sets the value of [policy][iam_v1::model::SetIamPolicyRequest::policy].
975        ///
976        /// This is a **required** field for requests.
977        pub fn set_policy<T>(mut self, v: T) -> Self
978        where
979            T: std::convert::Into<iam_v1::model::Policy>,
980        {
981            self.0.request.policy = std::option::Option::Some(v.into());
982            self
983        }
984
985        /// Sets or clears the value of [policy][iam_v1::model::SetIamPolicyRequest::policy].
986        ///
987        /// This is a **required** field for requests.
988        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
989        where
990            T: std::convert::Into<iam_v1::model::Policy>,
991        {
992            self.0.request.policy = v.map(|x| x.into());
993            self
994        }
995
996        /// Sets the value of [update_mask][iam_v1::model::SetIamPolicyRequest::update_mask].
997        pub fn set_update_mask<T>(mut self, v: T) -> Self
998        where
999            T: std::convert::Into<wkt::FieldMask>,
1000        {
1001            self.0.request.update_mask = std::option::Option::Some(v.into());
1002            self
1003        }
1004
1005        /// Sets or clears the value of [update_mask][iam_v1::model::SetIamPolicyRequest::update_mask].
1006        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1007        where
1008            T: std::convert::Into<wkt::FieldMask>,
1009        {
1010            self.0.request.update_mask = v.map(|x| x.into());
1011            self
1012        }
1013    }
1014
1015    #[doc(hidden)]
1016    impl gax::options::internal::RequestBuilder for SetIamPolicy {
1017        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1018            &mut self.0.options
1019        }
1020    }
1021
1022    /// The request builder for [ReachabilityService::get_iam_policy][crate::client::ReachabilityService::get_iam_policy] calls.
1023    ///
1024    /// # Example
1025    /// ```
1026    /// # use google_cloud_networkmanagement_v1::builder::reachability_service::GetIamPolicy;
1027    /// # async fn sample() -> gax::Result<()> {
1028    ///
1029    /// let builder = prepare_request_builder();
1030    /// let response = builder.send().await?;
1031    /// # Ok(()) }
1032    ///
1033    /// fn prepare_request_builder() -> GetIamPolicy {
1034    ///   # panic!();
1035    ///   // ... details omitted ...
1036    /// }
1037    /// ```
1038    #[derive(Clone, Debug)]
1039    pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
1040
1041    impl GetIamPolicy {
1042        pub(crate) fn new(
1043            stub: std::sync::Arc<dyn super::super::stub::dynamic::ReachabilityService>,
1044        ) -> Self {
1045            Self(RequestBuilder::new(stub))
1046        }
1047
1048        /// Sets the full request, replacing any prior values.
1049        pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
1050            self.0.request = v.into();
1051            self
1052        }
1053
1054        /// Sets all the options, replacing any prior values.
1055        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1056            self.0.options = v.into();
1057            self
1058        }
1059
1060        /// Sends the request.
1061        pub async fn send(self) -> Result<iam_v1::model::Policy> {
1062            (*self.0.stub)
1063                .get_iam_policy(self.0.request, self.0.options)
1064                .await
1065                .map(gax::response::Response::into_body)
1066        }
1067
1068        /// Sets the value of [resource][iam_v1::model::GetIamPolicyRequest::resource].
1069        ///
1070        /// This is a **required** field for requests.
1071        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1072            self.0.request.resource = v.into();
1073            self
1074        }
1075
1076        /// Sets the value of [options][iam_v1::model::GetIamPolicyRequest::options].
1077        pub fn set_options<T>(mut self, v: T) -> Self
1078        where
1079            T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
1080        {
1081            self.0.request.options = std::option::Option::Some(v.into());
1082            self
1083        }
1084
1085        /// Sets or clears the value of [options][iam_v1::model::GetIamPolicyRequest::options].
1086        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
1087        where
1088            T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
1089        {
1090            self.0.request.options = v.map(|x| x.into());
1091            self
1092        }
1093    }
1094
1095    #[doc(hidden)]
1096    impl gax::options::internal::RequestBuilder for GetIamPolicy {
1097        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1098            &mut self.0.options
1099        }
1100    }
1101
1102    /// The request builder for [ReachabilityService::test_iam_permissions][crate::client::ReachabilityService::test_iam_permissions] calls.
1103    ///
1104    /// # Example
1105    /// ```
1106    /// # use google_cloud_networkmanagement_v1::builder::reachability_service::TestIamPermissions;
1107    /// # async fn sample() -> gax::Result<()> {
1108    ///
1109    /// let builder = prepare_request_builder();
1110    /// let response = builder.send().await?;
1111    /// # Ok(()) }
1112    ///
1113    /// fn prepare_request_builder() -> TestIamPermissions {
1114    ///   # panic!();
1115    ///   // ... details omitted ...
1116    /// }
1117    /// ```
1118    #[derive(Clone, Debug)]
1119    pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
1120
1121    impl TestIamPermissions {
1122        pub(crate) fn new(
1123            stub: std::sync::Arc<dyn super::super::stub::dynamic::ReachabilityService>,
1124        ) -> Self {
1125            Self(RequestBuilder::new(stub))
1126        }
1127
1128        /// Sets the full request, replacing any prior values.
1129        pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
1130            mut self,
1131            v: V,
1132        ) -> Self {
1133            self.0.request = v.into();
1134            self
1135        }
1136
1137        /// Sets all the options, replacing any prior values.
1138        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1139            self.0.options = v.into();
1140            self
1141        }
1142
1143        /// Sends the request.
1144        pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
1145            (*self.0.stub)
1146                .test_iam_permissions(self.0.request, self.0.options)
1147                .await
1148                .map(gax::response::Response::into_body)
1149        }
1150
1151        /// Sets the value of [resource][iam_v1::model::TestIamPermissionsRequest::resource].
1152        ///
1153        /// This is a **required** field for requests.
1154        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1155            self.0.request.resource = v.into();
1156            self
1157        }
1158
1159        /// Sets the value of [permissions][iam_v1::model::TestIamPermissionsRequest::permissions].
1160        ///
1161        /// This is a **required** field for requests.
1162        pub fn set_permissions<T, V>(mut self, v: T) -> Self
1163        where
1164            T: std::iter::IntoIterator<Item = V>,
1165            V: std::convert::Into<std::string::String>,
1166        {
1167            use std::iter::Iterator;
1168            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
1169            self
1170        }
1171    }
1172
1173    #[doc(hidden)]
1174    impl gax::options::internal::RequestBuilder for TestIamPermissions {
1175        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1176            &mut self.0.options
1177        }
1178    }
1179
1180    /// The request builder for [ReachabilityService::list_operations][crate::client::ReachabilityService::list_operations] calls.
1181    ///
1182    /// # Example
1183    /// ```
1184    /// # use google_cloud_networkmanagement_v1::builder::reachability_service::ListOperations;
1185    /// # async fn sample() -> gax::Result<()> {
1186    /// use gax::paginator::ItemPaginator;
1187    ///
1188    /// let builder = prepare_request_builder();
1189    /// let mut items = builder.by_item();
1190    /// while let Some(result) = items.next().await {
1191    ///   let item = result?;
1192    /// }
1193    /// # Ok(()) }
1194    ///
1195    /// fn prepare_request_builder() -> ListOperations {
1196    ///   # panic!();
1197    ///   // ... details omitted ...
1198    /// }
1199    /// ```
1200    #[derive(Clone, Debug)]
1201    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
1202
1203    impl ListOperations {
1204        pub(crate) fn new(
1205            stub: std::sync::Arc<dyn super::super::stub::dynamic::ReachabilityService>,
1206        ) -> Self {
1207            Self(RequestBuilder::new(stub))
1208        }
1209
1210        /// Sets the full request, replacing any prior values.
1211        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
1212            mut self,
1213            v: V,
1214        ) -> Self {
1215            self.0.request = v.into();
1216            self
1217        }
1218
1219        /// Sets all the options, replacing any prior values.
1220        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1221            self.0.options = v.into();
1222            self
1223        }
1224
1225        /// Sends the request.
1226        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
1227            (*self.0.stub)
1228                .list_operations(self.0.request, self.0.options)
1229                .await
1230                .map(gax::response::Response::into_body)
1231        }
1232
1233        /// Streams each page in the collection.
1234        pub fn by_page(
1235            self,
1236        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
1237        {
1238            use std::clone::Clone;
1239            let token = self.0.request.page_token.clone();
1240            let execute = move |token: String| {
1241                let mut builder = self.clone();
1242                builder.0.request = builder.0.request.set_page_token(token);
1243                builder.send()
1244            };
1245            gax::paginator::internal::new_paginator(token, execute)
1246        }
1247
1248        /// Streams each item in the collection.
1249        pub fn by_item(
1250            self,
1251        ) -> impl gax::paginator::ItemPaginator<
1252            longrunning::model::ListOperationsResponse,
1253            gax::error::Error,
1254        > {
1255            use gax::paginator::Paginator;
1256            self.by_page().items()
1257        }
1258
1259        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
1260        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1261            self.0.request.name = v.into();
1262            self
1263        }
1264
1265        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
1266        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1267            self.0.request.filter = v.into();
1268            self
1269        }
1270
1271        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
1272        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1273            self.0.request.page_size = v.into();
1274            self
1275        }
1276
1277        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
1278        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1279            self.0.request.page_token = v.into();
1280            self
1281        }
1282
1283        /// Sets the value of [return_partial_success][longrunning::model::ListOperationsRequest::return_partial_success].
1284        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
1285            self.0.request.return_partial_success = v.into();
1286            self
1287        }
1288    }
1289
1290    #[doc(hidden)]
1291    impl gax::options::internal::RequestBuilder for ListOperations {
1292        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1293            &mut self.0.options
1294        }
1295    }
1296
1297    /// The request builder for [ReachabilityService::get_operation][crate::client::ReachabilityService::get_operation] calls.
1298    ///
1299    /// # Example
1300    /// ```
1301    /// # use google_cloud_networkmanagement_v1::builder::reachability_service::GetOperation;
1302    /// # async fn sample() -> gax::Result<()> {
1303    ///
1304    /// let builder = prepare_request_builder();
1305    /// let response = builder.send().await?;
1306    /// # Ok(()) }
1307    ///
1308    /// fn prepare_request_builder() -> GetOperation {
1309    ///   # panic!();
1310    ///   // ... details omitted ...
1311    /// }
1312    /// ```
1313    #[derive(Clone, Debug)]
1314    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
1315
1316    impl GetOperation {
1317        pub(crate) fn new(
1318            stub: std::sync::Arc<dyn super::super::stub::dynamic::ReachabilityService>,
1319        ) -> Self {
1320            Self(RequestBuilder::new(stub))
1321        }
1322
1323        /// Sets the full request, replacing any prior values.
1324        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
1325            mut self,
1326            v: V,
1327        ) -> Self {
1328            self.0.request = v.into();
1329            self
1330        }
1331
1332        /// Sets all the options, replacing any prior values.
1333        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1334            self.0.options = v.into();
1335            self
1336        }
1337
1338        /// Sends the request.
1339        pub async fn send(self) -> Result<longrunning::model::Operation> {
1340            (*self.0.stub)
1341                .get_operation(self.0.request, self.0.options)
1342                .await
1343                .map(gax::response::Response::into_body)
1344        }
1345
1346        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
1347        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1348            self.0.request.name = v.into();
1349            self
1350        }
1351    }
1352
1353    #[doc(hidden)]
1354    impl gax::options::internal::RequestBuilder for GetOperation {
1355        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1356            &mut self.0.options
1357        }
1358    }
1359
1360    /// The request builder for [ReachabilityService::delete_operation][crate::client::ReachabilityService::delete_operation] calls.
1361    ///
1362    /// # Example
1363    /// ```
1364    /// # use google_cloud_networkmanagement_v1::builder::reachability_service::DeleteOperation;
1365    /// # async fn sample() -> gax::Result<()> {
1366    ///
1367    /// let builder = prepare_request_builder();
1368    /// let response = builder.send().await?;
1369    /// # Ok(()) }
1370    ///
1371    /// fn prepare_request_builder() -> DeleteOperation {
1372    ///   # panic!();
1373    ///   // ... details omitted ...
1374    /// }
1375    /// ```
1376    #[derive(Clone, Debug)]
1377    pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
1378
1379    impl DeleteOperation {
1380        pub(crate) fn new(
1381            stub: std::sync::Arc<dyn super::super::stub::dynamic::ReachabilityService>,
1382        ) -> Self {
1383            Self(RequestBuilder::new(stub))
1384        }
1385
1386        /// Sets the full request, replacing any prior values.
1387        pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
1388            mut self,
1389            v: V,
1390        ) -> Self {
1391            self.0.request = v.into();
1392            self
1393        }
1394
1395        /// Sets all the options, replacing any prior values.
1396        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1397            self.0.options = v.into();
1398            self
1399        }
1400
1401        /// Sends the request.
1402        pub async fn send(self) -> Result<()> {
1403            (*self.0.stub)
1404                .delete_operation(self.0.request, self.0.options)
1405                .await
1406                .map(gax::response::Response::into_body)
1407        }
1408
1409        /// Sets the value of [name][longrunning::model::DeleteOperationRequest::name].
1410        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1411            self.0.request.name = v.into();
1412            self
1413        }
1414    }
1415
1416    #[doc(hidden)]
1417    impl gax::options::internal::RequestBuilder for DeleteOperation {
1418        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1419            &mut self.0.options
1420        }
1421    }
1422
1423    /// The request builder for [ReachabilityService::cancel_operation][crate::client::ReachabilityService::cancel_operation] calls.
1424    ///
1425    /// # Example
1426    /// ```
1427    /// # use google_cloud_networkmanagement_v1::builder::reachability_service::CancelOperation;
1428    /// # async fn sample() -> gax::Result<()> {
1429    ///
1430    /// let builder = prepare_request_builder();
1431    /// let response = builder.send().await?;
1432    /// # Ok(()) }
1433    ///
1434    /// fn prepare_request_builder() -> CancelOperation {
1435    ///   # panic!();
1436    ///   // ... details omitted ...
1437    /// }
1438    /// ```
1439    #[derive(Clone, Debug)]
1440    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
1441
1442    impl CancelOperation {
1443        pub(crate) fn new(
1444            stub: std::sync::Arc<dyn super::super::stub::dynamic::ReachabilityService>,
1445        ) -> Self {
1446            Self(RequestBuilder::new(stub))
1447        }
1448
1449        /// Sets the full request, replacing any prior values.
1450        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
1451            mut self,
1452            v: V,
1453        ) -> Self {
1454            self.0.request = v.into();
1455            self
1456        }
1457
1458        /// Sets all the options, replacing any prior values.
1459        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1460            self.0.options = v.into();
1461            self
1462        }
1463
1464        /// Sends the request.
1465        pub async fn send(self) -> Result<()> {
1466            (*self.0.stub)
1467                .cancel_operation(self.0.request, self.0.options)
1468                .await
1469                .map(gax::response::Response::into_body)
1470        }
1471
1472        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
1473        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1474            self.0.request.name = v.into();
1475            self
1476        }
1477    }
1478
1479    #[doc(hidden)]
1480    impl gax::options::internal::RequestBuilder for CancelOperation {
1481        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1482            &mut self.0.options
1483        }
1484    }
1485}
1486
1487pub mod vpc_flow_logs_service {
1488    use crate::Result;
1489
1490    /// A builder for [VpcFlowLogsService][crate::client::VpcFlowLogsService].
1491    ///
1492    /// ```
1493    /// # async fn sample() -> gax::client_builder::Result<()> {
1494    /// # use google_cloud_networkmanagement_v1::*;
1495    /// # use builder::vpc_flow_logs_service::ClientBuilder;
1496    /// # use client::VpcFlowLogsService;
1497    /// let builder : ClientBuilder = VpcFlowLogsService::builder();
1498    /// let client = builder
1499    ///     .with_endpoint("https://networkmanagement.googleapis.com")
1500    ///     .build().await?;
1501    /// # Ok(()) }
1502    /// ```
1503    pub type ClientBuilder =
1504        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1505
1506    pub(crate) mod client {
1507        use super::super::super::client::VpcFlowLogsService;
1508        pub struct Factory;
1509        impl gax::client_builder::internal::ClientFactory for Factory {
1510            type Client = VpcFlowLogsService;
1511            type Credentials = gaxi::options::Credentials;
1512            async fn build(
1513                self,
1514                config: gaxi::options::ClientConfig,
1515            ) -> gax::client_builder::Result<Self::Client> {
1516                Self::Client::new(config).await
1517            }
1518        }
1519    }
1520
1521    /// Common implementation for [crate::client::VpcFlowLogsService] request builders.
1522    #[derive(Clone, Debug)]
1523    pub(crate) struct RequestBuilder<R: std::default::Default> {
1524        stub: std::sync::Arc<dyn super::super::stub::dynamic::VpcFlowLogsService>,
1525        request: R,
1526        options: gax::options::RequestOptions,
1527    }
1528
1529    impl<R> RequestBuilder<R>
1530    where
1531        R: std::default::Default,
1532    {
1533        pub(crate) fn new(
1534            stub: std::sync::Arc<dyn super::super::stub::dynamic::VpcFlowLogsService>,
1535        ) -> Self {
1536            Self {
1537                stub,
1538                request: R::default(),
1539                options: gax::options::RequestOptions::default(),
1540            }
1541        }
1542    }
1543
1544    /// The request builder for [VpcFlowLogsService::list_vpc_flow_logs_configs][crate::client::VpcFlowLogsService::list_vpc_flow_logs_configs] calls.
1545    ///
1546    /// # Example
1547    /// ```
1548    /// # use google_cloud_networkmanagement_v1::builder::vpc_flow_logs_service::ListVpcFlowLogsConfigs;
1549    /// # async fn sample() -> gax::Result<()> {
1550    /// use gax::paginator::ItemPaginator;
1551    ///
1552    /// let builder = prepare_request_builder();
1553    /// let mut items = builder.by_item();
1554    /// while let Some(result) = items.next().await {
1555    ///   let item = result?;
1556    /// }
1557    /// # Ok(()) }
1558    ///
1559    /// fn prepare_request_builder() -> ListVpcFlowLogsConfigs {
1560    ///   # panic!();
1561    ///   // ... details omitted ...
1562    /// }
1563    /// ```
1564    #[derive(Clone, Debug)]
1565    pub struct ListVpcFlowLogsConfigs(RequestBuilder<crate::model::ListVpcFlowLogsConfigsRequest>);
1566
1567    impl ListVpcFlowLogsConfigs {
1568        pub(crate) fn new(
1569            stub: std::sync::Arc<dyn super::super::stub::dynamic::VpcFlowLogsService>,
1570        ) -> Self {
1571            Self(RequestBuilder::new(stub))
1572        }
1573
1574        /// Sets the full request, replacing any prior values.
1575        pub fn with_request<V: Into<crate::model::ListVpcFlowLogsConfigsRequest>>(
1576            mut self,
1577            v: V,
1578        ) -> Self {
1579            self.0.request = v.into();
1580            self
1581        }
1582
1583        /// Sets all the options, replacing any prior values.
1584        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1585            self.0.options = v.into();
1586            self
1587        }
1588
1589        /// Sends the request.
1590        pub async fn send(self) -> Result<crate::model::ListVpcFlowLogsConfigsResponse> {
1591            (*self.0.stub)
1592                .list_vpc_flow_logs_configs(self.0.request, self.0.options)
1593                .await
1594                .map(gax::response::Response::into_body)
1595        }
1596
1597        /// Streams each page in the collection.
1598        pub fn by_page(
1599            self,
1600        ) -> impl gax::paginator::Paginator<
1601            crate::model::ListVpcFlowLogsConfigsResponse,
1602            gax::error::Error,
1603        > {
1604            use std::clone::Clone;
1605            let token = self.0.request.page_token.clone();
1606            let execute = move |token: String| {
1607                let mut builder = self.clone();
1608                builder.0.request = builder.0.request.set_page_token(token);
1609                builder.send()
1610            };
1611            gax::paginator::internal::new_paginator(token, execute)
1612        }
1613
1614        /// Streams each item in the collection.
1615        pub fn by_item(
1616            self,
1617        ) -> impl gax::paginator::ItemPaginator<
1618            crate::model::ListVpcFlowLogsConfigsResponse,
1619            gax::error::Error,
1620        > {
1621            use gax::paginator::Paginator;
1622            self.by_page().items()
1623        }
1624
1625        /// Sets the value of [parent][crate::model::ListVpcFlowLogsConfigsRequest::parent].
1626        ///
1627        /// This is a **required** field for requests.
1628        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1629            self.0.request.parent = v.into();
1630            self
1631        }
1632
1633        /// Sets the value of [page_size][crate::model::ListVpcFlowLogsConfigsRequest::page_size].
1634        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1635            self.0.request.page_size = v.into();
1636            self
1637        }
1638
1639        /// Sets the value of [page_token][crate::model::ListVpcFlowLogsConfigsRequest::page_token].
1640        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1641            self.0.request.page_token = v.into();
1642            self
1643        }
1644
1645        /// Sets the value of [filter][crate::model::ListVpcFlowLogsConfigsRequest::filter].
1646        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1647            self.0.request.filter = v.into();
1648            self
1649        }
1650
1651        /// Sets the value of [order_by][crate::model::ListVpcFlowLogsConfigsRequest::order_by].
1652        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1653            self.0.request.order_by = v.into();
1654            self
1655        }
1656    }
1657
1658    #[doc(hidden)]
1659    impl gax::options::internal::RequestBuilder for ListVpcFlowLogsConfigs {
1660        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1661            &mut self.0.options
1662        }
1663    }
1664
1665    /// The request builder for [VpcFlowLogsService::get_vpc_flow_logs_config][crate::client::VpcFlowLogsService::get_vpc_flow_logs_config] calls.
1666    ///
1667    /// # Example
1668    /// ```
1669    /// # use google_cloud_networkmanagement_v1::builder::vpc_flow_logs_service::GetVpcFlowLogsConfig;
1670    /// # async fn sample() -> gax::Result<()> {
1671    ///
1672    /// let builder = prepare_request_builder();
1673    /// let response = builder.send().await?;
1674    /// # Ok(()) }
1675    ///
1676    /// fn prepare_request_builder() -> GetVpcFlowLogsConfig {
1677    ///   # panic!();
1678    ///   // ... details omitted ...
1679    /// }
1680    /// ```
1681    #[derive(Clone, Debug)]
1682    pub struct GetVpcFlowLogsConfig(RequestBuilder<crate::model::GetVpcFlowLogsConfigRequest>);
1683
1684    impl GetVpcFlowLogsConfig {
1685        pub(crate) fn new(
1686            stub: std::sync::Arc<dyn super::super::stub::dynamic::VpcFlowLogsService>,
1687        ) -> Self {
1688            Self(RequestBuilder::new(stub))
1689        }
1690
1691        /// Sets the full request, replacing any prior values.
1692        pub fn with_request<V: Into<crate::model::GetVpcFlowLogsConfigRequest>>(
1693            mut self,
1694            v: V,
1695        ) -> Self {
1696            self.0.request = v.into();
1697            self
1698        }
1699
1700        /// Sets all the options, replacing any prior values.
1701        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1702            self.0.options = v.into();
1703            self
1704        }
1705
1706        /// Sends the request.
1707        pub async fn send(self) -> Result<crate::model::VpcFlowLogsConfig> {
1708            (*self.0.stub)
1709                .get_vpc_flow_logs_config(self.0.request, self.0.options)
1710                .await
1711                .map(gax::response::Response::into_body)
1712        }
1713
1714        /// Sets the value of [name][crate::model::GetVpcFlowLogsConfigRequest::name].
1715        ///
1716        /// This is a **required** field for requests.
1717        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1718            self.0.request.name = v.into();
1719            self
1720        }
1721    }
1722
1723    #[doc(hidden)]
1724    impl gax::options::internal::RequestBuilder for GetVpcFlowLogsConfig {
1725        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1726            &mut self.0.options
1727        }
1728    }
1729
1730    /// The request builder for [VpcFlowLogsService::create_vpc_flow_logs_config][crate::client::VpcFlowLogsService::create_vpc_flow_logs_config] calls.
1731    ///
1732    /// # Example
1733    /// ```
1734    /// # use google_cloud_networkmanagement_v1::builder::vpc_flow_logs_service::CreateVpcFlowLogsConfig;
1735    /// # async fn sample() -> gax::Result<()> {
1736    /// use lro::Poller;
1737    ///
1738    /// let builder = prepare_request_builder();
1739    /// let response = builder.poller().until_done().await?;
1740    /// # Ok(()) }
1741    ///
1742    /// fn prepare_request_builder() -> CreateVpcFlowLogsConfig {
1743    ///   # panic!();
1744    ///   // ... details omitted ...
1745    /// }
1746    /// ```
1747    #[derive(Clone, Debug)]
1748    pub struct CreateVpcFlowLogsConfig(
1749        RequestBuilder<crate::model::CreateVpcFlowLogsConfigRequest>,
1750    );
1751
1752    impl CreateVpcFlowLogsConfig {
1753        pub(crate) fn new(
1754            stub: std::sync::Arc<dyn super::super::stub::dynamic::VpcFlowLogsService>,
1755        ) -> Self {
1756            Self(RequestBuilder::new(stub))
1757        }
1758
1759        /// Sets the full request, replacing any prior values.
1760        pub fn with_request<V: Into<crate::model::CreateVpcFlowLogsConfigRequest>>(
1761            mut self,
1762            v: V,
1763        ) -> Self {
1764            self.0.request = v.into();
1765            self
1766        }
1767
1768        /// Sets all the options, replacing any prior values.
1769        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1770            self.0.options = v.into();
1771            self
1772        }
1773
1774        /// Sends the request.
1775        ///
1776        /// # Long running operations
1777        ///
1778        /// This starts, but does not poll, a longrunning operation. More information
1779        /// on [create_vpc_flow_logs_config][crate::client::VpcFlowLogsService::create_vpc_flow_logs_config].
1780        pub async fn send(self) -> Result<longrunning::model::Operation> {
1781            (*self.0.stub)
1782                .create_vpc_flow_logs_config(self.0.request, self.0.options)
1783                .await
1784                .map(gax::response::Response::into_body)
1785        }
1786
1787        /// Creates a [Poller][lro::Poller] to work with `create_vpc_flow_logs_config`.
1788        pub fn poller(
1789            self,
1790        ) -> impl lro::Poller<crate::model::VpcFlowLogsConfig, crate::model::OperationMetadata>
1791        {
1792            type Operation = lro::internal::Operation<
1793                crate::model::VpcFlowLogsConfig,
1794                crate::model::OperationMetadata,
1795            >;
1796            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1797            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1798
1799            let stub = self.0.stub.clone();
1800            let mut options = self.0.options.clone();
1801            options.set_retry_policy(gax::retry_policy::NeverRetry);
1802            let query = move |name| {
1803                let stub = stub.clone();
1804                let options = options.clone();
1805                async {
1806                    let op = GetOperation::new(stub)
1807                        .set_name(name)
1808                        .with_options(options)
1809                        .send()
1810                        .await?;
1811                    Ok(Operation::new(op))
1812                }
1813            };
1814
1815            let start = move || async {
1816                let op = self.send().await?;
1817                Ok(Operation::new(op))
1818            };
1819
1820            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1821        }
1822
1823        /// Sets the value of [parent][crate::model::CreateVpcFlowLogsConfigRequest::parent].
1824        ///
1825        /// This is a **required** field for requests.
1826        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1827            self.0.request.parent = v.into();
1828            self
1829        }
1830
1831        /// Sets the value of [vpc_flow_logs_config_id][crate::model::CreateVpcFlowLogsConfigRequest::vpc_flow_logs_config_id].
1832        ///
1833        /// This is a **required** field for requests.
1834        pub fn set_vpc_flow_logs_config_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1835            self.0.request.vpc_flow_logs_config_id = v.into();
1836            self
1837        }
1838
1839        /// Sets the value of [vpc_flow_logs_config][crate::model::CreateVpcFlowLogsConfigRequest::vpc_flow_logs_config].
1840        ///
1841        /// This is a **required** field for requests.
1842        pub fn set_vpc_flow_logs_config<T>(mut self, v: T) -> Self
1843        where
1844            T: std::convert::Into<crate::model::VpcFlowLogsConfig>,
1845        {
1846            self.0.request.vpc_flow_logs_config = std::option::Option::Some(v.into());
1847            self
1848        }
1849
1850        /// Sets or clears the value of [vpc_flow_logs_config][crate::model::CreateVpcFlowLogsConfigRequest::vpc_flow_logs_config].
1851        ///
1852        /// This is a **required** field for requests.
1853        pub fn set_or_clear_vpc_flow_logs_config<T>(mut self, v: std::option::Option<T>) -> Self
1854        where
1855            T: std::convert::Into<crate::model::VpcFlowLogsConfig>,
1856        {
1857            self.0.request.vpc_flow_logs_config = v.map(|x| x.into());
1858            self
1859        }
1860    }
1861
1862    #[doc(hidden)]
1863    impl gax::options::internal::RequestBuilder for CreateVpcFlowLogsConfig {
1864        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1865            &mut self.0.options
1866        }
1867    }
1868
1869    /// The request builder for [VpcFlowLogsService::update_vpc_flow_logs_config][crate::client::VpcFlowLogsService::update_vpc_flow_logs_config] calls.
1870    ///
1871    /// # Example
1872    /// ```
1873    /// # use google_cloud_networkmanagement_v1::builder::vpc_flow_logs_service::UpdateVpcFlowLogsConfig;
1874    /// # async fn sample() -> gax::Result<()> {
1875    /// use lro::Poller;
1876    ///
1877    /// let builder = prepare_request_builder();
1878    /// let response = builder.poller().until_done().await?;
1879    /// # Ok(()) }
1880    ///
1881    /// fn prepare_request_builder() -> UpdateVpcFlowLogsConfig {
1882    ///   # panic!();
1883    ///   // ... details omitted ...
1884    /// }
1885    /// ```
1886    #[derive(Clone, Debug)]
1887    pub struct UpdateVpcFlowLogsConfig(
1888        RequestBuilder<crate::model::UpdateVpcFlowLogsConfigRequest>,
1889    );
1890
1891    impl UpdateVpcFlowLogsConfig {
1892        pub(crate) fn new(
1893            stub: std::sync::Arc<dyn super::super::stub::dynamic::VpcFlowLogsService>,
1894        ) -> Self {
1895            Self(RequestBuilder::new(stub))
1896        }
1897
1898        /// Sets the full request, replacing any prior values.
1899        pub fn with_request<V: Into<crate::model::UpdateVpcFlowLogsConfigRequest>>(
1900            mut self,
1901            v: V,
1902        ) -> Self {
1903            self.0.request = v.into();
1904            self
1905        }
1906
1907        /// Sets all the options, replacing any prior values.
1908        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1909            self.0.options = v.into();
1910            self
1911        }
1912
1913        /// Sends the request.
1914        ///
1915        /// # Long running operations
1916        ///
1917        /// This starts, but does not poll, a longrunning operation. More information
1918        /// on [update_vpc_flow_logs_config][crate::client::VpcFlowLogsService::update_vpc_flow_logs_config].
1919        pub async fn send(self) -> Result<longrunning::model::Operation> {
1920            (*self.0.stub)
1921                .update_vpc_flow_logs_config(self.0.request, self.0.options)
1922                .await
1923                .map(gax::response::Response::into_body)
1924        }
1925
1926        /// Creates a [Poller][lro::Poller] to work with `update_vpc_flow_logs_config`.
1927        pub fn poller(
1928            self,
1929        ) -> impl lro::Poller<crate::model::VpcFlowLogsConfig, crate::model::OperationMetadata>
1930        {
1931            type Operation = lro::internal::Operation<
1932                crate::model::VpcFlowLogsConfig,
1933                crate::model::OperationMetadata,
1934            >;
1935            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1936            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1937
1938            let stub = self.0.stub.clone();
1939            let mut options = self.0.options.clone();
1940            options.set_retry_policy(gax::retry_policy::NeverRetry);
1941            let query = move |name| {
1942                let stub = stub.clone();
1943                let options = options.clone();
1944                async {
1945                    let op = GetOperation::new(stub)
1946                        .set_name(name)
1947                        .with_options(options)
1948                        .send()
1949                        .await?;
1950                    Ok(Operation::new(op))
1951                }
1952            };
1953
1954            let start = move || async {
1955                let op = self.send().await?;
1956                Ok(Operation::new(op))
1957            };
1958
1959            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1960        }
1961
1962        /// Sets the value of [update_mask][crate::model::UpdateVpcFlowLogsConfigRequest::update_mask].
1963        ///
1964        /// This is a **required** field for requests.
1965        pub fn set_update_mask<T>(mut self, v: T) -> Self
1966        where
1967            T: std::convert::Into<wkt::FieldMask>,
1968        {
1969            self.0.request.update_mask = std::option::Option::Some(v.into());
1970            self
1971        }
1972
1973        /// Sets or clears the value of [update_mask][crate::model::UpdateVpcFlowLogsConfigRequest::update_mask].
1974        ///
1975        /// This is a **required** field for requests.
1976        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1977        where
1978            T: std::convert::Into<wkt::FieldMask>,
1979        {
1980            self.0.request.update_mask = v.map(|x| x.into());
1981            self
1982        }
1983
1984        /// Sets the value of [vpc_flow_logs_config][crate::model::UpdateVpcFlowLogsConfigRequest::vpc_flow_logs_config].
1985        ///
1986        /// This is a **required** field for requests.
1987        pub fn set_vpc_flow_logs_config<T>(mut self, v: T) -> Self
1988        where
1989            T: std::convert::Into<crate::model::VpcFlowLogsConfig>,
1990        {
1991            self.0.request.vpc_flow_logs_config = std::option::Option::Some(v.into());
1992            self
1993        }
1994
1995        /// Sets or clears the value of [vpc_flow_logs_config][crate::model::UpdateVpcFlowLogsConfigRequest::vpc_flow_logs_config].
1996        ///
1997        /// This is a **required** field for requests.
1998        pub fn set_or_clear_vpc_flow_logs_config<T>(mut self, v: std::option::Option<T>) -> Self
1999        where
2000            T: std::convert::Into<crate::model::VpcFlowLogsConfig>,
2001        {
2002            self.0.request.vpc_flow_logs_config = v.map(|x| x.into());
2003            self
2004        }
2005    }
2006
2007    #[doc(hidden)]
2008    impl gax::options::internal::RequestBuilder for UpdateVpcFlowLogsConfig {
2009        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2010            &mut self.0.options
2011        }
2012    }
2013
2014    /// The request builder for [VpcFlowLogsService::delete_vpc_flow_logs_config][crate::client::VpcFlowLogsService::delete_vpc_flow_logs_config] calls.
2015    ///
2016    /// # Example
2017    /// ```
2018    /// # use google_cloud_networkmanagement_v1::builder::vpc_flow_logs_service::DeleteVpcFlowLogsConfig;
2019    /// # async fn sample() -> gax::Result<()> {
2020    /// use lro::Poller;
2021    ///
2022    /// let builder = prepare_request_builder();
2023    /// let response = builder.poller().until_done().await?;
2024    /// # Ok(()) }
2025    ///
2026    /// fn prepare_request_builder() -> DeleteVpcFlowLogsConfig {
2027    ///   # panic!();
2028    ///   // ... details omitted ...
2029    /// }
2030    /// ```
2031    #[derive(Clone, Debug)]
2032    pub struct DeleteVpcFlowLogsConfig(
2033        RequestBuilder<crate::model::DeleteVpcFlowLogsConfigRequest>,
2034    );
2035
2036    impl DeleteVpcFlowLogsConfig {
2037        pub(crate) fn new(
2038            stub: std::sync::Arc<dyn super::super::stub::dynamic::VpcFlowLogsService>,
2039        ) -> Self {
2040            Self(RequestBuilder::new(stub))
2041        }
2042
2043        /// Sets the full request, replacing any prior values.
2044        pub fn with_request<V: Into<crate::model::DeleteVpcFlowLogsConfigRequest>>(
2045            mut self,
2046            v: V,
2047        ) -> Self {
2048            self.0.request = v.into();
2049            self
2050        }
2051
2052        /// Sets all the options, replacing any prior values.
2053        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2054            self.0.options = v.into();
2055            self
2056        }
2057
2058        /// Sends the request.
2059        ///
2060        /// # Long running operations
2061        ///
2062        /// This starts, but does not poll, a longrunning operation. More information
2063        /// on [delete_vpc_flow_logs_config][crate::client::VpcFlowLogsService::delete_vpc_flow_logs_config].
2064        pub async fn send(self) -> Result<longrunning::model::Operation> {
2065            (*self.0.stub)
2066                .delete_vpc_flow_logs_config(self.0.request, self.0.options)
2067                .await
2068                .map(gax::response::Response::into_body)
2069        }
2070
2071        /// Creates a [Poller][lro::Poller] to work with `delete_vpc_flow_logs_config`.
2072        pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
2073            type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2074            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2075            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2076
2077            let stub = self.0.stub.clone();
2078            let mut options = self.0.options.clone();
2079            options.set_retry_policy(gax::retry_policy::NeverRetry);
2080            let query = move |name| {
2081                let stub = stub.clone();
2082                let options = options.clone();
2083                async {
2084                    let op = GetOperation::new(stub)
2085                        .set_name(name)
2086                        .with_options(options)
2087                        .send()
2088                        .await?;
2089                    Ok(Operation::new(op))
2090                }
2091            };
2092
2093            let start = move || async {
2094                let op = self.send().await?;
2095                Ok(Operation::new(op))
2096            };
2097
2098            lro::internal::new_unit_response_poller(
2099                polling_error_policy,
2100                polling_backoff_policy,
2101                start,
2102                query,
2103            )
2104        }
2105
2106        /// Sets the value of [name][crate::model::DeleteVpcFlowLogsConfigRequest::name].
2107        ///
2108        /// This is a **required** field for requests.
2109        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2110            self.0.request.name = v.into();
2111            self
2112        }
2113    }
2114
2115    #[doc(hidden)]
2116    impl gax::options::internal::RequestBuilder for DeleteVpcFlowLogsConfig {
2117        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2118            &mut self.0.options
2119        }
2120    }
2121
2122    /// The request builder for [VpcFlowLogsService::query_org_vpc_flow_logs_configs][crate::client::VpcFlowLogsService::query_org_vpc_flow_logs_configs] calls.
2123    ///
2124    /// # Example
2125    /// ```
2126    /// # use google_cloud_networkmanagement_v1::builder::vpc_flow_logs_service::QueryOrgVpcFlowLogsConfigs;
2127    /// # async fn sample() -> gax::Result<()> {
2128    /// use gax::paginator::ItemPaginator;
2129    ///
2130    /// let builder = prepare_request_builder();
2131    /// let mut items = builder.by_item();
2132    /// while let Some(result) = items.next().await {
2133    ///   let item = result?;
2134    /// }
2135    /// # Ok(()) }
2136    ///
2137    /// fn prepare_request_builder() -> QueryOrgVpcFlowLogsConfigs {
2138    ///   # panic!();
2139    ///   // ... details omitted ...
2140    /// }
2141    /// ```
2142    #[derive(Clone, Debug)]
2143    pub struct QueryOrgVpcFlowLogsConfigs(
2144        RequestBuilder<crate::model::QueryOrgVpcFlowLogsConfigsRequest>,
2145    );
2146
2147    impl QueryOrgVpcFlowLogsConfigs {
2148        pub(crate) fn new(
2149            stub: std::sync::Arc<dyn super::super::stub::dynamic::VpcFlowLogsService>,
2150        ) -> Self {
2151            Self(RequestBuilder::new(stub))
2152        }
2153
2154        /// Sets the full request, replacing any prior values.
2155        pub fn with_request<V: Into<crate::model::QueryOrgVpcFlowLogsConfigsRequest>>(
2156            mut self,
2157            v: V,
2158        ) -> Self {
2159            self.0.request = v.into();
2160            self
2161        }
2162
2163        /// Sets all the options, replacing any prior values.
2164        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2165            self.0.options = v.into();
2166            self
2167        }
2168
2169        /// Sends the request.
2170        pub async fn send(self) -> Result<crate::model::QueryOrgVpcFlowLogsConfigsResponse> {
2171            (*self.0.stub)
2172                .query_org_vpc_flow_logs_configs(self.0.request, self.0.options)
2173                .await
2174                .map(gax::response::Response::into_body)
2175        }
2176
2177        /// Streams each page in the collection.
2178        pub fn by_page(
2179            self,
2180        ) -> impl gax::paginator::Paginator<
2181            crate::model::QueryOrgVpcFlowLogsConfigsResponse,
2182            gax::error::Error,
2183        > {
2184            use std::clone::Clone;
2185            let token = self.0.request.page_token.clone();
2186            let execute = move |token: String| {
2187                let mut builder = self.clone();
2188                builder.0.request = builder.0.request.set_page_token(token);
2189                builder.send()
2190            };
2191            gax::paginator::internal::new_paginator(token, execute)
2192        }
2193
2194        /// Streams each item in the collection.
2195        pub fn by_item(
2196            self,
2197        ) -> impl gax::paginator::ItemPaginator<
2198            crate::model::QueryOrgVpcFlowLogsConfigsResponse,
2199            gax::error::Error,
2200        > {
2201            use gax::paginator::Paginator;
2202            self.by_page().items()
2203        }
2204
2205        /// Sets the value of [parent][crate::model::QueryOrgVpcFlowLogsConfigsRequest::parent].
2206        ///
2207        /// This is a **required** field for requests.
2208        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2209            self.0.request.parent = v.into();
2210            self
2211        }
2212
2213        /// Sets the value of [page_size][crate::model::QueryOrgVpcFlowLogsConfigsRequest::page_size].
2214        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2215            self.0.request.page_size = v.into();
2216            self
2217        }
2218
2219        /// Sets the value of [page_token][crate::model::QueryOrgVpcFlowLogsConfigsRequest::page_token].
2220        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2221            self.0.request.page_token = v.into();
2222            self
2223        }
2224
2225        /// Sets the value of [filter][crate::model::QueryOrgVpcFlowLogsConfigsRequest::filter].
2226        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2227            self.0.request.filter = v.into();
2228            self
2229        }
2230    }
2231
2232    #[doc(hidden)]
2233    impl gax::options::internal::RequestBuilder for QueryOrgVpcFlowLogsConfigs {
2234        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2235            &mut self.0.options
2236        }
2237    }
2238
2239    /// The request builder for [VpcFlowLogsService::show_effective_flow_logs_configs][crate::client::VpcFlowLogsService::show_effective_flow_logs_configs] calls.
2240    ///
2241    /// # Example
2242    /// ```
2243    /// # use google_cloud_networkmanagement_v1::builder::vpc_flow_logs_service::ShowEffectiveFlowLogsConfigs;
2244    /// # async fn sample() -> gax::Result<()> {
2245    /// use gax::paginator::ItemPaginator;
2246    ///
2247    /// let builder = prepare_request_builder();
2248    /// let mut items = builder.by_item();
2249    /// while let Some(result) = items.next().await {
2250    ///   let item = result?;
2251    /// }
2252    /// # Ok(()) }
2253    ///
2254    /// fn prepare_request_builder() -> ShowEffectiveFlowLogsConfigs {
2255    ///   # panic!();
2256    ///   // ... details omitted ...
2257    /// }
2258    /// ```
2259    #[derive(Clone, Debug)]
2260    pub struct ShowEffectiveFlowLogsConfigs(
2261        RequestBuilder<crate::model::ShowEffectiveFlowLogsConfigsRequest>,
2262    );
2263
2264    impl ShowEffectiveFlowLogsConfigs {
2265        pub(crate) fn new(
2266            stub: std::sync::Arc<dyn super::super::stub::dynamic::VpcFlowLogsService>,
2267        ) -> Self {
2268            Self(RequestBuilder::new(stub))
2269        }
2270
2271        /// Sets the full request, replacing any prior values.
2272        pub fn with_request<V: Into<crate::model::ShowEffectiveFlowLogsConfigsRequest>>(
2273            mut self,
2274            v: V,
2275        ) -> Self {
2276            self.0.request = v.into();
2277            self
2278        }
2279
2280        /// Sets all the options, replacing any prior values.
2281        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2282            self.0.options = v.into();
2283            self
2284        }
2285
2286        /// Sends the request.
2287        pub async fn send(self) -> Result<crate::model::ShowEffectiveFlowLogsConfigsResponse> {
2288            (*self.0.stub)
2289                .show_effective_flow_logs_configs(self.0.request, self.0.options)
2290                .await
2291                .map(gax::response::Response::into_body)
2292        }
2293
2294        /// Streams each page in the collection.
2295        pub fn by_page(
2296            self,
2297        ) -> impl gax::paginator::Paginator<
2298            crate::model::ShowEffectiveFlowLogsConfigsResponse,
2299            gax::error::Error,
2300        > {
2301            use std::clone::Clone;
2302            let token = self.0.request.page_token.clone();
2303            let execute = move |token: String| {
2304                let mut builder = self.clone();
2305                builder.0.request = builder.0.request.set_page_token(token);
2306                builder.send()
2307            };
2308            gax::paginator::internal::new_paginator(token, execute)
2309        }
2310
2311        /// Streams each item in the collection.
2312        pub fn by_item(
2313            self,
2314        ) -> impl gax::paginator::ItemPaginator<
2315            crate::model::ShowEffectiveFlowLogsConfigsResponse,
2316            gax::error::Error,
2317        > {
2318            use gax::paginator::Paginator;
2319            self.by_page().items()
2320        }
2321
2322        /// Sets the value of [parent][crate::model::ShowEffectiveFlowLogsConfigsRequest::parent].
2323        ///
2324        /// This is a **required** field for requests.
2325        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2326            self.0.request.parent = v.into();
2327            self
2328        }
2329
2330        /// Sets the value of [resource][crate::model::ShowEffectiveFlowLogsConfigsRequest::resource].
2331        ///
2332        /// This is a **required** field for requests.
2333        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2334            self.0.request.resource = v.into();
2335            self
2336        }
2337
2338        /// Sets the value of [page_size][crate::model::ShowEffectiveFlowLogsConfigsRequest::page_size].
2339        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2340            self.0.request.page_size = v.into();
2341            self
2342        }
2343
2344        /// Sets the value of [page_token][crate::model::ShowEffectiveFlowLogsConfigsRequest::page_token].
2345        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2346            self.0.request.page_token = v.into();
2347            self
2348        }
2349
2350        /// Sets the value of [filter][crate::model::ShowEffectiveFlowLogsConfigsRequest::filter].
2351        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2352            self.0.request.filter = v.into();
2353            self
2354        }
2355    }
2356
2357    #[doc(hidden)]
2358    impl gax::options::internal::RequestBuilder for ShowEffectiveFlowLogsConfigs {
2359        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2360            &mut self.0.options
2361        }
2362    }
2363
2364    /// The request builder for [VpcFlowLogsService::list_locations][crate::client::VpcFlowLogsService::list_locations] calls.
2365    ///
2366    /// # Example
2367    /// ```
2368    /// # use google_cloud_networkmanagement_v1::builder::vpc_flow_logs_service::ListLocations;
2369    /// # async fn sample() -> gax::Result<()> {
2370    /// use gax::paginator::ItemPaginator;
2371    ///
2372    /// let builder = prepare_request_builder();
2373    /// let mut items = builder.by_item();
2374    /// while let Some(result) = items.next().await {
2375    ///   let item = result?;
2376    /// }
2377    /// # Ok(()) }
2378    ///
2379    /// fn prepare_request_builder() -> ListLocations {
2380    ///   # panic!();
2381    ///   // ... details omitted ...
2382    /// }
2383    /// ```
2384    #[derive(Clone, Debug)]
2385    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
2386
2387    impl ListLocations {
2388        pub(crate) fn new(
2389            stub: std::sync::Arc<dyn super::super::stub::dynamic::VpcFlowLogsService>,
2390        ) -> Self {
2391            Self(RequestBuilder::new(stub))
2392        }
2393
2394        /// Sets the full request, replacing any prior values.
2395        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
2396            mut self,
2397            v: V,
2398        ) -> Self {
2399            self.0.request = v.into();
2400            self
2401        }
2402
2403        /// Sets all the options, replacing any prior values.
2404        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2405            self.0.options = v.into();
2406            self
2407        }
2408
2409        /// Sends the request.
2410        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
2411            (*self.0.stub)
2412                .list_locations(self.0.request, self.0.options)
2413                .await
2414                .map(gax::response::Response::into_body)
2415        }
2416
2417        /// Streams each page in the collection.
2418        pub fn by_page(
2419            self,
2420        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
2421        {
2422            use std::clone::Clone;
2423            let token = self.0.request.page_token.clone();
2424            let execute = move |token: String| {
2425                let mut builder = self.clone();
2426                builder.0.request = builder.0.request.set_page_token(token);
2427                builder.send()
2428            };
2429            gax::paginator::internal::new_paginator(token, execute)
2430        }
2431
2432        /// Streams each item in the collection.
2433        pub fn by_item(
2434            self,
2435        ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
2436        {
2437            use gax::paginator::Paginator;
2438            self.by_page().items()
2439        }
2440
2441        /// Sets the value of [name][location::model::ListLocationsRequest::name].
2442        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2443            self.0.request.name = v.into();
2444            self
2445        }
2446
2447        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
2448        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2449            self.0.request.filter = v.into();
2450            self
2451        }
2452
2453        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
2454        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2455            self.0.request.page_size = v.into();
2456            self
2457        }
2458
2459        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
2460        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2461            self.0.request.page_token = v.into();
2462            self
2463        }
2464    }
2465
2466    #[doc(hidden)]
2467    impl gax::options::internal::RequestBuilder for ListLocations {
2468        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2469            &mut self.0.options
2470        }
2471    }
2472
2473    /// The request builder for [VpcFlowLogsService::get_location][crate::client::VpcFlowLogsService::get_location] calls.
2474    ///
2475    /// # Example
2476    /// ```
2477    /// # use google_cloud_networkmanagement_v1::builder::vpc_flow_logs_service::GetLocation;
2478    /// # async fn sample() -> gax::Result<()> {
2479    ///
2480    /// let builder = prepare_request_builder();
2481    /// let response = builder.send().await?;
2482    /// # Ok(()) }
2483    ///
2484    /// fn prepare_request_builder() -> GetLocation {
2485    ///   # panic!();
2486    ///   // ... details omitted ...
2487    /// }
2488    /// ```
2489    #[derive(Clone, Debug)]
2490    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
2491
2492    impl GetLocation {
2493        pub(crate) fn new(
2494            stub: std::sync::Arc<dyn super::super::stub::dynamic::VpcFlowLogsService>,
2495        ) -> Self {
2496            Self(RequestBuilder::new(stub))
2497        }
2498
2499        /// Sets the full request, replacing any prior values.
2500        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
2501            self.0.request = v.into();
2502            self
2503        }
2504
2505        /// Sets all the options, replacing any prior values.
2506        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2507            self.0.options = v.into();
2508            self
2509        }
2510
2511        /// Sends the request.
2512        pub async fn send(self) -> Result<location::model::Location> {
2513            (*self.0.stub)
2514                .get_location(self.0.request, self.0.options)
2515                .await
2516                .map(gax::response::Response::into_body)
2517        }
2518
2519        /// Sets the value of [name][location::model::GetLocationRequest::name].
2520        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2521            self.0.request.name = v.into();
2522            self
2523        }
2524    }
2525
2526    #[doc(hidden)]
2527    impl gax::options::internal::RequestBuilder for GetLocation {
2528        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2529            &mut self.0.options
2530        }
2531    }
2532
2533    /// The request builder for [VpcFlowLogsService::set_iam_policy][crate::client::VpcFlowLogsService::set_iam_policy] calls.
2534    ///
2535    /// # Example
2536    /// ```
2537    /// # use google_cloud_networkmanagement_v1::builder::vpc_flow_logs_service::SetIamPolicy;
2538    /// # async fn sample() -> gax::Result<()> {
2539    ///
2540    /// let builder = prepare_request_builder();
2541    /// let response = builder.send().await?;
2542    /// # Ok(()) }
2543    ///
2544    /// fn prepare_request_builder() -> SetIamPolicy {
2545    ///   # panic!();
2546    ///   // ... details omitted ...
2547    /// }
2548    /// ```
2549    #[derive(Clone, Debug)]
2550    pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
2551
2552    impl SetIamPolicy {
2553        pub(crate) fn new(
2554            stub: std::sync::Arc<dyn super::super::stub::dynamic::VpcFlowLogsService>,
2555        ) -> Self {
2556            Self(RequestBuilder::new(stub))
2557        }
2558
2559        /// Sets the full request, replacing any prior values.
2560        pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
2561            self.0.request = v.into();
2562            self
2563        }
2564
2565        /// Sets all the options, replacing any prior values.
2566        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2567            self.0.options = v.into();
2568            self
2569        }
2570
2571        /// Sends the request.
2572        pub async fn send(self) -> Result<iam_v1::model::Policy> {
2573            (*self.0.stub)
2574                .set_iam_policy(self.0.request, self.0.options)
2575                .await
2576                .map(gax::response::Response::into_body)
2577        }
2578
2579        /// Sets the value of [resource][iam_v1::model::SetIamPolicyRequest::resource].
2580        ///
2581        /// This is a **required** field for requests.
2582        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2583            self.0.request.resource = v.into();
2584            self
2585        }
2586
2587        /// Sets the value of [policy][iam_v1::model::SetIamPolicyRequest::policy].
2588        ///
2589        /// This is a **required** field for requests.
2590        pub fn set_policy<T>(mut self, v: T) -> Self
2591        where
2592            T: std::convert::Into<iam_v1::model::Policy>,
2593        {
2594            self.0.request.policy = std::option::Option::Some(v.into());
2595            self
2596        }
2597
2598        /// Sets or clears the value of [policy][iam_v1::model::SetIamPolicyRequest::policy].
2599        ///
2600        /// This is a **required** field for requests.
2601        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
2602        where
2603            T: std::convert::Into<iam_v1::model::Policy>,
2604        {
2605            self.0.request.policy = v.map(|x| x.into());
2606            self
2607        }
2608
2609        /// Sets the value of [update_mask][iam_v1::model::SetIamPolicyRequest::update_mask].
2610        pub fn set_update_mask<T>(mut self, v: T) -> Self
2611        where
2612            T: std::convert::Into<wkt::FieldMask>,
2613        {
2614            self.0.request.update_mask = std::option::Option::Some(v.into());
2615            self
2616        }
2617
2618        /// Sets or clears the value of [update_mask][iam_v1::model::SetIamPolicyRequest::update_mask].
2619        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2620        where
2621            T: std::convert::Into<wkt::FieldMask>,
2622        {
2623            self.0.request.update_mask = v.map(|x| x.into());
2624            self
2625        }
2626    }
2627
2628    #[doc(hidden)]
2629    impl gax::options::internal::RequestBuilder for SetIamPolicy {
2630        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2631            &mut self.0.options
2632        }
2633    }
2634
2635    /// The request builder for [VpcFlowLogsService::get_iam_policy][crate::client::VpcFlowLogsService::get_iam_policy] calls.
2636    ///
2637    /// # Example
2638    /// ```
2639    /// # use google_cloud_networkmanagement_v1::builder::vpc_flow_logs_service::GetIamPolicy;
2640    /// # async fn sample() -> gax::Result<()> {
2641    ///
2642    /// let builder = prepare_request_builder();
2643    /// let response = builder.send().await?;
2644    /// # Ok(()) }
2645    ///
2646    /// fn prepare_request_builder() -> GetIamPolicy {
2647    ///   # panic!();
2648    ///   // ... details omitted ...
2649    /// }
2650    /// ```
2651    #[derive(Clone, Debug)]
2652    pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
2653
2654    impl GetIamPolicy {
2655        pub(crate) fn new(
2656            stub: std::sync::Arc<dyn super::super::stub::dynamic::VpcFlowLogsService>,
2657        ) -> Self {
2658            Self(RequestBuilder::new(stub))
2659        }
2660
2661        /// Sets the full request, replacing any prior values.
2662        pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
2663            self.0.request = v.into();
2664            self
2665        }
2666
2667        /// Sets all the options, replacing any prior values.
2668        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2669            self.0.options = v.into();
2670            self
2671        }
2672
2673        /// Sends the request.
2674        pub async fn send(self) -> Result<iam_v1::model::Policy> {
2675            (*self.0.stub)
2676                .get_iam_policy(self.0.request, self.0.options)
2677                .await
2678                .map(gax::response::Response::into_body)
2679        }
2680
2681        /// Sets the value of [resource][iam_v1::model::GetIamPolicyRequest::resource].
2682        ///
2683        /// This is a **required** field for requests.
2684        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2685            self.0.request.resource = v.into();
2686            self
2687        }
2688
2689        /// Sets the value of [options][iam_v1::model::GetIamPolicyRequest::options].
2690        pub fn set_options<T>(mut self, v: T) -> Self
2691        where
2692            T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
2693        {
2694            self.0.request.options = std::option::Option::Some(v.into());
2695            self
2696        }
2697
2698        /// Sets or clears the value of [options][iam_v1::model::GetIamPolicyRequest::options].
2699        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
2700        where
2701            T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
2702        {
2703            self.0.request.options = v.map(|x| x.into());
2704            self
2705        }
2706    }
2707
2708    #[doc(hidden)]
2709    impl gax::options::internal::RequestBuilder for GetIamPolicy {
2710        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2711            &mut self.0.options
2712        }
2713    }
2714
2715    /// The request builder for [VpcFlowLogsService::test_iam_permissions][crate::client::VpcFlowLogsService::test_iam_permissions] calls.
2716    ///
2717    /// # Example
2718    /// ```
2719    /// # use google_cloud_networkmanagement_v1::builder::vpc_flow_logs_service::TestIamPermissions;
2720    /// # async fn sample() -> gax::Result<()> {
2721    ///
2722    /// let builder = prepare_request_builder();
2723    /// let response = builder.send().await?;
2724    /// # Ok(()) }
2725    ///
2726    /// fn prepare_request_builder() -> TestIamPermissions {
2727    ///   # panic!();
2728    ///   // ... details omitted ...
2729    /// }
2730    /// ```
2731    #[derive(Clone, Debug)]
2732    pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
2733
2734    impl TestIamPermissions {
2735        pub(crate) fn new(
2736            stub: std::sync::Arc<dyn super::super::stub::dynamic::VpcFlowLogsService>,
2737        ) -> Self {
2738            Self(RequestBuilder::new(stub))
2739        }
2740
2741        /// Sets the full request, replacing any prior values.
2742        pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
2743            mut self,
2744            v: V,
2745        ) -> Self {
2746            self.0.request = v.into();
2747            self
2748        }
2749
2750        /// Sets all the options, replacing any prior values.
2751        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2752            self.0.options = v.into();
2753            self
2754        }
2755
2756        /// Sends the request.
2757        pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
2758            (*self.0.stub)
2759                .test_iam_permissions(self.0.request, self.0.options)
2760                .await
2761                .map(gax::response::Response::into_body)
2762        }
2763
2764        /// Sets the value of [resource][iam_v1::model::TestIamPermissionsRequest::resource].
2765        ///
2766        /// This is a **required** field for requests.
2767        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2768            self.0.request.resource = v.into();
2769            self
2770        }
2771
2772        /// Sets the value of [permissions][iam_v1::model::TestIamPermissionsRequest::permissions].
2773        ///
2774        /// This is a **required** field for requests.
2775        pub fn set_permissions<T, V>(mut self, v: T) -> Self
2776        where
2777            T: std::iter::IntoIterator<Item = V>,
2778            V: std::convert::Into<std::string::String>,
2779        {
2780            use std::iter::Iterator;
2781            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
2782            self
2783        }
2784    }
2785
2786    #[doc(hidden)]
2787    impl gax::options::internal::RequestBuilder for TestIamPermissions {
2788        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2789            &mut self.0.options
2790        }
2791    }
2792
2793    /// The request builder for [VpcFlowLogsService::list_operations][crate::client::VpcFlowLogsService::list_operations] calls.
2794    ///
2795    /// # Example
2796    /// ```
2797    /// # use google_cloud_networkmanagement_v1::builder::vpc_flow_logs_service::ListOperations;
2798    /// # async fn sample() -> gax::Result<()> {
2799    /// use gax::paginator::ItemPaginator;
2800    ///
2801    /// let builder = prepare_request_builder();
2802    /// let mut items = builder.by_item();
2803    /// while let Some(result) = items.next().await {
2804    ///   let item = result?;
2805    /// }
2806    /// # Ok(()) }
2807    ///
2808    /// fn prepare_request_builder() -> ListOperations {
2809    ///   # panic!();
2810    ///   // ... details omitted ...
2811    /// }
2812    /// ```
2813    #[derive(Clone, Debug)]
2814    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
2815
2816    impl ListOperations {
2817        pub(crate) fn new(
2818            stub: std::sync::Arc<dyn super::super::stub::dynamic::VpcFlowLogsService>,
2819        ) -> Self {
2820            Self(RequestBuilder::new(stub))
2821        }
2822
2823        /// Sets the full request, replacing any prior values.
2824        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
2825            mut self,
2826            v: V,
2827        ) -> Self {
2828            self.0.request = v.into();
2829            self
2830        }
2831
2832        /// Sets all the options, replacing any prior values.
2833        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2834            self.0.options = v.into();
2835            self
2836        }
2837
2838        /// Sends the request.
2839        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
2840            (*self.0.stub)
2841                .list_operations(self.0.request, self.0.options)
2842                .await
2843                .map(gax::response::Response::into_body)
2844        }
2845
2846        /// Streams each page in the collection.
2847        pub fn by_page(
2848            self,
2849        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
2850        {
2851            use std::clone::Clone;
2852            let token = self.0.request.page_token.clone();
2853            let execute = move |token: String| {
2854                let mut builder = self.clone();
2855                builder.0.request = builder.0.request.set_page_token(token);
2856                builder.send()
2857            };
2858            gax::paginator::internal::new_paginator(token, execute)
2859        }
2860
2861        /// Streams each item in the collection.
2862        pub fn by_item(
2863            self,
2864        ) -> impl gax::paginator::ItemPaginator<
2865            longrunning::model::ListOperationsResponse,
2866            gax::error::Error,
2867        > {
2868            use gax::paginator::Paginator;
2869            self.by_page().items()
2870        }
2871
2872        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
2873        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2874            self.0.request.name = v.into();
2875            self
2876        }
2877
2878        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
2879        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2880            self.0.request.filter = v.into();
2881            self
2882        }
2883
2884        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
2885        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2886            self.0.request.page_size = v.into();
2887            self
2888        }
2889
2890        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
2891        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2892            self.0.request.page_token = v.into();
2893            self
2894        }
2895
2896        /// Sets the value of [return_partial_success][longrunning::model::ListOperationsRequest::return_partial_success].
2897        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
2898            self.0.request.return_partial_success = v.into();
2899            self
2900        }
2901    }
2902
2903    #[doc(hidden)]
2904    impl gax::options::internal::RequestBuilder for ListOperations {
2905        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2906            &mut self.0.options
2907        }
2908    }
2909
2910    /// The request builder for [VpcFlowLogsService::get_operation][crate::client::VpcFlowLogsService::get_operation] calls.
2911    ///
2912    /// # Example
2913    /// ```
2914    /// # use google_cloud_networkmanagement_v1::builder::vpc_flow_logs_service::GetOperation;
2915    /// # async fn sample() -> gax::Result<()> {
2916    ///
2917    /// let builder = prepare_request_builder();
2918    /// let response = builder.send().await?;
2919    /// # Ok(()) }
2920    ///
2921    /// fn prepare_request_builder() -> GetOperation {
2922    ///   # panic!();
2923    ///   // ... details omitted ...
2924    /// }
2925    /// ```
2926    #[derive(Clone, Debug)]
2927    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
2928
2929    impl GetOperation {
2930        pub(crate) fn new(
2931            stub: std::sync::Arc<dyn super::super::stub::dynamic::VpcFlowLogsService>,
2932        ) -> Self {
2933            Self(RequestBuilder::new(stub))
2934        }
2935
2936        /// Sets the full request, replacing any prior values.
2937        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
2938            mut self,
2939            v: V,
2940        ) -> Self {
2941            self.0.request = v.into();
2942            self
2943        }
2944
2945        /// Sets all the options, replacing any prior values.
2946        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2947            self.0.options = v.into();
2948            self
2949        }
2950
2951        /// Sends the request.
2952        pub async fn send(self) -> Result<longrunning::model::Operation> {
2953            (*self.0.stub)
2954                .get_operation(self.0.request, self.0.options)
2955                .await
2956                .map(gax::response::Response::into_body)
2957        }
2958
2959        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
2960        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2961            self.0.request.name = v.into();
2962            self
2963        }
2964    }
2965
2966    #[doc(hidden)]
2967    impl gax::options::internal::RequestBuilder for GetOperation {
2968        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2969            &mut self.0.options
2970        }
2971    }
2972
2973    /// The request builder for [VpcFlowLogsService::delete_operation][crate::client::VpcFlowLogsService::delete_operation] calls.
2974    ///
2975    /// # Example
2976    /// ```
2977    /// # use google_cloud_networkmanagement_v1::builder::vpc_flow_logs_service::DeleteOperation;
2978    /// # async fn sample() -> gax::Result<()> {
2979    ///
2980    /// let builder = prepare_request_builder();
2981    /// let response = builder.send().await?;
2982    /// # Ok(()) }
2983    ///
2984    /// fn prepare_request_builder() -> DeleteOperation {
2985    ///   # panic!();
2986    ///   // ... details omitted ...
2987    /// }
2988    /// ```
2989    #[derive(Clone, Debug)]
2990    pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
2991
2992    impl DeleteOperation {
2993        pub(crate) fn new(
2994            stub: std::sync::Arc<dyn super::super::stub::dynamic::VpcFlowLogsService>,
2995        ) -> Self {
2996            Self(RequestBuilder::new(stub))
2997        }
2998
2999        /// Sets the full request, replacing any prior values.
3000        pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
3001            mut self,
3002            v: V,
3003        ) -> Self {
3004            self.0.request = v.into();
3005            self
3006        }
3007
3008        /// Sets all the options, replacing any prior values.
3009        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3010            self.0.options = v.into();
3011            self
3012        }
3013
3014        /// Sends the request.
3015        pub async fn send(self) -> Result<()> {
3016            (*self.0.stub)
3017                .delete_operation(self.0.request, self.0.options)
3018                .await
3019                .map(gax::response::Response::into_body)
3020        }
3021
3022        /// Sets the value of [name][longrunning::model::DeleteOperationRequest::name].
3023        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3024            self.0.request.name = v.into();
3025            self
3026        }
3027    }
3028
3029    #[doc(hidden)]
3030    impl gax::options::internal::RequestBuilder for DeleteOperation {
3031        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3032            &mut self.0.options
3033        }
3034    }
3035
3036    /// The request builder for [VpcFlowLogsService::cancel_operation][crate::client::VpcFlowLogsService::cancel_operation] calls.
3037    ///
3038    /// # Example
3039    /// ```
3040    /// # use google_cloud_networkmanagement_v1::builder::vpc_flow_logs_service::CancelOperation;
3041    /// # async fn sample() -> gax::Result<()> {
3042    ///
3043    /// let builder = prepare_request_builder();
3044    /// let response = builder.send().await?;
3045    /// # Ok(()) }
3046    ///
3047    /// fn prepare_request_builder() -> CancelOperation {
3048    ///   # panic!();
3049    ///   // ... details omitted ...
3050    /// }
3051    /// ```
3052    #[derive(Clone, Debug)]
3053    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
3054
3055    impl CancelOperation {
3056        pub(crate) fn new(
3057            stub: std::sync::Arc<dyn super::super::stub::dynamic::VpcFlowLogsService>,
3058        ) -> Self {
3059            Self(RequestBuilder::new(stub))
3060        }
3061
3062        /// Sets the full request, replacing any prior values.
3063        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
3064            mut self,
3065            v: V,
3066        ) -> Self {
3067            self.0.request = v.into();
3068            self
3069        }
3070
3071        /// Sets all the options, replacing any prior values.
3072        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3073            self.0.options = v.into();
3074            self
3075        }
3076
3077        /// Sends the request.
3078        pub async fn send(self) -> Result<()> {
3079            (*self.0.stub)
3080                .cancel_operation(self.0.request, self.0.options)
3081                .await
3082                .map(gax::response::Response::into_body)
3083        }
3084
3085        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
3086        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3087            self.0.request.name = v.into();
3088            self
3089        }
3090    }
3091
3092    #[doc(hidden)]
3093    impl gax::options::internal::RequestBuilder for CancelOperation {
3094        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3095            &mut self.0.options
3096        }
3097    }
3098}
3099
3100pub mod organization_vpc_flow_logs_service {
3101    use crate::Result;
3102
3103    /// A builder for [OrganizationVpcFlowLogsService][crate::client::OrganizationVpcFlowLogsService].
3104    ///
3105    /// ```
3106    /// # async fn sample() -> gax::client_builder::Result<()> {
3107    /// # use google_cloud_networkmanagement_v1::*;
3108    /// # use builder::organization_vpc_flow_logs_service::ClientBuilder;
3109    /// # use client::OrganizationVpcFlowLogsService;
3110    /// let builder : ClientBuilder = OrganizationVpcFlowLogsService::builder();
3111    /// let client = builder
3112    ///     .with_endpoint("https://networkmanagement.googleapis.com")
3113    ///     .build().await?;
3114    /// # Ok(()) }
3115    /// ```
3116    pub type ClientBuilder =
3117        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
3118
3119    pub(crate) mod client {
3120        use super::super::super::client::OrganizationVpcFlowLogsService;
3121        pub struct Factory;
3122        impl gax::client_builder::internal::ClientFactory for Factory {
3123            type Client = OrganizationVpcFlowLogsService;
3124            type Credentials = gaxi::options::Credentials;
3125            async fn build(
3126                self,
3127                config: gaxi::options::ClientConfig,
3128            ) -> gax::client_builder::Result<Self::Client> {
3129                Self::Client::new(config).await
3130            }
3131        }
3132    }
3133
3134    /// Common implementation for [crate::client::OrganizationVpcFlowLogsService] request builders.
3135    #[derive(Clone, Debug)]
3136    pub(crate) struct RequestBuilder<R: std::default::Default> {
3137        stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationVpcFlowLogsService>,
3138        request: R,
3139        options: gax::options::RequestOptions,
3140    }
3141
3142    impl<R> RequestBuilder<R>
3143    where
3144        R: std::default::Default,
3145    {
3146        pub(crate) fn new(
3147            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationVpcFlowLogsService>,
3148        ) -> Self {
3149            Self {
3150                stub,
3151                request: R::default(),
3152                options: gax::options::RequestOptions::default(),
3153            }
3154        }
3155    }
3156
3157    /// The request builder for [OrganizationVpcFlowLogsService::list_vpc_flow_logs_configs][crate::client::OrganizationVpcFlowLogsService::list_vpc_flow_logs_configs] calls.
3158    ///
3159    /// # Example
3160    /// ```
3161    /// # use google_cloud_networkmanagement_v1::builder::organization_vpc_flow_logs_service::ListVpcFlowLogsConfigs;
3162    /// # async fn sample() -> gax::Result<()> {
3163    /// use gax::paginator::ItemPaginator;
3164    ///
3165    /// let builder = prepare_request_builder();
3166    /// let mut items = builder.by_item();
3167    /// while let Some(result) = items.next().await {
3168    ///   let item = result?;
3169    /// }
3170    /// # Ok(()) }
3171    ///
3172    /// fn prepare_request_builder() -> ListVpcFlowLogsConfigs {
3173    ///   # panic!();
3174    ///   // ... details omitted ...
3175    /// }
3176    /// ```
3177    #[derive(Clone, Debug)]
3178    pub struct ListVpcFlowLogsConfigs(RequestBuilder<crate::model::ListVpcFlowLogsConfigsRequest>);
3179
3180    impl ListVpcFlowLogsConfigs {
3181        pub(crate) fn new(
3182            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationVpcFlowLogsService>,
3183        ) -> Self {
3184            Self(RequestBuilder::new(stub))
3185        }
3186
3187        /// Sets the full request, replacing any prior values.
3188        pub fn with_request<V: Into<crate::model::ListVpcFlowLogsConfigsRequest>>(
3189            mut self,
3190            v: V,
3191        ) -> Self {
3192            self.0.request = v.into();
3193            self
3194        }
3195
3196        /// Sets all the options, replacing any prior values.
3197        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3198            self.0.options = v.into();
3199            self
3200        }
3201
3202        /// Sends the request.
3203        pub async fn send(self) -> Result<crate::model::ListVpcFlowLogsConfigsResponse> {
3204            (*self.0.stub)
3205                .list_vpc_flow_logs_configs(self.0.request, self.0.options)
3206                .await
3207                .map(gax::response::Response::into_body)
3208        }
3209
3210        /// Streams each page in the collection.
3211        pub fn by_page(
3212            self,
3213        ) -> impl gax::paginator::Paginator<
3214            crate::model::ListVpcFlowLogsConfigsResponse,
3215            gax::error::Error,
3216        > {
3217            use std::clone::Clone;
3218            let token = self.0.request.page_token.clone();
3219            let execute = move |token: String| {
3220                let mut builder = self.clone();
3221                builder.0.request = builder.0.request.set_page_token(token);
3222                builder.send()
3223            };
3224            gax::paginator::internal::new_paginator(token, execute)
3225        }
3226
3227        /// Streams each item in the collection.
3228        pub fn by_item(
3229            self,
3230        ) -> impl gax::paginator::ItemPaginator<
3231            crate::model::ListVpcFlowLogsConfigsResponse,
3232            gax::error::Error,
3233        > {
3234            use gax::paginator::Paginator;
3235            self.by_page().items()
3236        }
3237
3238        /// Sets the value of [parent][crate::model::ListVpcFlowLogsConfigsRequest::parent].
3239        ///
3240        /// This is a **required** field for requests.
3241        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3242            self.0.request.parent = v.into();
3243            self
3244        }
3245
3246        /// Sets the value of [page_size][crate::model::ListVpcFlowLogsConfigsRequest::page_size].
3247        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3248            self.0.request.page_size = v.into();
3249            self
3250        }
3251
3252        /// Sets the value of [page_token][crate::model::ListVpcFlowLogsConfigsRequest::page_token].
3253        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3254            self.0.request.page_token = v.into();
3255            self
3256        }
3257
3258        /// Sets the value of [filter][crate::model::ListVpcFlowLogsConfigsRequest::filter].
3259        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3260            self.0.request.filter = v.into();
3261            self
3262        }
3263
3264        /// Sets the value of [order_by][crate::model::ListVpcFlowLogsConfigsRequest::order_by].
3265        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3266            self.0.request.order_by = v.into();
3267            self
3268        }
3269    }
3270
3271    #[doc(hidden)]
3272    impl gax::options::internal::RequestBuilder for ListVpcFlowLogsConfigs {
3273        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3274            &mut self.0.options
3275        }
3276    }
3277
3278    /// The request builder for [OrganizationVpcFlowLogsService::get_vpc_flow_logs_config][crate::client::OrganizationVpcFlowLogsService::get_vpc_flow_logs_config] calls.
3279    ///
3280    /// # Example
3281    /// ```
3282    /// # use google_cloud_networkmanagement_v1::builder::organization_vpc_flow_logs_service::GetVpcFlowLogsConfig;
3283    /// # async fn sample() -> gax::Result<()> {
3284    ///
3285    /// let builder = prepare_request_builder();
3286    /// let response = builder.send().await?;
3287    /// # Ok(()) }
3288    ///
3289    /// fn prepare_request_builder() -> GetVpcFlowLogsConfig {
3290    ///   # panic!();
3291    ///   // ... details omitted ...
3292    /// }
3293    /// ```
3294    #[derive(Clone, Debug)]
3295    pub struct GetVpcFlowLogsConfig(RequestBuilder<crate::model::GetVpcFlowLogsConfigRequest>);
3296
3297    impl GetVpcFlowLogsConfig {
3298        pub(crate) fn new(
3299            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationVpcFlowLogsService>,
3300        ) -> Self {
3301            Self(RequestBuilder::new(stub))
3302        }
3303
3304        /// Sets the full request, replacing any prior values.
3305        pub fn with_request<V: Into<crate::model::GetVpcFlowLogsConfigRequest>>(
3306            mut self,
3307            v: V,
3308        ) -> Self {
3309            self.0.request = v.into();
3310            self
3311        }
3312
3313        /// Sets all the options, replacing any prior values.
3314        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3315            self.0.options = v.into();
3316            self
3317        }
3318
3319        /// Sends the request.
3320        pub async fn send(self) -> Result<crate::model::VpcFlowLogsConfig> {
3321            (*self.0.stub)
3322                .get_vpc_flow_logs_config(self.0.request, self.0.options)
3323                .await
3324                .map(gax::response::Response::into_body)
3325        }
3326
3327        /// Sets the value of [name][crate::model::GetVpcFlowLogsConfigRequest::name].
3328        ///
3329        /// This is a **required** field for requests.
3330        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3331            self.0.request.name = v.into();
3332            self
3333        }
3334    }
3335
3336    #[doc(hidden)]
3337    impl gax::options::internal::RequestBuilder for GetVpcFlowLogsConfig {
3338        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3339            &mut self.0.options
3340        }
3341    }
3342
3343    /// The request builder for [OrganizationVpcFlowLogsService::create_vpc_flow_logs_config][crate::client::OrganizationVpcFlowLogsService::create_vpc_flow_logs_config] calls.
3344    ///
3345    /// # Example
3346    /// ```
3347    /// # use google_cloud_networkmanagement_v1::builder::organization_vpc_flow_logs_service::CreateVpcFlowLogsConfig;
3348    /// # async fn sample() -> gax::Result<()> {
3349    /// use lro::Poller;
3350    ///
3351    /// let builder = prepare_request_builder();
3352    /// let response = builder.poller().until_done().await?;
3353    /// # Ok(()) }
3354    ///
3355    /// fn prepare_request_builder() -> CreateVpcFlowLogsConfig {
3356    ///   # panic!();
3357    ///   // ... details omitted ...
3358    /// }
3359    /// ```
3360    #[derive(Clone, Debug)]
3361    pub struct CreateVpcFlowLogsConfig(
3362        RequestBuilder<crate::model::CreateVpcFlowLogsConfigRequest>,
3363    );
3364
3365    impl CreateVpcFlowLogsConfig {
3366        pub(crate) fn new(
3367            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationVpcFlowLogsService>,
3368        ) -> Self {
3369            Self(RequestBuilder::new(stub))
3370        }
3371
3372        /// Sets the full request, replacing any prior values.
3373        pub fn with_request<V: Into<crate::model::CreateVpcFlowLogsConfigRequest>>(
3374            mut self,
3375            v: V,
3376        ) -> Self {
3377            self.0.request = v.into();
3378            self
3379        }
3380
3381        /// Sets all the options, replacing any prior values.
3382        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3383            self.0.options = v.into();
3384            self
3385        }
3386
3387        /// Sends the request.
3388        ///
3389        /// # Long running operations
3390        ///
3391        /// This starts, but does not poll, a longrunning operation. More information
3392        /// on [create_vpc_flow_logs_config][crate::client::OrganizationVpcFlowLogsService::create_vpc_flow_logs_config].
3393        pub async fn send(self) -> Result<longrunning::model::Operation> {
3394            (*self.0.stub)
3395                .create_vpc_flow_logs_config(self.0.request, self.0.options)
3396                .await
3397                .map(gax::response::Response::into_body)
3398        }
3399
3400        /// Creates a [Poller][lro::Poller] to work with `create_vpc_flow_logs_config`.
3401        pub fn poller(
3402            self,
3403        ) -> impl lro::Poller<crate::model::VpcFlowLogsConfig, crate::model::OperationMetadata>
3404        {
3405            type Operation = lro::internal::Operation<
3406                crate::model::VpcFlowLogsConfig,
3407                crate::model::OperationMetadata,
3408            >;
3409            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3410            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3411
3412            let stub = self.0.stub.clone();
3413            let mut options = self.0.options.clone();
3414            options.set_retry_policy(gax::retry_policy::NeverRetry);
3415            let query = move |name| {
3416                let stub = stub.clone();
3417                let options = options.clone();
3418                async {
3419                    let op = GetOperation::new(stub)
3420                        .set_name(name)
3421                        .with_options(options)
3422                        .send()
3423                        .await?;
3424                    Ok(Operation::new(op))
3425                }
3426            };
3427
3428            let start = move || async {
3429                let op = self.send().await?;
3430                Ok(Operation::new(op))
3431            };
3432
3433            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3434        }
3435
3436        /// Sets the value of [parent][crate::model::CreateVpcFlowLogsConfigRequest::parent].
3437        ///
3438        /// This is a **required** field for requests.
3439        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3440            self.0.request.parent = v.into();
3441            self
3442        }
3443
3444        /// Sets the value of [vpc_flow_logs_config_id][crate::model::CreateVpcFlowLogsConfigRequest::vpc_flow_logs_config_id].
3445        ///
3446        /// This is a **required** field for requests.
3447        pub fn set_vpc_flow_logs_config_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3448            self.0.request.vpc_flow_logs_config_id = v.into();
3449            self
3450        }
3451
3452        /// Sets the value of [vpc_flow_logs_config][crate::model::CreateVpcFlowLogsConfigRequest::vpc_flow_logs_config].
3453        ///
3454        /// This is a **required** field for requests.
3455        pub fn set_vpc_flow_logs_config<T>(mut self, v: T) -> Self
3456        where
3457            T: std::convert::Into<crate::model::VpcFlowLogsConfig>,
3458        {
3459            self.0.request.vpc_flow_logs_config = std::option::Option::Some(v.into());
3460            self
3461        }
3462
3463        /// Sets or clears the value of [vpc_flow_logs_config][crate::model::CreateVpcFlowLogsConfigRequest::vpc_flow_logs_config].
3464        ///
3465        /// This is a **required** field for requests.
3466        pub fn set_or_clear_vpc_flow_logs_config<T>(mut self, v: std::option::Option<T>) -> Self
3467        where
3468            T: std::convert::Into<crate::model::VpcFlowLogsConfig>,
3469        {
3470            self.0.request.vpc_flow_logs_config = v.map(|x| x.into());
3471            self
3472        }
3473    }
3474
3475    #[doc(hidden)]
3476    impl gax::options::internal::RequestBuilder for CreateVpcFlowLogsConfig {
3477        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3478            &mut self.0.options
3479        }
3480    }
3481
3482    /// The request builder for [OrganizationVpcFlowLogsService::update_vpc_flow_logs_config][crate::client::OrganizationVpcFlowLogsService::update_vpc_flow_logs_config] calls.
3483    ///
3484    /// # Example
3485    /// ```
3486    /// # use google_cloud_networkmanagement_v1::builder::organization_vpc_flow_logs_service::UpdateVpcFlowLogsConfig;
3487    /// # async fn sample() -> gax::Result<()> {
3488    /// use lro::Poller;
3489    ///
3490    /// let builder = prepare_request_builder();
3491    /// let response = builder.poller().until_done().await?;
3492    /// # Ok(()) }
3493    ///
3494    /// fn prepare_request_builder() -> UpdateVpcFlowLogsConfig {
3495    ///   # panic!();
3496    ///   // ... details omitted ...
3497    /// }
3498    /// ```
3499    #[derive(Clone, Debug)]
3500    pub struct UpdateVpcFlowLogsConfig(
3501        RequestBuilder<crate::model::UpdateVpcFlowLogsConfigRequest>,
3502    );
3503
3504    impl UpdateVpcFlowLogsConfig {
3505        pub(crate) fn new(
3506            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationVpcFlowLogsService>,
3507        ) -> Self {
3508            Self(RequestBuilder::new(stub))
3509        }
3510
3511        /// Sets the full request, replacing any prior values.
3512        pub fn with_request<V: Into<crate::model::UpdateVpcFlowLogsConfigRequest>>(
3513            mut self,
3514            v: V,
3515        ) -> Self {
3516            self.0.request = v.into();
3517            self
3518        }
3519
3520        /// Sets all the options, replacing any prior values.
3521        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3522            self.0.options = v.into();
3523            self
3524        }
3525
3526        /// Sends the request.
3527        ///
3528        /// # Long running operations
3529        ///
3530        /// This starts, but does not poll, a longrunning operation. More information
3531        /// on [update_vpc_flow_logs_config][crate::client::OrganizationVpcFlowLogsService::update_vpc_flow_logs_config].
3532        pub async fn send(self) -> Result<longrunning::model::Operation> {
3533            (*self.0.stub)
3534                .update_vpc_flow_logs_config(self.0.request, self.0.options)
3535                .await
3536                .map(gax::response::Response::into_body)
3537        }
3538
3539        /// Creates a [Poller][lro::Poller] to work with `update_vpc_flow_logs_config`.
3540        pub fn poller(
3541            self,
3542        ) -> impl lro::Poller<crate::model::VpcFlowLogsConfig, crate::model::OperationMetadata>
3543        {
3544            type Operation = lro::internal::Operation<
3545                crate::model::VpcFlowLogsConfig,
3546                crate::model::OperationMetadata,
3547            >;
3548            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3549            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3550
3551            let stub = self.0.stub.clone();
3552            let mut options = self.0.options.clone();
3553            options.set_retry_policy(gax::retry_policy::NeverRetry);
3554            let query = move |name| {
3555                let stub = stub.clone();
3556                let options = options.clone();
3557                async {
3558                    let op = GetOperation::new(stub)
3559                        .set_name(name)
3560                        .with_options(options)
3561                        .send()
3562                        .await?;
3563                    Ok(Operation::new(op))
3564                }
3565            };
3566
3567            let start = move || async {
3568                let op = self.send().await?;
3569                Ok(Operation::new(op))
3570            };
3571
3572            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3573        }
3574
3575        /// Sets the value of [update_mask][crate::model::UpdateVpcFlowLogsConfigRequest::update_mask].
3576        ///
3577        /// This is a **required** field for requests.
3578        pub fn set_update_mask<T>(mut self, v: T) -> Self
3579        where
3580            T: std::convert::Into<wkt::FieldMask>,
3581        {
3582            self.0.request.update_mask = std::option::Option::Some(v.into());
3583            self
3584        }
3585
3586        /// Sets or clears the value of [update_mask][crate::model::UpdateVpcFlowLogsConfigRequest::update_mask].
3587        ///
3588        /// This is a **required** field for requests.
3589        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3590        where
3591            T: std::convert::Into<wkt::FieldMask>,
3592        {
3593            self.0.request.update_mask = v.map(|x| x.into());
3594            self
3595        }
3596
3597        /// Sets the value of [vpc_flow_logs_config][crate::model::UpdateVpcFlowLogsConfigRequest::vpc_flow_logs_config].
3598        ///
3599        /// This is a **required** field for requests.
3600        pub fn set_vpc_flow_logs_config<T>(mut self, v: T) -> Self
3601        where
3602            T: std::convert::Into<crate::model::VpcFlowLogsConfig>,
3603        {
3604            self.0.request.vpc_flow_logs_config = std::option::Option::Some(v.into());
3605            self
3606        }
3607
3608        /// Sets or clears the value of [vpc_flow_logs_config][crate::model::UpdateVpcFlowLogsConfigRequest::vpc_flow_logs_config].
3609        ///
3610        /// This is a **required** field for requests.
3611        pub fn set_or_clear_vpc_flow_logs_config<T>(mut self, v: std::option::Option<T>) -> Self
3612        where
3613            T: std::convert::Into<crate::model::VpcFlowLogsConfig>,
3614        {
3615            self.0.request.vpc_flow_logs_config = v.map(|x| x.into());
3616            self
3617        }
3618    }
3619
3620    #[doc(hidden)]
3621    impl gax::options::internal::RequestBuilder for UpdateVpcFlowLogsConfig {
3622        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3623            &mut self.0.options
3624        }
3625    }
3626
3627    /// The request builder for [OrganizationVpcFlowLogsService::delete_vpc_flow_logs_config][crate::client::OrganizationVpcFlowLogsService::delete_vpc_flow_logs_config] calls.
3628    ///
3629    /// # Example
3630    /// ```
3631    /// # use google_cloud_networkmanagement_v1::builder::organization_vpc_flow_logs_service::DeleteVpcFlowLogsConfig;
3632    /// # async fn sample() -> gax::Result<()> {
3633    /// use lro::Poller;
3634    ///
3635    /// let builder = prepare_request_builder();
3636    /// let response = builder.poller().until_done().await?;
3637    /// # Ok(()) }
3638    ///
3639    /// fn prepare_request_builder() -> DeleteVpcFlowLogsConfig {
3640    ///   # panic!();
3641    ///   // ... details omitted ...
3642    /// }
3643    /// ```
3644    #[derive(Clone, Debug)]
3645    pub struct DeleteVpcFlowLogsConfig(
3646        RequestBuilder<crate::model::DeleteVpcFlowLogsConfigRequest>,
3647    );
3648
3649    impl DeleteVpcFlowLogsConfig {
3650        pub(crate) fn new(
3651            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationVpcFlowLogsService>,
3652        ) -> Self {
3653            Self(RequestBuilder::new(stub))
3654        }
3655
3656        /// Sets the full request, replacing any prior values.
3657        pub fn with_request<V: Into<crate::model::DeleteVpcFlowLogsConfigRequest>>(
3658            mut self,
3659            v: V,
3660        ) -> Self {
3661            self.0.request = v.into();
3662            self
3663        }
3664
3665        /// Sets all the options, replacing any prior values.
3666        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3667            self.0.options = v.into();
3668            self
3669        }
3670
3671        /// Sends the request.
3672        ///
3673        /// # Long running operations
3674        ///
3675        /// This starts, but does not poll, a longrunning operation. More information
3676        /// on [delete_vpc_flow_logs_config][crate::client::OrganizationVpcFlowLogsService::delete_vpc_flow_logs_config].
3677        pub async fn send(self) -> Result<longrunning::model::Operation> {
3678            (*self.0.stub)
3679                .delete_vpc_flow_logs_config(self.0.request, self.0.options)
3680                .await
3681                .map(gax::response::Response::into_body)
3682        }
3683
3684        /// Creates a [Poller][lro::Poller] to work with `delete_vpc_flow_logs_config`.
3685        pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
3686            type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
3687            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3688            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3689
3690            let stub = self.0.stub.clone();
3691            let mut options = self.0.options.clone();
3692            options.set_retry_policy(gax::retry_policy::NeverRetry);
3693            let query = move |name| {
3694                let stub = stub.clone();
3695                let options = options.clone();
3696                async {
3697                    let op = GetOperation::new(stub)
3698                        .set_name(name)
3699                        .with_options(options)
3700                        .send()
3701                        .await?;
3702                    Ok(Operation::new(op))
3703                }
3704            };
3705
3706            let start = move || async {
3707                let op = self.send().await?;
3708                Ok(Operation::new(op))
3709            };
3710
3711            lro::internal::new_unit_response_poller(
3712                polling_error_policy,
3713                polling_backoff_policy,
3714                start,
3715                query,
3716            )
3717        }
3718
3719        /// Sets the value of [name][crate::model::DeleteVpcFlowLogsConfigRequest::name].
3720        ///
3721        /// This is a **required** field for requests.
3722        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3723            self.0.request.name = v.into();
3724            self
3725        }
3726    }
3727
3728    #[doc(hidden)]
3729    impl gax::options::internal::RequestBuilder for DeleteVpcFlowLogsConfig {
3730        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3731            &mut self.0.options
3732        }
3733    }
3734
3735    /// The request builder for [OrganizationVpcFlowLogsService::list_locations][crate::client::OrganizationVpcFlowLogsService::list_locations] calls.
3736    ///
3737    /// # Example
3738    /// ```
3739    /// # use google_cloud_networkmanagement_v1::builder::organization_vpc_flow_logs_service::ListLocations;
3740    /// # async fn sample() -> gax::Result<()> {
3741    /// use gax::paginator::ItemPaginator;
3742    ///
3743    /// let builder = prepare_request_builder();
3744    /// let mut items = builder.by_item();
3745    /// while let Some(result) = items.next().await {
3746    ///   let item = result?;
3747    /// }
3748    /// # Ok(()) }
3749    ///
3750    /// fn prepare_request_builder() -> ListLocations {
3751    ///   # panic!();
3752    ///   // ... details omitted ...
3753    /// }
3754    /// ```
3755    #[derive(Clone, Debug)]
3756    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
3757
3758    impl ListLocations {
3759        pub(crate) fn new(
3760            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationVpcFlowLogsService>,
3761        ) -> Self {
3762            Self(RequestBuilder::new(stub))
3763        }
3764
3765        /// Sets the full request, replacing any prior values.
3766        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
3767            mut self,
3768            v: V,
3769        ) -> Self {
3770            self.0.request = v.into();
3771            self
3772        }
3773
3774        /// Sets all the options, replacing any prior values.
3775        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3776            self.0.options = v.into();
3777            self
3778        }
3779
3780        /// Sends the request.
3781        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
3782            (*self.0.stub)
3783                .list_locations(self.0.request, self.0.options)
3784                .await
3785                .map(gax::response::Response::into_body)
3786        }
3787
3788        /// Streams each page in the collection.
3789        pub fn by_page(
3790            self,
3791        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
3792        {
3793            use std::clone::Clone;
3794            let token = self.0.request.page_token.clone();
3795            let execute = move |token: String| {
3796                let mut builder = self.clone();
3797                builder.0.request = builder.0.request.set_page_token(token);
3798                builder.send()
3799            };
3800            gax::paginator::internal::new_paginator(token, execute)
3801        }
3802
3803        /// Streams each item in the collection.
3804        pub fn by_item(
3805            self,
3806        ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
3807        {
3808            use gax::paginator::Paginator;
3809            self.by_page().items()
3810        }
3811
3812        /// Sets the value of [name][location::model::ListLocationsRequest::name].
3813        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3814            self.0.request.name = v.into();
3815            self
3816        }
3817
3818        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
3819        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3820            self.0.request.filter = v.into();
3821            self
3822        }
3823
3824        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
3825        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3826            self.0.request.page_size = v.into();
3827            self
3828        }
3829
3830        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
3831        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3832            self.0.request.page_token = v.into();
3833            self
3834        }
3835    }
3836
3837    #[doc(hidden)]
3838    impl gax::options::internal::RequestBuilder for ListLocations {
3839        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3840            &mut self.0.options
3841        }
3842    }
3843
3844    /// The request builder for [OrganizationVpcFlowLogsService::get_location][crate::client::OrganizationVpcFlowLogsService::get_location] calls.
3845    ///
3846    /// # Example
3847    /// ```
3848    /// # use google_cloud_networkmanagement_v1::builder::organization_vpc_flow_logs_service::GetLocation;
3849    /// # async fn sample() -> gax::Result<()> {
3850    ///
3851    /// let builder = prepare_request_builder();
3852    /// let response = builder.send().await?;
3853    /// # Ok(()) }
3854    ///
3855    /// fn prepare_request_builder() -> GetLocation {
3856    ///   # panic!();
3857    ///   // ... details omitted ...
3858    /// }
3859    /// ```
3860    #[derive(Clone, Debug)]
3861    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
3862
3863    impl GetLocation {
3864        pub(crate) fn new(
3865            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationVpcFlowLogsService>,
3866        ) -> Self {
3867            Self(RequestBuilder::new(stub))
3868        }
3869
3870        /// Sets the full request, replacing any prior values.
3871        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
3872            self.0.request = v.into();
3873            self
3874        }
3875
3876        /// Sets all the options, replacing any prior values.
3877        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3878            self.0.options = v.into();
3879            self
3880        }
3881
3882        /// Sends the request.
3883        pub async fn send(self) -> Result<location::model::Location> {
3884            (*self.0.stub)
3885                .get_location(self.0.request, self.0.options)
3886                .await
3887                .map(gax::response::Response::into_body)
3888        }
3889
3890        /// Sets the value of [name][location::model::GetLocationRequest::name].
3891        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3892            self.0.request.name = v.into();
3893            self
3894        }
3895    }
3896
3897    #[doc(hidden)]
3898    impl gax::options::internal::RequestBuilder for GetLocation {
3899        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3900            &mut self.0.options
3901        }
3902    }
3903
3904    /// The request builder for [OrganizationVpcFlowLogsService::set_iam_policy][crate::client::OrganizationVpcFlowLogsService::set_iam_policy] calls.
3905    ///
3906    /// # Example
3907    /// ```
3908    /// # use google_cloud_networkmanagement_v1::builder::organization_vpc_flow_logs_service::SetIamPolicy;
3909    /// # async fn sample() -> gax::Result<()> {
3910    ///
3911    /// let builder = prepare_request_builder();
3912    /// let response = builder.send().await?;
3913    /// # Ok(()) }
3914    ///
3915    /// fn prepare_request_builder() -> SetIamPolicy {
3916    ///   # panic!();
3917    ///   // ... details omitted ...
3918    /// }
3919    /// ```
3920    #[derive(Clone, Debug)]
3921    pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
3922
3923    impl SetIamPolicy {
3924        pub(crate) fn new(
3925            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationVpcFlowLogsService>,
3926        ) -> Self {
3927            Self(RequestBuilder::new(stub))
3928        }
3929
3930        /// Sets the full request, replacing any prior values.
3931        pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
3932            self.0.request = v.into();
3933            self
3934        }
3935
3936        /// Sets all the options, replacing any prior values.
3937        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3938            self.0.options = v.into();
3939            self
3940        }
3941
3942        /// Sends the request.
3943        pub async fn send(self) -> Result<iam_v1::model::Policy> {
3944            (*self.0.stub)
3945                .set_iam_policy(self.0.request, self.0.options)
3946                .await
3947                .map(gax::response::Response::into_body)
3948        }
3949
3950        /// Sets the value of [resource][iam_v1::model::SetIamPolicyRequest::resource].
3951        ///
3952        /// This is a **required** field for requests.
3953        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
3954            self.0.request.resource = v.into();
3955            self
3956        }
3957
3958        /// Sets the value of [policy][iam_v1::model::SetIamPolicyRequest::policy].
3959        ///
3960        /// This is a **required** field for requests.
3961        pub fn set_policy<T>(mut self, v: T) -> Self
3962        where
3963            T: std::convert::Into<iam_v1::model::Policy>,
3964        {
3965            self.0.request.policy = std::option::Option::Some(v.into());
3966            self
3967        }
3968
3969        /// Sets or clears the value of [policy][iam_v1::model::SetIamPolicyRequest::policy].
3970        ///
3971        /// This is a **required** field for requests.
3972        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
3973        where
3974            T: std::convert::Into<iam_v1::model::Policy>,
3975        {
3976            self.0.request.policy = v.map(|x| x.into());
3977            self
3978        }
3979
3980        /// Sets the value of [update_mask][iam_v1::model::SetIamPolicyRequest::update_mask].
3981        pub fn set_update_mask<T>(mut self, v: T) -> Self
3982        where
3983            T: std::convert::Into<wkt::FieldMask>,
3984        {
3985            self.0.request.update_mask = std::option::Option::Some(v.into());
3986            self
3987        }
3988
3989        /// Sets or clears the value of [update_mask][iam_v1::model::SetIamPolicyRequest::update_mask].
3990        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3991        where
3992            T: std::convert::Into<wkt::FieldMask>,
3993        {
3994            self.0.request.update_mask = v.map(|x| x.into());
3995            self
3996        }
3997    }
3998
3999    #[doc(hidden)]
4000    impl gax::options::internal::RequestBuilder for SetIamPolicy {
4001        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4002            &mut self.0.options
4003        }
4004    }
4005
4006    /// The request builder for [OrganizationVpcFlowLogsService::get_iam_policy][crate::client::OrganizationVpcFlowLogsService::get_iam_policy] calls.
4007    ///
4008    /// # Example
4009    /// ```
4010    /// # use google_cloud_networkmanagement_v1::builder::organization_vpc_flow_logs_service::GetIamPolicy;
4011    /// # async fn sample() -> gax::Result<()> {
4012    ///
4013    /// let builder = prepare_request_builder();
4014    /// let response = builder.send().await?;
4015    /// # Ok(()) }
4016    ///
4017    /// fn prepare_request_builder() -> GetIamPolicy {
4018    ///   # panic!();
4019    ///   // ... details omitted ...
4020    /// }
4021    /// ```
4022    #[derive(Clone, Debug)]
4023    pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
4024
4025    impl GetIamPolicy {
4026        pub(crate) fn new(
4027            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationVpcFlowLogsService>,
4028        ) -> Self {
4029            Self(RequestBuilder::new(stub))
4030        }
4031
4032        /// Sets the full request, replacing any prior values.
4033        pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
4034            self.0.request = v.into();
4035            self
4036        }
4037
4038        /// Sets all the options, replacing any prior values.
4039        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4040            self.0.options = v.into();
4041            self
4042        }
4043
4044        /// Sends the request.
4045        pub async fn send(self) -> Result<iam_v1::model::Policy> {
4046            (*self.0.stub)
4047                .get_iam_policy(self.0.request, self.0.options)
4048                .await
4049                .map(gax::response::Response::into_body)
4050        }
4051
4052        /// Sets the value of [resource][iam_v1::model::GetIamPolicyRequest::resource].
4053        ///
4054        /// This is a **required** field for requests.
4055        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4056            self.0.request.resource = v.into();
4057            self
4058        }
4059
4060        /// Sets the value of [options][iam_v1::model::GetIamPolicyRequest::options].
4061        pub fn set_options<T>(mut self, v: T) -> Self
4062        where
4063            T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
4064        {
4065            self.0.request.options = std::option::Option::Some(v.into());
4066            self
4067        }
4068
4069        /// Sets or clears the value of [options][iam_v1::model::GetIamPolicyRequest::options].
4070        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
4071        where
4072            T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
4073        {
4074            self.0.request.options = v.map(|x| x.into());
4075            self
4076        }
4077    }
4078
4079    #[doc(hidden)]
4080    impl gax::options::internal::RequestBuilder for GetIamPolicy {
4081        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4082            &mut self.0.options
4083        }
4084    }
4085
4086    /// The request builder for [OrganizationVpcFlowLogsService::test_iam_permissions][crate::client::OrganizationVpcFlowLogsService::test_iam_permissions] calls.
4087    ///
4088    /// # Example
4089    /// ```
4090    /// # use google_cloud_networkmanagement_v1::builder::organization_vpc_flow_logs_service::TestIamPermissions;
4091    /// # async fn sample() -> gax::Result<()> {
4092    ///
4093    /// let builder = prepare_request_builder();
4094    /// let response = builder.send().await?;
4095    /// # Ok(()) }
4096    ///
4097    /// fn prepare_request_builder() -> TestIamPermissions {
4098    ///   # panic!();
4099    ///   // ... details omitted ...
4100    /// }
4101    /// ```
4102    #[derive(Clone, Debug)]
4103    pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
4104
4105    impl TestIamPermissions {
4106        pub(crate) fn new(
4107            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationVpcFlowLogsService>,
4108        ) -> Self {
4109            Self(RequestBuilder::new(stub))
4110        }
4111
4112        /// Sets the full request, replacing any prior values.
4113        pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
4114            mut self,
4115            v: V,
4116        ) -> Self {
4117            self.0.request = v.into();
4118            self
4119        }
4120
4121        /// Sets all the options, replacing any prior values.
4122        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4123            self.0.options = v.into();
4124            self
4125        }
4126
4127        /// Sends the request.
4128        pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
4129            (*self.0.stub)
4130                .test_iam_permissions(self.0.request, self.0.options)
4131                .await
4132                .map(gax::response::Response::into_body)
4133        }
4134
4135        /// Sets the value of [resource][iam_v1::model::TestIamPermissionsRequest::resource].
4136        ///
4137        /// This is a **required** field for requests.
4138        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4139            self.0.request.resource = v.into();
4140            self
4141        }
4142
4143        /// Sets the value of [permissions][iam_v1::model::TestIamPermissionsRequest::permissions].
4144        ///
4145        /// This is a **required** field for requests.
4146        pub fn set_permissions<T, V>(mut self, v: T) -> Self
4147        where
4148            T: std::iter::IntoIterator<Item = V>,
4149            V: std::convert::Into<std::string::String>,
4150        {
4151            use std::iter::Iterator;
4152            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
4153            self
4154        }
4155    }
4156
4157    #[doc(hidden)]
4158    impl gax::options::internal::RequestBuilder for TestIamPermissions {
4159        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4160            &mut self.0.options
4161        }
4162    }
4163
4164    /// The request builder for [OrganizationVpcFlowLogsService::list_operations][crate::client::OrganizationVpcFlowLogsService::list_operations] calls.
4165    ///
4166    /// # Example
4167    /// ```
4168    /// # use google_cloud_networkmanagement_v1::builder::organization_vpc_flow_logs_service::ListOperations;
4169    /// # async fn sample() -> gax::Result<()> {
4170    /// use gax::paginator::ItemPaginator;
4171    ///
4172    /// let builder = prepare_request_builder();
4173    /// let mut items = builder.by_item();
4174    /// while let Some(result) = items.next().await {
4175    ///   let item = result?;
4176    /// }
4177    /// # Ok(()) }
4178    ///
4179    /// fn prepare_request_builder() -> ListOperations {
4180    ///   # panic!();
4181    ///   // ... details omitted ...
4182    /// }
4183    /// ```
4184    #[derive(Clone, Debug)]
4185    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
4186
4187    impl ListOperations {
4188        pub(crate) fn new(
4189            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationVpcFlowLogsService>,
4190        ) -> Self {
4191            Self(RequestBuilder::new(stub))
4192        }
4193
4194        /// Sets the full request, replacing any prior values.
4195        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
4196            mut self,
4197            v: V,
4198        ) -> Self {
4199            self.0.request = v.into();
4200            self
4201        }
4202
4203        /// Sets all the options, replacing any prior values.
4204        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4205            self.0.options = v.into();
4206            self
4207        }
4208
4209        /// Sends the request.
4210        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
4211            (*self.0.stub)
4212                .list_operations(self.0.request, self.0.options)
4213                .await
4214                .map(gax::response::Response::into_body)
4215        }
4216
4217        /// Streams each page in the collection.
4218        pub fn by_page(
4219            self,
4220        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
4221        {
4222            use std::clone::Clone;
4223            let token = self.0.request.page_token.clone();
4224            let execute = move |token: String| {
4225                let mut builder = self.clone();
4226                builder.0.request = builder.0.request.set_page_token(token);
4227                builder.send()
4228            };
4229            gax::paginator::internal::new_paginator(token, execute)
4230        }
4231
4232        /// Streams each item in the collection.
4233        pub fn by_item(
4234            self,
4235        ) -> impl gax::paginator::ItemPaginator<
4236            longrunning::model::ListOperationsResponse,
4237            gax::error::Error,
4238        > {
4239            use gax::paginator::Paginator;
4240            self.by_page().items()
4241        }
4242
4243        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
4244        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4245            self.0.request.name = v.into();
4246            self
4247        }
4248
4249        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
4250        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4251            self.0.request.filter = v.into();
4252            self
4253        }
4254
4255        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
4256        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4257            self.0.request.page_size = v.into();
4258            self
4259        }
4260
4261        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
4262        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4263            self.0.request.page_token = v.into();
4264            self
4265        }
4266
4267        /// Sets the value of [return_partial_success][longrunning::model::ListOperationsRequest::return_partial_success].
4268        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
4269            self.0.request.return_partial_success = v.into();
4270            self
4271        }
4272    }
4273
4274    #[doc(hidden)]
4275    impl gax::options::internal::RequestBuilder for ListOperations {
4276        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4277            &mut self.0.options
4278        }
4279    }
4280
4281    /// The request builder for [OrganizationVpcFlowLogsService::get_operation][crate::client::OrganizationVpcFlowLogsService::get_operation] calls.
4282    ///
4283    /// # Example
4284    /// ```
4285    /// # use google_cloud_networkmanagement_v1::builder::organization_vpc_flow_logs_service::GetOperation;
4286    /// # async fn sample() -> gax::Result<()> {
4287    ///
4288    /// let builder = prepare_request_builder();
4289    /// let response = builder.send().await?;
4290    /// # Ok(()) }
4291    ///
4292    /// fn prepare_request_builder() -> GetOperation {
4293    ///   # panic!();
4294    ///   // ... details omitted ...
4295    /// }
4296    /// ```
4297    #[derive(Clone, Debug)]
4298    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
4299
4300    impl GetOperation {
4301        pub(crate) fn new(
4302            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationVpcFlowLogsService>,
4303        ) -> Self {
4304            Self(RequestBuilder::new(stub))
4305        }
4306
4307        /// Sets the full request, replacing any prior values.
4308        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
4309            mut self,
4310            v: V,
4311        ) -> Self {
4312            self.0.request = v.into();
4313            self
4314        }
4315
4316        /// Sets all the options, replacing any prior values.
4317        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4318            self.0.options = v.into();
4319            self
4320        }
4321
4322        /// Sends the request.
4323        pub async fn send(self) -> Result<longrunning::model::Operation> {
4324            (*self.0.stub)
4325                .get_operation(self.0.request, self.0.options)
4326                .await
4327                .map(gax::response::Response::into_body)
4328        }
4329
4330        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
4331        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4332            self.0.request.name = v.into();
4333            self
4334        }
4335    }
4336
4337    #[doc(hidden)]
4338    impl gax::options::internal::RequestBuilder for GetOperation {
4339        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4340            &mut self.0.options
4341        }
4342    }
4343
4344    /// The request builder for [OrganizationVpcFlowLogsService::delete_operation][crate::client::OrganizationVpcFlowLogsService::delete_operation] calls.
4345    ///
4346    /// # Example
4347    /// ```
4348    /// # use google_cloud_networkmanagement_v1::builder::organization_vpc_flow_logs_service::DeleteOperation;
4349    /// # async fn sample() -> gax::Result<()> {
4350    ///
4351    /// let builder = prepare_request_builder();
4352    /// let response = builder.send().await?;
4353    /// # Ok(()) }
4354    ///
4355    /// fn prepare_request_builder() -> DeleteOperation {
4356    ///   # panic!();
4357    ///   // ... details omitted ...
4358    /// }
4359    /// ```
4360    #[derive(Clone, Debug)]
4361    pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
4362
4363    impl DeleteOperation {
4364        pub(crate) fn new(
4365            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationVpcFlowLogsService>,
4366        ) -> Self {
4367            Self(RequestBuilder::new(stub))
4368        }
4369
4370        /// Sets the full request, replacing any prior values.
4371        pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
4372            mut self,
4373            v: V,
4374        ) -> Self {
4375            self.0.request = v.into();
4376            self
4377        }
4378
4379        /// Sets all the options, replacing any prior values.
4380        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4381            self.0.options = v.into();
4382            self
4383        }
4384
4385        /// Sends the request.
4386        pub async fn send(self) -> Result<()> {
4387            (*self.0.stub)
4388                .delete_operation(self.0.request, self.0.options)
4389                .await
4390                .map(gax::response::Response::into_body)
4391        }
4392
4393        /// Sets the value of [name][longrunning::model::DeleteOperationRequest::name].
4394        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4395            self.0.request.name = v.into();
4396            self
4397        }
4398    }
4399
4400    #[doc(hidden)]
4401    impl gax::options::internal::RequestBuilder for DeleteOperation {
4402        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4403            &mut self.0.options
4404        }
4405    }
4406
4407    /// The request builder for [OrganizationVpcFlowLogsService::cancel_operation][crate::client::OrganizationVpcFlowLogsService::cancel_operation] calls.
4408    ///
4409    /// # Example
4410    /// ```
4411    /// # use google_cloud_networkmanagement_v1::builder::organization_vpc_flow_logs_service::CancelOperation;
4412    /// # async fn sample() -> gax::Result<()> {
4413    ///
4414    /// let builder = prepare_request_builder();
4415    /// let response = builder.send().await?;
4416    /// # Ok(()) }
4417    ///
4418    /// fn prepare_request_builder() -> CancelOperation {
4419    ///   # panic!();
4420    ///   // ... details omitted ...
4421    /// }
4422    /// ```
4423    #[derive(Clone, Debug)]
4424    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
4425
4426    impl CancelOperation {
4427        pub(crate) fn new(
4428            stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationVpcFlowLogsService>,
4429        ) -> Self {
4430            Self(RequestBuilder::new(stub))
4431        }
4432
4433        /// Sets the full request, replacing any prior values.
4434        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
4435            mut self,
4436            v: V,
4437        ) -> Self {
4438            self.0.request = v.into();
4439            self
4440        }
4441
4442        /// Sets all the options, replacing any prior values.
4443        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4444            self.0.options = v.into();
4445            self
4446        }
4447
4448        /// Sends the request.
4449        pub async fn send(self) -> Result<()> {
4450            (*self.0.stub)
4451                .cancel_operation(self.0.request, self.0.options)
4452                .await
4453                .map(gax::response::Response::into_body)
4454        }
4455
4456        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
4457        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4458            self.0.request.name = v.into();
4459            self
4460        }
4461    }
4462
4463    #[doc(hidden)]
4464    impl gax::options::internal::RequestBuilder for CancelOperation {
4465        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4466            &mut self.0.options
4467        }
4468    }
4469}