google_cloud_networkmanagement_v1/
builder.rs

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