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